Uninstallation of local files

Got a problem you cannot solve? Try here.
johnbyerly
Posts: 44
Joined: Fri Apr 12, 2013 2:30 pm

Uninstallation of local files

Postby johnbyerly » Tue Aug 26, 2014 8:39 pm

I am copying some local files during installation. I understand from the documentation that, in order to have the files uninstalled automatically, I need to use the native engine. So, I tried this:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Does Folder Exist $EXEDIR$\AuxFiles (get result into variable AUXFILES)
if Variable AUXFILES Equals TRUE
  Does File Exist $EXEDIR$\AuxFiles\logo.png (get result into variable LOGOFILE)
  if Variable LOGOFILE Equals TRUE
    Copy Local Files $EXEDIR$\AuxFiles\logo.png to $TARGETDIR$  end
end
Set Variable NATIVE_ENGINE to FALSE
Apply Install (get result into variable SUCCESS)


Unfortunately, logo.png is not removed during uninstall. What am I doing wrong?

Thanks!

JAB

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstallation of local files

Postby FrancescoT » Wed Aug 27, 2014 11:45 am

Dear Jab,

those files will not be removed during un-install because are not part of your install process database.

It is true that the IA documentation about the command reports; "the files copied/moved by the command will be uninstalled normally without requiring manual deletion under NATIVE ENGINE" ... but with your approach, you are still using the Windows Installer Engine.

Because I suppose that it is your intention to continue to use the Windows Installer Engine, you must delete those files at un-install time via script and I may suggest you the following approach.

At Install Time:

Code: Select all

Apply Install (get result into variable SUCCESS)

Set Variable NATIVE_ENGINE to TRUE
Does Folder Exist $EXEDIR$\AuxFiles (get result into variable AUXFILES)
if Variable AUXFILES Equals TRUE
  Does File Exist $EXEDIR$\AuxFiles\logo.png (get result into variable LOGOFILE)
  if Variable LOGOFILE Equals TRUE
    Copy Local Files $EXEDIR$\AuxFiles\logo.png to $TARGETDIR$  end
end
Set Variable NATIVE_ENGINE to FALSE


At Un-Install Time:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Delete Files $TARGETDIR$\logo.png
Set Variable NATIVE_ENGINE to FALSE

Apply Uninstall (get result into variable SUCCESS)


With the above approach, the NATIVE ENGINE is only enabled in order to permit the immediate execution of the Windows Installer Commands (Purple Commands); Copy Local Files and Delete Files.

Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

johnbyerly
Posts: 44
Joined: Fri Apr 12, 2013 2:30 pm

Re: Uninstallation of local files

Postby johnbyerly » Wed Aug 27, 2014 2:10 pm

Grazie mille!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Uninstallation of local files

Postby FrancescoT » Thu Aug 28, 2014 10:53 am

:D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 101 guests