PDA

View Full Version : كد Repair فايل msi



sanaz e
دوشنبه 08 دی 1393, 14:29 عصر
سلام دوستان
من كدي براي install كردن يك فايل msi كه ستاپ برنامه هستش نوشتم.
ولي مي خوام بعد از install كدي بنويسم كه عمليات repair رو روي فايل msi انجام بده.
لطفا به من بگيد چطور ميشه اين كد رو بنويسم؟
با تشكر

Mani_rf
دوشنبه 08 دی 1393, 16:05 عصر
بر اساس این لینک (http://technet.microsoft.com/en-us/library/cc759262(v=ws.10).aspx#BKMK_Repair) :



msiexec /f [p][o][e][d][c][a][u][m][s][v]{Package | ProductCode}
Parameters/fEnables one or more of the command-line options listed in the following table.

Command
Description



p

Reinstalls only if file is missing.



o

Reinstalls if file is missing or if an older version is installed.



e

Reinstalls if file is missing or an equal or older version is installed.



d

Reinstalls if file is missing or a different version is installed.



c

Reinstalls if file is missing or the stored checksum does not match the calculated value.



a

Forces all files to be reinstalled.



u

Rewrite all required user-specific registry entries.



m

Rewrites all required computer-specific registry entries.



s

Overwrites all existing shortcuts.



v

Runs from source and re-caches the local package.

sanaz e
سه شنبه 09 دی 1393, 07:02 صبح
سلام دوست عزيز و تشكر از پاسختون
من كد زير را براي install نوشتم:
dim p as new process
p.startinfo.filename=mayfile.msi
p.start()

براي كد repair هم اين خط رو به كد بالا اضافه كردم كه خطاي windows installer ميده


p.startinfo.arguments="/f "myfile.msi" "

sanaz e
سه شنبه 09 دی 1393, 07:03 صبح
آيا كد من به اين صورت درسته يا روش ديگه اي بايد اين Command رو به كد تزريق كنم؟

Mani_rf
سه شنبه 09 دی 1393, 08:58 صبح
اگر نیازی به دنبال کردن Process توی برنامه نداری ساده ترین راه اینه که به این صورت بنویسی :
Shell("mayfile.msi /f")

sanaz e
سه شنبه 09 دی 1393, 14:43 عصر
ميشه درمورد اين كد بيشتر توضيح بديد...
يعني به همين صورت بايد استفاده بشه يا بعد از پروسه اينستال

Mani_rf
چهارشنبه 10 دی 1393, 09:03 صبح
متد Shell تو VB.net دقیقا کار Command Line ویندوز رو انجام میده. یعنی میتونید با اون دستورات رو به همیون شکل اجرا کنید. من تو این خط کد فایل msi شما رو اجرا کردم و بهش پارامتر فرستادم. این که تو چه مرحله ای باید اجرا بشه بسته به نیاز شما و با پارامتر هایی که توی جدول نوشته تعیین میشه