VS2013 Installer Project - install file that will not be permanent

73 views Asked by At

I am using a Visual Studio 2013 Installer Project to install/update my C++ app. In order to update the client database I am installing the new master database under a temporary name. When my app starts it checks to see if the temp file is there - if present it runs the db update function and removes the temporary when done. The problem - when my app is then started, the user gets "Windows is configuring ... " because the temp database file that was installed is now missing. There is no property to control this in the VS installer project. In Orca I have found the row in the FeatureComponents table that sets DefaultFeature for this file. The event list tells me it is DefaultFeature on this file that triggers the behaviour. If I remove that table row in Orca, the file doesn't get installed. Does anyone know the correct method for me to use to install a file that I can subsequently delete without any consequence?

1

There are 1 answers

0
PhilDW On

The official way to do this has no support in VS setup projects. You need to set the component id to null for the file you are going to remove after the install, see the ComponentId column:

https://msdn.microsoft.com/en-us/library/aa368007(v=vs.85).aspx

so you'd need to edit the MSI file with Orca to set that guid column to empty for that file. If you look at the Component column (starts with C_) you'll see that in the Component_ column of the file table, that should help you you find it.

Other methods are unreliable (because, for example, there are other ways a repair can start and attempt to restore the file).