Windows Installer/Visual Studio Installer - Prevent File reinstall

Posted on 2006-05-26
Last Modified: 2008-01-09
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.
Question by:wraith821
    LVL 5

    Expert Comment

    I think you need to ask this in 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.

    LVL 14

    Assisted Solution

    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.

    LVL 10

    Accepted Solution


    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

    hope that helps..
    LVL 8

    Author Comment

    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.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now