The possible OS are Win7 and WinXP each has its own directory path. Win7 installs in C:\foo and WinXP installs in D:\foo. Is this possible using Setup Project?
I’m currently using VS2005.
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Firstly, if Windows is installed on C: for Windows 7 and on D: for XP, you can simply set Application Folder default path to:
WindowsVolume property is automatically resolved to the Windows partition.
To change the default Application Folder path you can select it in File System Folder and set DefaultLocation field in its Properties pane.
Application Folder from File System Editor is associated with TARGETDIR property. So if you really want to dynamically change it, you can set this property. This can be done through a type 51 custom action (property set with formatted text).
Unfortunately Visual Studio doesn’t support this type of actions. So you can either edit the MSI with Orca to add it or use another setup authoring tool.
A type 51 action can set a folder property only before CostInitialize action. Since you want to set the default installation folder, your action should be scheduled in InstallUISequence table. This way the change will be visible in your installation UI.
After you configured the custom action you can condition it with VersionNT property. For example, your default installation path can be set for Windows 7:
In this case your custom action can set TARGETDIR to the Windows XP path:
and have this condition: