Different Install directory xp or vista - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Different Install directory xp or vista

Hello,

I am new to AI but an experienced user of a competitor's product which is script based. I am struggling to find out how to set a different install location for XP or Vista. for XP I want the files installed in c:\program files\.... and for Vista in c:\program data\..... which I think is appliacation data in the files and foilder window.

I have been reading the forum for an hour are not managed to find an explanation for the XP or Vista issue.

can anyone please give me some pointers. I think involves a launch condition and some custom variables?

regards
Paul
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Different Install directory xp or vista

Hi Paul,

What you need can be done by using two "Property set with formatted" custom actions. The path of "Application Folder" from the "Files and Folders" page is stored in the APPDIR property. The value of this property can be easily changed at the beginning of the installation through custom actions.

The two custom actions can be scheduled under "InstallUISequence" -> "Begin" and they should look like this:

Custom Action 1:

Code: Select all

Property Name:   APPDIR
Formatted Text:  [ProgramFilesFolder][Manufacturer]\[ProductName]
Expression:      VersionNT=501 (this is in the "Execution Condition" section)
Custom Action 2:

Code: Select all

Property Name:   APPDIR
Formatted Text:  [WindowsVolume]ProgramData\[Manufacturer]\[ProductName]
Expression:      VersionNT=600 (this is in the "Execution Condition" section)
The VersionNT property will determine which of the two custom actions will run. To make sure that the custom actions will be executed even if no UI is used for the installation, you can do this:
- use the "Show Standard Action" button on the toolbar of the "Custom Actions" page to show the "InstallExecuteSequence" -> "Begin" standard action
- select the first custom action
- while the SHIFT key is pressed, drag the custom action from "InstallUISequence" -> "Begin" to "InstallExecuteSequence" -> "Begin" (this will share the custom action between the two sequences)
- in the Custom Action Properties page select the "Execute only once if present in both sequence tables" option

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Different Install directory xp or vista

Thanks Cosmin,

The custom action has default name propertysource presumably I can rename these? This makes sense to map the APPDIR. What is confusing me is where I add my files in the files and folders view. At the moment I have them in "local application data" "local" is not referring to my local machine presumably ?

regards
Paul
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Different Install directory xp or vista

Hi Paul,
The custom action has default name propertysource presumably I can rename these?
Yes, the custom actions can be renamed.
What is confusing me is where I add my files in the files and folders view.
Usually the application files are added in the "Application Folder" directory. This uses the APPDIR property for its path.
At the moment I have them in "local application data" "local" is not referring to my local machine presumably ?
The "Local Application Data" folder will be resolved to the "Application Data" folder under the "Local Settings" directory of the current user account (for example, "C:\Documents and Settings\<username>\Local Settings\Application Data"). This folder uses a predefined Windows Installer property which is resolved automatically. Please note that you can find more information about the installation folders in the Folder paths help article.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”