wyzerd
Posts: 75
Joined: Tue Mar 27, 2007 3:54 am
Location: St. Louis, MO
Contact: Website

Installing Prerequisites with passive or fullUI

I have been tasked with installing a prerequisite where the run behavior can change depending upon the machine state.
1. If it is the first run, it must ask the user for the installation path.
2. If it has been installed, it should use the path defined in a previous installation
3. Optionally (and preferred), it should accept command line parameters from the bootstrapper.

What I have done is create 2 prerequisites for the same package. the only difference between them is the existence of a registry key that would have been installed as permanent.
if the key is found, it runs in passive mode and may preform the "upgrade" (automatic uninstall/install) else it installs without the passive switch.

I have not discovered a way to pass the command line parameters to the prerequisites and think that it is probably not available. I thought I would ask though since the answer will either confirm my suspicion or simplify my work.

I have also considered using a script as a prerequisite and having it call the prerequisite, but don't really like that idea very much as it does things outside the the current windows installer package. Further, I think that may produce the dreaded, "you are already running windows installer" message.

Any thoughts?

Thanks,

George
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Installing Prerequisites with passive or fullUI

Hello George,
I have not discovered a way to pass the command line parameters to the prerequisites and think that it is probably not available. I thought I would ask though since the answer will either confirm my suspicion or simplify my work.
In the Install Command Lines field from the Setup Files tab of the prerequisite you can pass the related command line statements for the prerequisite.

You can also take a look on the Add Prerequisites article which may be useful to you.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
wyzerd
Posts: 75
Joined: Tue Mar 27, 2007 3:54 am
Location: St. Louis, MO
Contact: Website

Re: Installing Prerequisites with passive or fullUI

Thanks, Dan. Yes I am aware of that. Perhaps I should have provided an example of the process I described.

The aip I have added is a truncated version of an actual installation I am authoring.

The Prerequisite is installed in passive mode if the Directory is defined in the registry via the "Monaco Physics Database Upgrade" prereq or in Full UI mode if it is not defined.

Perhaps, based upon your suggestion I could Pass the entire "/passive /DBFOLDER=""[CommonAppDataFolder]Database\Physics"""" through the bootstrapper, but I am afraid it would have 2 problems:
1. [CommonAppDataFolder] would likely not be translated.
2. The quotes may cause parsing error.

Take a look at that aip and tell me what you think.

Thanks

G
Attachments
PrereqExample.aip
Example of installing prereq 2 ways based upon registry setting.
(89.45 KiB) Downloaded 410 times
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Installing Prerequisites with passive or fullUI

Hello George,
1. [CommonAppDataFolder] would likely not be translated.
Since it is a predefined folder for Windows Installer, it will be translated accordingly. For example, the CommonAppDataFolder property has the following value:
  • C:\Documents and Settings\All Users\Application Data - on OS below VISTA;
  • C:\ProgramData - on Vista or above
2. The quotes may cause parsing error.
I think is enough to add the following command line statement:

Code: Select all

/passive /DBFOLDER="[CommonAppDataFolder]Database\Physics"
Please let me know if it is working as expected.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”