This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: RegDBGetUninstCmdLine - Sample or Direction?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 08, 2011
10:39 AM
RegDBGetUninstCmdLine - Sample or Direction?
I have tried to search for this, I need to find out if any old versions of other installations exist (I am wrapping 3 vendor products with my install, including Java) and I want to be able to find them if they are installed and remove them first before installing my application.
Does anyone have an example of this command working? I read the documentation, but I don't know enough to formulate how the script should look to work yet.
Thanks for any information.
Does anyone have an example of this command working? I read the documentation, but I don't know enough to formulate how the script should look to work yet.
Thanks for any information.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 08, 2011
11:10 AM
It's going to depend on how the uninstallation information is stored. RegDBGetUninstCmdLine's 1st argument is the key under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall - in setups built with older versions of IS (before 6.0), the would be the appname, in all later versions, its the GUID.
So you would be running three tests:
nResult = RegDBGetUninstCmdLine(szKey1,svResult);
if nResult = 0 then
// Uninstall Product 1
endif;
nResult = RegDBGetUninstCmdLine(szKey2,svResult);
if nResult = 0 then
// Uninstall Product 2
endif;
nResult = RegDBGetUninstCmdLine(szKey,svResult);
if nResult = 0 then
// Uninstall Product 3
endif;
NOTE: svResult is a combination of both the app name and any command-line arguments, so you may need to split the string up into 2 parts to pass to LaunchAppAndWait/LaunchApplication. If any of these setups were built with IS, you'll want to include the /clone_wait parameter to ensure that the main installation does not continue until the called setup program finishes processing.
So you would be running three tests:
nResult = RegDBGetUninstCmdLine(szKey1,svResult);
if nResult = 0 then
// Uninstall Product 1
endif;
nResult = RegDBGetUninstCmdLine(szKey2,svResult);
if nResult = 0 then
// Uninstall Product 2
endif;
nResult = RegDBGetUninstCmdLine(szKey,svResult);
if nResult = 0 then
// Uninstall Product 3
endif;
NOTE: svResult is a combination of both the app name and any command-line arguments, so you may need to split the string up into 2 parts to pass to LaunchAppAndWait/LaunchApplication. If any of these setups were built with IS, you'll want to include the /clone_wait parameter to ensure that the main installation does not continue until the called setup program finishes processing.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 09, 2011
09:41 AM
DMorisseau,
So I see the confusing part for me was the svResult which is actually a return value that I should use to launch the uninstaller.
I am using an Basic MSI project so I think I should use the DoInstall instead?
Thanks for your time in responding!
So I see the confusing part for me was the svResult which is actually a return value that I should use to launch the uninstaller.
I am using an Basic MSI project so I think I should use the DoInstall instead?
Thanks for your time in responding!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2011
08:55 AM
I'm not sure that DoInstall is appropriate in this case. You may want to use an InstallScript CustomAction to do this, and schedule it to occur during the Execute Sequence, and set the execution condition to Not Installed to ensure this happens only the 1st time the setup is run.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 23, 2011
12:49 PM
It would seem any method I tried to uninstall this product would not work. I tried the RegDBGetUninstCmdLine and that returned a blank, so I couldn't use it to run the uninstall.
I then tried to manually execute MSI with the GUID of the application from the registry key I went and hunted down manually, and it can't run an MSI if another MSI is running, so the uninstall wouldn't work either.
I think I will have to have my application just check if the previous is installed and just bomb out and let the end user / automated process report the issue and have someone manually uninstall unfortunately. 😕
I then tried to manually execute MSI with the GUID of the application from the registry key I went and hunted down manually, and it can't run an MSI if another MSI is running, so the uninstall wouldn't work either.
I think I will have to have my application just check if the previous is installed and just bomb out and let the end user / automated process report the issue and have someone manually uninstall unfortunately. 😕