Archive: Uninstall and Add/Remove Programs


Uninstall and Add/Remove Programs
My uninstaller is quite simple and works great if it is called directly. But if I access it via Add/Remove Programs, it still works but it freezes the Add/Remove Programs window. I am using ExecWait in the un.onUninstSuccess function to fire up Internet Explorer with a specific URL after the uninstaller completes. If I remove that portion, all works fine. And again, it works fine if called directly, even with the ExecWait call. But that bloody Add/Remove Programs window freezes up on me if I launch IE at the end.

UPDATE:
Here is the basic uninstall instruction:

Section "Uninstall"
call "un.CloseIE" ; Kill all running IE's
UNRegDLL "$INSTDIR\my.dll"
DeleteRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg"
DeleteRegKey HKLM SOFTWARE\MyProg"
SectionEnd

Function "un.onUninstSuccess"
ExecWait "$PROGRAMFILES\Internet Eplorer\iexplore.exe http://www.me.com"
FunctionEnd


Uninstall occurring on WinXP and built using NSIS v1.9

Any suggestions?
Thanks,
-tom


If you are using ExecWait the installer will wait until you close the Internet Explorer window and so will the add/remove control panel as it's waiting for the installer. You should use ExecWait "open" "http://www.me.com". This command will not make the installer freeze and will call the user's default browser which will be a bit nicer then forcing him to use IE. If you want to force IE use Exec instead of ExecWait, it should work too.


I couldn't get ExecWait "open" to work and simply using Exec was causing the same problem. But I did find a solution based on your answer:

ExecShell open "http://www.me.com"

It indeed opens the user's default browser but that is a better way to go.

Thank you very much!

-tom


Heh, meant ExecShell :)


I ran into the same issue. I just created a sample script to verify the solution posted on this thread, but it doesn't allow me to do anything until I close the internet browser (this was on XP).

On Vista, I click on another application under Add/Remove window then select to uninstall. A message "Please wait until the current program is finished..." is displayed.

===

Function un.onUninstSuccess
HideWindow
ExecShell open "http://www.yahoo.com"
FunctionEnd


as usual, blame MS for this, they are using a job object to wait for all child processes started by the main uninstaller

To work around it, try http://nsis.sourceforge.net/Escape_A...th_New_Process but I think the name of the job object has changed, so you might have to use Process Explorer to find the name and adapt the code


Hi Anders,

I have no idea "the name of the job object" that you mention. What should I look for using Process Explorer? Thank for your help!


The lower pane, it should be listed as a handle (there is also a job tab in the properties for the process, not sure if the name is listed there)


Don't see it with Process Explorer.
The name of the job object should be "ARP Job", I see that in the function. Another forum also says that:

http://community.flexerasoftware.com...d.php?t=181670

Anyone has any idea why it's not working?


Well, either the job name is wrong, or the security for the object is locked down (To find the job object, you look for the handle in the lower pane for the add/remove process, not "your" process)

The other option is to use a out of process COM object, that way you don't have to deal with job objects at all (But you would have to register this COM object etc)