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: LaunchAppAndWait with msiexec doesn't wait
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
‎Jun 22, 2015
10:40 AM
LaunchAppAndWait with msiexec doesn't wait
Hi All
I have Basic MSI Project where I am trying to uninstall previous version of the product that was created by different developed.
I was thinking using msiexec since it seems to work fine from command line.
I created InstallScript function and set it to:
Synchronous (Check exit code)
Immediate Execution
Always execute
After File Cost
[HTML]
function UninstallSilently(hMSI)
NUMBER nResult;
begin
if(LaunchAppAndWait("msiexec", "/uninstall {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} /passive", WAIT | LAAW_OPTION_WAIT_INCL_CHILD) < 0)then
MessageBox ("Failed to uninstall",SEVERE);
endif;
end;
[/HTML]
I can see that it starts uninstalling previous product, but it exits before it's done uninstalling.
So my question is how to make sure that LaunchAppAndWait will wait for product uninstall and then continue?
Or if you have better way to uninstall previous product I will be happy to hear it.
Thank you in advance.
I have Basic MSI Project where I am trying to uninstall previous version of the product that was created by different developed.
I was thinking using msiexec since it seems to work fine from command line.
I created InstallScript function and set it to:
Synchronous (Check exit code)
Immediate Execution
Always execute
After File Cost
[HTML]
function UninstallSilently(hMSI)
NUMBER nResult;
begin
if(LaunchAppAndWait("msiexec", "/uninstall {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} /passive", WAIT | LAAW_OPTION_WAIT_INCL_CHILD) < 0)then
MessageBox ("Failed to uninstall",SEVERE);
endif;
end;
[/HTML]
I can see that it starts uninstalling previous product, but it exits before it's done uninstalling.
So my question is how to make sure that LaunchAppAndWait will wait for product uninstall and then continue?
Or if you have better way to uninstall previous product I will be happy to hear it.
Thank you in advance.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 22, 2015
01:11 PM
Why are you not just simply authoring the uninstall table to remove the previous version? Essentially that is the purpose for this table. It can even have a different upgrade code and specify version ranges.
One problem that might occur using your approach is that only one MSI installer can run at a time. If you are sequencing this in the EXECUTE sequence, then it should error out.
One problem that might occur using your approach is that only one MSI installer can run at a time. If you are sequencing this in the EXECUTE sequence, then it should error out.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 22, 2015
01:13 PM
DLee65 wrote:
Why are you not just simply authoring the uninstall table to remove the previous version? Essentially that is the purpose for this table. It can even have a different upgrade code and specify version ranges.
One problem that might occur using your approach is that only one MSI installer can run at a time. If you are sequencing this in the EXECUTE sequence, then it should error out.
Thank you for response, can you point me where I can find how to use "uninstall table to remove the previous version"?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 22, 2015
01:38 PM
I am sorry, I mistyped. You need to configure the upgrade table.
You will want to get familiar with this table and the values you need to know. The help file has a section regarding the upgrade table, just open help, type in 'Upgrade Table' in the Index. This will give an explanation of the columns, their data types, etc.
Below is an example of what I use to upgrade a previous version that was created by someone else:
UpgradeCode MinVer MaxVer Attributes ActionProperty ISDisplayName
{10817CA8-89D1-11D6-B3F4-00034721ED1B} 1.0.1 ***ALL_VERSIONS*** 772 UPGRADE_EARLY_AC_APP1 NewUpgradeEntry1
You will need to get the upgrade code from your previous MSI installer. You will also want to figure out what the absolute minimum version you want to support for upgrade. IF the upgrade code is the same between yours and the previous version, then you can simply insert {00000000-0000-0000-0000-000000000000} and at compile time the current UPGRADECODE will be inserted.
InstallShield also has a UI section for creating a new upgrade event. In the view list, scroll down to 'Media' and click on 'Upgrades'. You want to author a new major upgrade for each previous UpgradeCode. In most cases you can simply specify 'Any earlier version' for the Product Version.
Read up on the advanced settings. You may want to migrate feature states, OR ignore them entirely; especially if you have restructured the features within your new install.
Hopefully this helps.
You will want to get familiar with this table and the values you need to know. The help file has a section regarding the upgrade table, just open help, type in 'Upgrade Table' in the Index. This will give an explanation of the columns, their data types, etc.
Below is an example of what I use to upgrade a previous version that was created by someone else:
UpgradeCode MinVer MaxVer Attributes ActionProperty ISDisplayName
{10817CA8-89D1-11D6-B3F4-00034721ED1B} 1.0.1 ***ALL_VERSIONS*** 772 UPGRADE_EARLY_AC_APP1 NewUpgradeEntry1
You will need to get the upgrade code from your previous MSI installer. You will also want to figure out what the absolute minimum version you want to support for upgrade. IF the upgrade code is the same between yours and the previous version, then you can simply insert {00000000-0000-0000-0000-000000000000} and at compile time the current UPGRADECODE will be inserted.
InstallShield also has a UI section for creating a new upgrade event. In the view list, scroll down to 'Media' and click on 'Upgrades'. You want to author a new major upgrade for each previous UpgradeCode. In most cases you can simply specify 'Any earlier version' for the Product Version.
Read up on the advanced settings. You may want to migrate feature states, OR ignore them entirely; especially if you have restructured the features within your new install.
Hopefully this helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 22, 2015
02:46 PM
DLee65 wrote:
I am sorry, I mistyped. You need to configure the upgrade table.
You will want to get familiar with this table and the values you need to know. The help file has a section regarding the upgrade table, just open help, type in 'Upgrade Table' in the Index. This will give an explanation of the columns, their data types, etc.
Below is an example of what I use to upgrade a previous version that was created by someone else:
UpgradeCode MinVer MaxVer Attributes ActionProperty ISDisplayName
{10817CA8-89D1-11D6-B3F4-00034721ED1B} 1.0.1 ***ALL_VERSIONS*** 772 UPGRADE_EARLY_AC_APP1 NewUpgradeEntry1
You will need to get the upgrade code from your previous MSI installer. You will also want to figure out what the absolute minimum version you want to support for upgrade. IF the upgrade code is the same between yours and the previous version, then you can simply insert {00000000-0000-0000-0000-000000000000} and at compile time the current UPGRADECODE will be inserted.
InstallShield also has a UI section for creating a new upgrade event. In the view list, scroll down to 'Media' and click on 'Upgrades'. You want to author a new major upgrade for each previous UpgradeCode. In most cases you can simply specify 'Any earlier version' for the Product Version.
Read up on the advanced settings. You may want to migrate feature states, OR ignore them entirely; especially if you have restructured the features within your new install.
Hopefully this helps.
Hi again,
I followed your advice, but it doesn't seem to do anything. Below is my Upgrade Table:
I made sure that my upgrade code is correct.
Any ideas why?
Thank you for your help.
//---Update---//
I didn't had any components in my example so it wasn't working. I added component and followed your advice and it seems to work. Thank you very much.