您的位置:首页 > 大数据 > 人工智能

Why the shortcut created by my MSI install start the setup process again each time?

2011-11-08 10:59 459 查看
MSI comes with an auto-repair feature that checks whether all components installed by MSI are still present when you launch your application using the shortcut.

In your case, probably one (or more) components have been removed so the installer is launched again to repair your installation.

To prevent auto-repair from running either

Make sure no file, registry setting or other installed component is removed

or

Don't set the key path for those components. That will prevent MSI from checking those specific components

From your other questions it seems that your MSI has been created by a Visual Studio Setup and Deployment Project. Unfortunately, there is no option to modify the key path from within Visual Studio. You have the following options:

Modify the MSI manually using Orca (This is not a good option because it is a manual step) (Property = 'DISABLEADVTSHORTCUTS' Value = '1')

Write a script e.g. using VBScript to patch the MSI file

Move to a more advanced install system which gives you more control such as WiX or NSIS

msiexec /i <msi file> DISABLEADVTSHORTCUTS=1.

一个好的解决方法是,在Visual Studio中在一个Custom UI dialog中override "DISABALEADVTSHORTCUTS"的值。

Here is how I did it:

Open the User Interface for your Deployment project (with the deployment project active choose View>Editors>User Interface).

Select the "Start" section of the User Interface and then from the action menu choose "Add Dialog" and add a "Textboxes" dialog.

In the properties pain for the Textboxes dialog set the BannerBitmap, BannerText, and BodyText properties to something informative to the user running the install (the user will never know that this dialog is doing something behind the scenes).

Set the following properties for the Textboxes dialog:

Edit1Property: DISABLEADVTSHORTCUTS

Edit1Value: 1

Edit1Visible: false

Edit2Visible: false

Edit3Visible: false

Edit4Visible: false

That’s it. When windows installer gets to that dialog and the user clicks "Next" it will insert the property DISABLEADVTSHORTCUTS = 1 into the property table and so when the actual install occurs standard windows shortcuts will be used instead of advertised
shortcuts.

Note: Due to the advantages of advertised shortcuts I recommend using the default setting if it will work in your situation. Only use this work-around if you have some reason to need standard shortcuts.

MSI默认提供的是Advanced Short-cuts.
One advantage of advertised shortcuts is you can have certain features be installed on demand, and I think missing files
can also be repaired if I'm not mistaken. The downside as a user that I hate is I sometimes want to find out where the executable is and which executable is run and it's harder to find that out.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐