We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Mike VP
Posts: 2
Joined: Fri Feb 21, 2014 1:10 pm

Prevent file in use warning dialog

In my application, one of the third party libraries I use has a license manager executable which runs continually in the background. The documentation says that when installing that the installer should call the executable with the /install option (eg. "LicensingService.exe /install") and when uninstalling to call the executable with the /uninstall option (eg. "LicensingService.exe /uninstall"). Both of these calls should be done with admin permissions.

I have set up custom actions which make these appropriate calls to the executable on installation and uninstall. My problem is though that when I uninstall my application, or perform an upgrade, the installer warns me that some of the files which will be modified are in use. Technically this is correct at the time of this message appearing, but due to the custom action the file is not actually in use when it comes to removing/modifying the LicensingService.exe file.

My question is how I can tell AdvancedInstaller not to check whether this file is in use, the custom action will ensure that. If it is not possible to prevent this warning for this file, then is there a way I could set the custom action to occur before the check of files being in use? Keep in mind that this custom action must be run as administrator and if the uninstall fails then I would need to perform a reverse action to install (IE. call "LicensingService.exe /install") to ensure the application will still work fine.

Thanks for any help.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Prevent file in use warning dialog

Hello Mike and welcome to Advanced Installer forums,
My question is how I can tell AdvancedInstaller not to check whether this file is in use, the custom action will ensure that.
Please note that this dialog ("FilesInUse" on XP and "MsiRMFilesInUse" on Vista) is shown automatically by Windows Installer during the InstallValidate standard action when the installer checks if any file is in use and if so, it displays that dialog.

This dialog can be avoided by running a Detect and Stop custom actions before the install/uninstall process which stops the processes which use the files.
Please take a look on the Detect or stop a process How-to article which may be useful to you.

Also, you can take a look on our How is Files in Use determined - can it be overridden? forum thread which debates a similar subject.

Please let us know if that helped, otherwise give us more details about your specific scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mike VP
Posts: 2
Joined: Fri Feb 21, 2014 1:10 pm

Re: Prevent file in use warning dialog

Thanks for that.

So reading the how to on stopping a process, I am left with a couple of questions.

* Instead of just terminating the process can I make such a custom action run a command?
* Can such a placed custom command perform its action as admin? I understand from the article yes but I just am not sure as in the uninstall case the warning dialog appears even before the installer brings up the security dialog asking for admin rights. NOTE: This differs from the upgrade process where the warning dialog appears after the security dialog where I grant the installer admin rights.

Sorry for having to ask the above, I would just try it to find out whether it is possible, except for the fact that the custom action positioning screen is awful for accessibility for visually impaired users who use screen readers such as NVDA (http://www.nvda-project.org), so it is very time consuming (if possible) for me to place the custom actions where I want without help from another person.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Prevent file in use warning dialog

Hi Mike,

You can enable the "Run as administrator" option from the Install Parameters page. The benefit of elevating the bootstrapper application is that privileges are elevated only once (if necessary and at the beginning of the installation) and these privileges are inherited by custom action and installation's prerequisites, if any, without requiring multiple elevation prompts. 

Please let us know if that helped, otherwise give us more details about your specific scenario.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”