cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nagash_42
Level 3

Install another MSI if no registry key is found

I'm evaluating InstallShield and am getting quite confused on how to accomplish simple conditions in the installation process. My problem is as follows: I need to Install MS Word Viewer because the application I am installing needs it as a precondition. If it already is installed, I just want to write the command as found in the registry under "HKEY_CLASSES_ROOT\Applications\wordview.exe\shell\Open\command" to a text file. I thought I could check if said key is in the registry and otherwise call Word Viewer's .msi. I can check for the key by using the System Search or in a custom InstallScript using the RegDBKeyExist function. But that's as far as I get. How do I start the .msi depending on if I found the key? Can I just use the INI-file change tool to write the key to my file?
Labels (1)
0 Kudos
(3) Replies
Nil_Developer
Level 3

I think you r using installscript msi project.You can install msi using below installscript code.

if(RegDBKeyExist(" ") ==1 ) then

//do nothing
else
LaunchAppAndWait (SUPPORTDIR^"msi name", "/qn", LAAW_OPTION_MINIMIZED | LAAW_OPTION_WAIT);
endif;


Regards
Nilesh
0 Kudos
Nagash_42
Level 3

Thank you for your help.

If I call the installer like this, would I have to remember this installation (in the registry? a .ini?) and undo it in the uninstall (how?) or can I somehow make InstallShield uninstall the included .msi if it was installed by the installation?

Can I use a prerequisite to do this? Will a prerequisite be uninstalled if it was installed only for my app?
0 Kudos
Nil_Developer
Level 3

You can uninstall MSI when you uninstall your application.

For uninstall you can find string in registry :HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ Product_Guid.

search for uninstall string in above key.

I never used prerequisite. But as per logic it should uninstall when you will uninstall your application.
0 Kudos