Visual Studio 2008 setup project, fixing the locat

2019-02-27 19:26发布

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.

1条回答
孤傲高冷的网名
2楼-- · 2019-02-27 19:47

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:

  1. Welcome
  2. EULA
  3. Folder Form
  4. Confirm Install
  5. ...

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:
alt text http://i40.tinypic.com/2rh7l2o.jpg

...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:
alt text http://i41.tinypic.com/i23n8i.jpg

And the result you want is this:
alt text http://i42.tinypic.com/vnedsh.jpg

To do that manually in Orca, you need only to make a few changes in the Control table:

  1. Delete row where Dialog_="FolderForm" and control="BrowseButton"
  2. set Control_Next = "DiskCostButton", Attributes = 5 where Dialog_="FolderForm" and Control="FolderEdit"
  3. set Y=126 where Dialog_="FolderForm" and Control="DiskCostButton"
  4. set Text='{\VSI_MS_Sans_Serif16.0_1_0}Confirm the Installation Folder...' where Dialog_="FolderForm" and Control="BannerText"
  5. 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.

查看更多
登录 后发表回答