cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
LKM_N4EN
Level 6

System Search Wizard - Registry

In my Basic MSI project, I use the system search wizard to detect whether older version of my application is installed (was done by installscript project). I entered the "Registry Root" and the "Registry Key", leave the "Registry Value" empty, then store the value in a property named "OLDVERSION_EXIST".

1. Now I am having problem in writing the conditional statement in installscript function. After using the MSIGetProperty to retrieve the value of "OLDVERSION_EXIST", I found out that it always return empty string. So how could I detect whether the registry entry is exist?

2. To launch the uninstallation (setup.exe), I use the "LaunchAppAndWait". The return value of "LaunchAppAndWait" will only detect whether it is successful to launch but not the successful of uninstallation. How can I capture the return value if user click cancel on the uninstallation so that the setup will abort?

3. After the uninstallation of previous version, user is required to restart the machine. What should I do so that the setup will continue upon restart of machine?
Labels (1)
0 Kudos
(2) Replies
DLee65
Level 13

I believe that when you check for the Key and leave the name blank, then the system search will retrieve the default value, which is usually blank.

I am not certain how to specify search to see if the key exists, rather than a name/value pair.
Note that I think system search works by populating your property with the value of either the default or the specified name. I believe I had to create a CA to do this a while ago, but I cannot be certain. I created an InstallScript CA that checks to see if RegDBKeyExists(szKey) and if it does then I set MYPROPERTY = 1.

For the reboot after uninstalling the previous app, are you using a custom action to uninstall the previous app? I thought the Windows Installer engine would take care of restarting the app in this scenario if you are using the Major Upgrade path. Also I thought it was smart enough to handle installing your app first and then asking for a reboot.
0 Kudos
LKM_N4EN
Level 6

1. You are right! It always retrieve the default value where usually is blank.
I will try to use the RegDBKeyExists..

2. Now I am using the "DoInstall" to launch the setup.exe since I can get the return value of launching the setup.exe. But the problem now is with the parameter i passed. I use "setup.exe /x /forcerestart /s" as the command parameter. The previous setup will always launch in maintenance mode, user might choose to repair in this case and I have to handle this situation. Is there anywat to specify only the "remove"? Also, the /s does not run the installation, so I could not run it in silent mode.

3. As I mentioned above, I use "setup.exe /x /forcerestart". Although I also pass "/forcerestart" in the parameter (actually the previous setup did handle this, but user may choose to restart later) and the parent setup still continue. What I would like the setup to do is to force restart after uninstallation and then resume the setup upon reboot. Any idea on this?
0 Kudos