[RESOLVED] HowTo: Uninstall --> Reboot --> Resume Uninstall - Advanced Installer Community
ruturaaj
Posts: 7
Joined: Tue Mar 06, 2018 4:13 am

[RESOLVED] HowTo: Uninstall --> Reboot --> Resume Uninstall

Hi,

I am building an installation setup for my application. Application contains Shell Context Menu. Application is uninstalled well but shell dlls remain locked by explorer.exe process and hence not deleted. It requires either restart explorer process or reboot. I preferred reboot simply because I am not comfortable with killing a process and start.

So, the uninstaller work flow includes Uninstall, Reboot and then resume final clean-up. I am not able to achieve this in Advanced Installer. Can you please guide me through the steps to achieve this? I searched forum but failed to find the right solution.

Cheers,

Ruturaaj.
Last edited by ruturaaj on Wed Mar 14, 2018 9:43 am, edited 1 time in total.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

Hello Ruturaaj,

To achieve what you want you can set the REBOOT property during your uninstall process.

Please note that the system reboot will be done only after the uninstall process finishes. So, if you still need to run a cleanup script after the system reboot, then on your setup uninstall you ca create a RunOnce Registry Keys entry which will launch your cleanup script after system reboot.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ruturaaj
Posts: 7
Joined: Tue Mar 06, 2018 4:13 am

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

Hi,

Thanks for your reply. So by "clean up script", you mean some sort of BAT file that will delete the files? Can't we retain the Uninstaller's EXE until the Reboot is completed and then perform certain tasks? I have no issues with writing a self deleting Batch file, but then can you please tell me how can I make the Uninstaller to write this file at the tile of Uninstall process itself? I don't want to install this file in application's installation folder as a part of application package.

Once again, thanks so much for your continued help...

Cheers,

Ruturaaj.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

Hello Ruturaaj,

I'm afraid there is no way to REBOOT the system during the uninstall process and then the uninstall process to continue form where it has left initially.

When Windows Installer detects file in use during install/uninstall process it offers you two options: either the Windows Installer service will try to
close the processes holding files in use or it will prompt for a restart after the uninstall process finishes. Also, after the install/uninstall process the Windows Installer should automatically update/cleanup the file held in use at install/uninstall time. So, you should just test the uninstall process and check the behavior of standard Windows Installer approach and see if this fit with your requirements.

If not, to answer to your last query, you should use a "Launch attached file" custom action type to launch your script. This way the script file won't be deployed alongside your installation files. It will be embedded in the setup and extracted at install time in a temp location.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ruturaaj
Posts: 7
Joined: Tue Mar 06, 2018 4:13 am

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

either the Windows Installer service will try to
close the processes holding files in use or it will prompt for a restart after the uninstall process finishes
You were absolutely right Daniel! This works good; but the problem is... the process that's holding the Shell Extension DLL is Explorer.exe process. Uninstaller kills the process well but it fails to start it again. It works good if the second option is selected by User (Do not kill process, requires restart).

Can I simply make the Uninstaller to skip the options interface, select the second option by default and move on by prompting the User that Restart is required to complete the process?
ruturaaj
Posts: 7
Joined: Tue Mar 06, 2018 4:13 am

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

Any suggestions to achieve what I mentioned in my last post?
Can I simply make the Uninstaller to skip the options interface, select the second option by default and move on by prompting the User that Restart is required to complete the process?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: HowTo: Uninstall --> Reboot --> Resume Uninstall

Hello,

I'm afraid this is not possible.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”