Reboot and Auto re-run an MSI
Hi,
I have an MSI installation which launch the uninstall of an old version of the same product (Installshield 6.3 based). This uninstall end with an automatic reboot (the user is warned before).
I would like to re-run automatically the MSI package after the reboot, so I have 2 problems :
- I would like to put something in the registry (??) to re-run automatically (and delete this value once I have re-ran)
- I would like to re-run ONLY if the silent uninstall of the old package proceed well (I should test an exit bit ???)
Do you have any idea or suggestion ?
Thanks !
I have an MSI installation which launch the uninstall of an old version of the same product (Installshield 6.3 based). This uninstall end with an automatic reboot (the user is warned before).
I would like to re-run automatically the MSI package after the reboot, so I have 2 problems :
- I would like to put something in the registry (??) to re-run automatically (and delete this value once I have re-ran)
- I would like to re-run ONLY if the silent uninstall of the old package proceed well (I should test an exit bit ???)
Do you have any idea or suggestion ?
Thanks !
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
VikingLoki
19 years ago
You'll need to create some kind of script/wrapper that will look for an exit code on the uninstall to determine success, if its good then create a reg key in one of the following locations depending on per machine or per user:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Both keys are just like ..\Run, except they are executed once and removed from the registry.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Both keys are just like ..\Run, except they are executed once and removed from the registry.
Posted by:
rikx2
19 years ago
if you could pass the uninstall to msi instead of installshield then you can use something like this for a wrapper..
=========================================
Set objWSH = CreateObject("WScript.Shell")
myuninstall = "msiexec /x <msifile> /qb-"
return = objWSH.Run(myuninstall,1,True)
if return = "1641" Then
Set bolBootNeeded = "True"
objWSH.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\InstallMyMSI", "Your command to your second msi", "REG_SZ"
end if
wscript.quit
=========================================
Set objWSH = CreateObject("WScript.Shell")
myuninstall = "msiexec /x <msifile> /qb-"
return = objWSH.Run(myuninstall,1,True)
if return = "1641" Then
Set bolBootNeeded = "True"
objWSH.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce\InstallMyMSI", "Your command to your second msi", "REG_SZ"
end if
wscript.quit
Posted by:
babric
19 years ago
VikingLoki :
That's fine, I didn't know the "RunOnce" key, exactly what I need !
rikx2 :
I don't understand what you mean. What do you mean by "pass the uninstall to msi" ?
My msi package launch (using a CA 34 + *.iss file) a silent IS uninstall during the MSI UIsequence. once that it is done, there is an automatic reboot. I hope that the IS uninstall ends up before the MSI stops (because of the reboot).
one another solution would be to make an IS silent uninstall which doesn't reboot, and this is the MSI which reboots if the exit code is good. MMmmh, that would be cool. But I need to find how to automatically reboot in an MSI, conditionned by an exit code... :-/
That's fine, I didn't know the "RunOnce" key, exactly what I need !
rikx2 :
if you could pass the uninstall to msi instead of installshield then you can use something like this for a wrapper..
I don't understand what you mean. What do you mean by "pass the uninstall to msi" ?
My msi package launch (using a CA 34 + *.iss file) a silent IS uninstall during the MSI UIsequence. once that it is done, there is an automatic reboot. I hope that the IS uninstall ends up before the MSI stops (because of the reboot).
one another solution would be to make an IS silent uninstall which doesn't reboot, and this is the MSI which reboots if the exit code is good. MMmmh, that would be cool. But I need to find how to automatically reboot in an MSI, conditionned by an exit code... :-/
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.