Page 1 of 1

Uninstall - where should Run Program line go?

Posted: Mon Jul 02, 2007 9:55 pm
by get101
When the user uninstalls the application, we need to run this line:
foxhhelp7.exe /UnRegServer

Should this line come before or after the Apply Uninstall line. In the code below I have it after the Apply Uninstall line. But I'm thinking that maybe the program no longer exists there, so perhaps it should come above Apply Uninstall

Can you please confirm which position is better?


Code: Select all

if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
   
  if Variable SUCCESS not Equals Cancel
    Unregister Library $TARGETDIR$\\ctText.ocx
 
    Set Variable INSTALLDIR to $TARGETDIR$
    Convert to Short Path: INSTALLDIR
    Run Program $INSTALLDIR$\\foxhhelp7.exe /UnRegServer
    Comment: End of Installation
     
  end
   
else

Posted: Tue Jul 03, 2007 2:27 am
by swarovski
I have similar uninstall flow as yours.
For me, i will have to run un-register before "Apply Uninstall".

provided that I am using my own regsvr32 to register my programs.
I did not use self-register (in the IA) coz it is still mysterious for me. sometimes it can register, sometimes not.

Posted: Tue Jul 03, 2007 2:28 am
by swarovski
one more thing,
if the self-register (in IA) works for your case,
you don't need to unregister by your own.

I believe the MSI will do the un-register prior file deletion.

Posted: Tue Jul 03, 2007 2:51 am
by get101
I am not using self-register.
To confirm, is this the correct sequence?

Code: Select all

if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here

   Unregister Library $TARGETDIR$\\ctText.ocx
 
    Set Variable INSTALLDIR to $TARGETDIR$
    Convert to Short Path: INSTALLDIR
    Run Program $INSTALLDIR$\\foxhhelp7.exe /UnRegServer


  Apply Uninstall (get result into variable SUCCESS)
  Set Variable PROGRESS to 100
 
else

Posted: Tue Jul 03, 2007 3:30 am
by MichaelNesmith
Yeah, that looks good.

If you call after Apply Uninstall, foxhhelp7.exe will no longer be there.