What happens when advertising an MSI of a currently running application?

1

I'm currently trying to design a service that monitors and downloads update MSIs. The service will run under a built-in account with elevated privileges (e.g. SYSTEM), and will download and advertise an MSI.

This MSI will be an update to an already installed application. I understand that shortcuts, etc. are updated on advertisement, but what happens if the application is already running? What happens if the user launches a second instance of an already running application from this shortcut?

pixelbadger

Posted 2014-06-21T01:03:35.443

Reputation: 129

I'm curious, is this for a work environment, or for home? If home (and you're only really interested in currently installed applications), you might want to give Ninite a whirl. After downloading and installing the apps, you can rerun the installer anytime (or set it as a scheduled task), and it'll download any updates for you.

– Robotnik – 2014-09-24T07:53:21.743

Answers

2

It depends on how the MSI is coded. For example, with WiX, you have to implement a custom action to determine if the app is already running or if the file is locked for writing. I think the default action of an MSI if you have no custom actions is that it just throws a dialogue such as "Abort, Retry, Fail" (or similar) if it tries to write to a file that's locked for editing (as it would be when the application is running).

To handle many of these corner cases that well-known apps handle gracefully (e.g. Skype, Firefox, etc.) -- such as terminating a running instance -- you have to implement custom code. The bare Windows Installer itself (which is all I can assume you have if you're talking about a generic MSI) does not natively support such a feature. It supports rather little out of the box, which is why things like InstallShield exist.

allquixotic

Posted 2014-06-21T01:03:35.443

Reputation: 32 256