Installer automatic repair feature
Applications I install with a VS 2k开发者_运维问答8 Installer Project MSI file check to make sure that no installed files have been deleted before the app launches and run the installer to fix this if they do. How can I turn this off so? eg so that I can include sample files with my app.
EDIT: to clarify the behavior happens when starting the app via an installed shortcut, not when running it from the HD directly.
You're launching the application from an "Advertised Shortcut" which will trigger the repair functionality.
Solution 1 - install sample files as read-only and then copy them to a per-user location when they're being used (so that Windows Installer doesn't even know about the user copies)
Solution 2 - Set the DISABLEADVTSHORTCUTS property to create "standard" rather than "advertised" shortcuts during installation.
You really should redesign your application so that installed files are never modified, but if you're after a quick and dirty fix solution 2 above should do the trick.
Dont set the key path for the component containing the files you don't want to auto-repair.
精彩评论