I've created a setup project in Visual Studio 2008. I would like the installed location DefaultLocation never to be modified by the user during installation, probably by skipping the 'Select Installation Folder' dialog during setup. Is there a way to do this, either in VS2008 (or VS2010) or using an MSI editor such as Orca. Please advise at your earliest convenience, thanks.
Yes, you can do it in Orca, manually, or you can write a post-processing script that uses the WindowsInstaller.Installer
COM object to doctor-up the MSI.
The MSI I have generated from Visual Studio present this on install:
- Welcome
- EULA
- Folder Form
- Confirm Install
- ...
On the Folder form, there's a Browse...
button that allows the user to select the folder to install into. Sounds like you just want to disable THAT particular action, without changing the flow of the install otherwise.
If this is the original:
...you want to just lose the Browse button. But to avoid confusion, you will need to also alter the text on that dialog as well. Confirm the install folder instead of Select the install folder. And you need to modify the text that tells people to click Browse. And then probably move the Disk Cost button up, just for aesthetic purposes.
These are the changes:
And the result you want is this:
To do that manually in Orca, you need only to make a few changes in the Control table:
- Delete row where Dialog_="FolderForm" and control="BrowseButton"
- set Control_Next = "DiskCostButton", Attributes = 5 where Dialog_="FolderForm" and Control="FolderEdit"
- set Y=126 where Dialog_="FolderForm" and Control="DiskCostButton"
- set Text='{\VSI_MS_Sans_Serif16.0_1_0}Confirm the Installation Folder...' where Dialog_="FolderForm" and Control="BannerText"
- set Text = '{\VSI_MS_Sans_Serif13.0_0_0}The installer will install [ProductName] to the following folder. To install in this folder, click "Next".' where Dialog_="FolderForm" and Control="Body"
To automate these changes, you can write a Javascript module, as described in this answer, but using the changes described above, instead.