elizabeth
Posts: 1
Joined: Tue Jul 03, 2018 5:22 pm

Launching .bat file on uninstall is opening file explorer

Tue Jul 03, 2018 6:09 pm

I have an installer that I've been working on and noticed that my .bat file that I have launching in a LaunchFile custom action on uninstall isn't running when I uninstall the program from Programs & Features on Windows (testing on both Windows Server 2012 and Windows 10). The .bat file executes fine when I run the uninstall through the installer executable.

I changed the settings for the action and deselected 'Hide program's window' so that I could see what was happening. This revealed that upon getting to the LaunchFile action, it does not actually run a command line but it instead is launching a file explorer to the C:\Windows\system32 directory.

I thought at first it could just be my specific project, but I created a simple test installer that only has a simple .bat file trying to execute on uninstall and I get the same issue. I've tried several combinations of settings on the LaunchFile action to no avail. Any insight would be appreciated, as I can't figure out why it's only not working when uninstalling through Programs & Features.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launching .bat file on uninstall is opening file explorer

Thu Jul 05, 2018 9:20 am

Hi and welcome to our forums.

I'm not sure why you encounter this problem. Can you please send me a sample project that reproduces the problem to support at advancedinstaller dot com, so I can test it and investigate the issue?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Launching .bat file on uninstall is opening file explorer

Mon Jul 09, 2018 10:19 am

Hello,

I looked over the project that you sent me and I noticed that your BAT file is added as a temporary file. In this case, the file is extracted from the package after the "Paths Resolution -> CostFinalize" standard action.

Also, when the package is uninstalled from the "Programs and Features" menu, it is uninstalled with Basic UI and only the actions from the "Install Execution Stage" section are executed.

Since your custom action is placed above the "Searches" action group, the file extraction was not done yet and the "System32" folder is open instead.

So, in order to avoid this, you need to place the custom action after the "Paths Resolution" action group.

Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”