Search code examples
c#visual-studiowindows-installervisual-studio-setup-projevisual-studio-setup

In-use files not updated by MSI-installer (Visual Studio Installer project)


I'm using the Visual Studio Installer Projects extension to build the MSI-installer for my application. However, my application is meant to be running at all times, and if it's open when the user is installing a new version of my software, the open files are not overwritten, and very little to nothing is actually updated (although there are no installer-errors).

I've found that using the installer project's "Custom Actions" to run a script that closes the application doesn't help, as none of the actions are called before the files are replaced.

Is there a good way to make sure the open/locked files gets terminated before the files are supposed to be overwritten?


Solution

  • This isn't a solution to the problem, but rather another solution; the one requiring the least work in the end.

    I ended up not using 'Visual Studio Installer Projects' for my installer. Instead I looked to Advanced Installer, which just works with no issues. Things like this is taken into account, and custom actions allow for more options.

    If your project is open source, you can write to them about a free open source "professional" license, equal to their "professional" plan, which is normally $399 (onetime purchase).