views:

81

answers:

2

Applications I install with a VS 2k8 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.

+1  A: 

Dont set the key path for the component containing the files you don't want to auto-repair.

Nestor
How would I do this?
Dan Neely
You can use Orca to edit the MSI and clear the key flag in the files / registry entries.
Nestor
So this would be something that I'd have to do manually after each time I'd build the installer?
Dan Neely
You could easily script it, an MSI is just a database and the Windows SDK includes a bunch of sample VB scripts including one that lets you execute arbitrary SQL against any MSI database.
sascha
+1  A: 

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.

sascha
Thanks. However I ended up switching to inno-setup because the obfuscation tool I'm using (Customer Requirement) confused the dependency analyzer in visual studio.
Dan Neely