kylec
Posts: 22
Joined: Thu Jan 29, 2015 9:59 pm

Set secondary file path based on Install Type

Hello,

In my scenario i'm doing a per machine if admin or per user install and I've added the install type dialog. My issue concerns creating a 2nd custom folder path dialog. All the paths set in the install dialogs need to be passed along to a 3rd party installer which is set as a pre-req and runs silently. The 3rd party installer needs to be run with the below commands depending on if the install type is set to 'Everybody' or 'Only for me'.

Scenario A (Everybody)
/S /AllUsers "/USERNAME=[USER_PROFILE]" /D=[APPDIR]

Scenario B (Only for me)
/S "/USERNAME=[USER_PROFILE]" /D=[APPDIR]

Additionally in scenario A the [USER_PROFILE] needs to be set to the C:\users\public\documents. In Scenario B it needs to be set to %USERPROFILE%\Documents. The purpose of the /AllUsers command in scenario A is required by the 3rd party installer to place shortcut icons it creates in the C:\ProgramData\Microsoft\Windows\Start Menu\Programs and shortcuts on the desktop in the c:\users\public\desktop
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Set secondary file path based on Install Type

Hello,

If the prerequisite is feature-based then you can use formatted references in its command line field.

With formatted references you can try to compose the required command line with a custom action as follows:
- create a new public property let's call it PREREQ_COMMAND_LINE and set its value to the "Only for me" command line
- reference it in the prereq command line field like this:

Code: Select all

[PREREQ_COMMAND_LINE]
- go to custom actions page and add a "Set installer property" custom action after "Paths Resolution" action group, right before "Preparing" in "Install Execution Stage"
- set the custom action's "Value" field to "Everybody" command line
- set the custom action's condition field to ALLUSERS

This way the feature-based prerequisite's command line would be conditionally set, based on the install type.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kylec
Posts: 22
Joined: Thu Jan 29, 2015 9:59 pm

Re: Set secondary file path based on Install Type

Mihai,

Thank you for your response. I attempted your steps and still was not successful. I've submitted my AIP to support with the subject of this post.



Thank you.

Return to “Building Installers”