How to restart windows explorer? - Advanced Installer Community

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!

zbang.yaniv
Posts: 5
Joined: Mon Aug 06, 2012 3:35 pm

How to restart windows explorer?

My installer registers a COM dll to add overlay icon handlers.
It also requires restarting the windows explorer process.

Is there a way to do it within the installer, or do I need to use external tool / write my own exe to do it?

Thanks,
Yaniv
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to restart windows explorer?

Hello Yaniv and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can try this:
- Go to "Custom Actions" page and add a "Terminate process" custom action with sequence, scheduled after "Install Execution Stage" -> "Finish Execution" action group, like this:
  • Action Data: explorer.exe
- Add a "Launch EXE with working directory" custom action with sequence, scheduled after previous custom action, like this:
  • Working Dir: WindowsVolume
    Full Path: explorer.exe
- Both custom actions should have enabled "Synchronous execution, ignore return code" option from "Execution Properties" action group.
- Build and run your project.

Let us know if this helps, otherwise give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zbang.yaniv
Posts: 5
Joined: Mon Aug 06, 2012 3:35 pm

Re: How to restart windows explorer?

The Windows Explorer is restarted alright (both on install and uninstall),
but the installer gets stuck on 'Status: Removing backup files' (both install and uninstall)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: How to restart windows explorer?

Hi,

The custom action which starts explorer.exe should use the Asynchronous execution, do not wait for return option. This is because the process is never stopped and the installer would wait for it forever.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zbang.yaniv
Posts: 5
Joined: Mon Aug 06, 2012 3:35 pm

Re: How to restart windows explorer?

Correct, this works that way.

Any idea why restarting explorer causes the "My Documents" to show up?

Any way to 'save' the open explorer windows and 'restore' them after restart without having the "My Documents" to be opened?

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

Re: How to restart windows explorer?

Hello,

If you want to open explorer with a specified path (i.e. C:\MY_PATH), then you can use a "Launch EXE with working directory" custom action like this:
  • Working Dir: WindowsVolume
    Full Path: explorer.exe /root,C:\MY_PATH
Please take a look on "Command-Lines Switches for Windows Explorer" article.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zbang.yaniv
Posts: 5
Joined: Mon Aug 06, 2012 3:35 pm

Re: How to restart windows explorer?

Have any idea why it sometimes requires closing MS Word, Chrome, and the app itself (even though a 'Terminate Process' action already ran for that process)?

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

Re: How to restart windows explorer?

Hello,

I'm not sure why you are encountering this behavior. Can you please schedule your "Terminate process" custom action before "Install Execution Stage" -> "Preparing" -> "InstallValidate" standard action and see if the behavior still persist? Also, can you please tell us if you have enabled our "Enhanced User Interface" feature?

Let us know if this helps, otherwise give us more details about your scenario (maybe exemplify)?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
zbang.yaniv
Posts: 5
Joined: Mon Aug 06, 2012 3:35 pm

Re: How to restart windows explorer?

"Enhanced User Interface" is enabled for "only on install"

When I moved the explorer termination before "Install Execution Stage" -> "Preparing" -> "InstallValidate" it did not ask to close the other processes.

BUT now :

1. the shell doesn't change (it adds overlay icon handlers)
2. The app process isn't closed

Attached the AIP.

Thanks
Attachments
MultiMiCloudSetup.aip
(51.69 KiB) Downloaded 703 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to restart windows explorer?

Hello,

This may happen because you have started the explorer before the related dll files installation. So, can you please schedule your "LaunchExplorer" custom action after "Install Execution Stage" -> "Add Resources" action group and see if the behavior still persist?

Also, another solution would be to restart the explorer twice: first before "Install Execution Stage" -> "Preparing" -> "InstallValidate", and second after "Install Execution Stage" -> "Add Resources".

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

Return to “Common Problems”