• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Windows Installer/Visual Studio Installer - Prevent File reinstall

Hello experts.

I hope you can help.

I have a program that i have packaged with Visual Studio Installer. In the setup package i want to include files that may or may not be used. the files packaged with the installer include some reports. In the program the reports come up in a listbox that allows the user to select the report he/she wants to run. Some of these reports will never be used and therefore could be removed from the list.

However, when i rename or delete the report, windows installer wants to put the file back.

is there some way to prevent this. can i set an option in the installer build environment in interdev for each file i want to behave this way, or do i have to edit the package with orca after it is build, and if so what do i edit.

Thanks in advance.
2 Solutions
I think you need to ask this in vb.net or one of the .net group because you are using MSI. I wish I had the answer you need because I had a similar problem but isn’t that the whole point of using the MSI. I thought the Window Installer keeps track of what files were installed and if it becomes missing then it will copy a new file to replace the missing one or wrong version. I have a lot to learn when this company switches to MSI.

In Interdev Open the Project Explorer (Ctrl + Alt + J) and look on Files. Left button popup menu will open on each file and there is a delete option.
I don't think theu are coming back post that delete.

Make sure you remove old test installers form Control Panel before starting a new test round. If the project frame is same there is same GUID for old and new version there is temp files form the old.


The problem you're experiencing is due to your MSI 'self-repairing' itself.

This is triggered because you're deleting files which are (as far as Windows Installer is concerned) flagged as 'key files' - ie. Your MSI has 'marked' them as critical to your installation and to be checked for existence/version etc. when your application is called.

In this case, I suspect it's because each file in your VS project is contained in its *own* component and therefore every file is also marked as a 'key file'   (A component is the most granular part of an MSI that can be 'self-repaired' and each component must contain one and only one key file.)

In VS Installer, you need to group yout reports into one component and then flag one of them as a key file (you may want to add a dummy file into you 'reports' folder which can be the key file, so *any* of the reports can be renamed/deleted safely)

To learn more about grouping your files into components and selecting a key file see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsinstal/html/vehowaddingfilestosetupproject.asp

hope that helps..
wraith821Author Commented:
Fosterjo - I have been working on this for three weeks and i had no idea it was that simple. Thank You

Matti - i gave you 20 points for suggesting an uninstall because it would have kept me wondering why Fosterjo's suggestion wasn't working.

Great Job Both of you. i wish there were more points to give. but i only have 500.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now