.NET Setup Package Installer

I have a .NET 3.5 installation project that successfully installs my application.

The installation package deploys the number (about 70) of custom files for use within the application.

From time to time I have a requirement to delete some of these files, however, after restarting the executable file, it will automatically run part of the MSI installer again and reinstall these files.

The only way to achieve the desired result at the moment is to delete the files after running the executable file.

I looked at the file attributes in the installation package, such as Vital and PackageAs, however, it seems that I can not determine the required parameter to achieve this.

Does anyone know what is needed for this?

Many thanks

+4
source share
3 answers

It annoyed me too, and I don’t know the specific settings you need to change to prevent this, but I can tell you about what I used. I found that this only happens when starting the application from a shortcut that was installed as part of the installation. Thus, if you create a new shortcut for the application and run it through this shortcut, then deleted files will not be automatically restored.

+1
source

From http://msdn.microsoft.com/en-us/library/kz0ke5xt%28v=VS.100%29.aspx

"How to disable file recovery, which is expected to change or delete users?

Visual Studio creates advertised shortcuts so that when you start the program, it checks that all its files exist. To change this behavior and prevent it from repairing the file, select the files in the installation project and change the Condition property to NOT REINSTALL so that the file is not reinstalled for repair and its Transitive property is TRUE so that the condition is re-evaluated. This will cause the installer to flash on the screen for the first time after deleting the file, as it checks that the file should not be reinstalled, but after that you will not see the installer. "

+2
source

Windows Installer supports three types of product updates: major updates, minor updates, and minor updates. A brief description of the update for use under any circumstances can be found here: http://helpnet.flexerasoftware.com/robo/projects/installshield12helplib/MajorMinorSmall.htm

What you want to do is install the installer so that the new version of your software considers deleting files as updates to the previous version. If you do not, and then you delete the files, the installation of the program considers that it is damaged and tries to restore the files that you deleted when the program is executed again.

In InstallShield (the installer product I am familiar with) there is a product GUID and update the GUID . The Upgrade upgrade guide always remains unchanged in the product family of different versions. The product GUID changes with each new version of MAJOR or MINOR. In general, if you follow this pattern and then specify file deletions in your new version, the installer should interpret the file deletion as updates, and you should not get any errors when you subsequently execute the recently installed version.

0
source

Source: https://habr.com/ru/post/1304953/


All Articles