I'm extracting files from a winrar/zip archive to the $TARGETDIR$ directory in the MSIcode.
I would like to have these extracted files uninstalled when the user uninstalls the program from control panel.
Is this possible?
Examples of extracting files from zip file:
Run Program $SUPPORTDIR$\UnRAR.exe e -ppassword -o+ -y "$EXEDIR$\myarchive.rar" "$TARGETDIR$" (WAIT, get result into variable SUCCESS)
Or using:
Extract 7Zip Archive $EXEDIR$\myarchive.rar into folder $TARGETDIR$ (get result into variable SUCCESS)
I found a message board post from 2010 that said it wasn't possible hopefully its possible with the latest version of InstallAware as we absolutely need to have these files deleted on uninstallation of product.
viewtopic.php?f=2&t=7863
Thanks,
I need to be able to uninstall files extracted from zip file
-
- Posts: 2
- Joined: Fri May 16, 2014 1:04 pm
-
- Posts: 2
- Joined: Fri May 16, 2014 1:04 pm
Re: I need to be able to uninstall files extracted from zip
Okay, I have a solution but its just a work around for the problem. I create a empty text file when I first install product and populate it with the filenames of the files I'm unzipping to target directory.
I then read this file when the product uninstalls and delete each file listed in the textfile. This works but there really should be a better way.
The InstallAware installer should take care of uninstalling these files.
I then read this file when the product uninstalls and delete each file listed in the textfile. This works but there really should be a better way.
The InstallAware installer should take care of uninstalling these files.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: I need to be able to uninstall files extracted from zip
Dear Ryan,
in reality the post you mention already has the answer to your question.
You need to run the files deletion upon un-install.
This because the extracted files are not part of the Windows Installer database sequence and consequently, they will not be removed at un-install by the MSI engine ... it is not an IA limitation.
Anyway, you can easily delete them using the "Delete Files" command at the end of the un-install sequence in your main script.
Note, the "Delete Files" command is a Windows Installer command (purple command) and normally deferred to Apply Install /Un-install execution.
Due of this, you need to call the command within a Native Engine ON/OFF sequence to execute it immediately.
Example;
Set Variable NATIVE_ENGINE to TRUE
Delete Files ....
Set Variable NATIVE_ENGINE to FALSE
Regards
in reality the post you mention already has the answer to your question.
You need to run the files deletion upon un-install.
This because the extracted files are not part of the Windows Installer database sequence and consequently, they will not be removed at un-install by the MSI engine ... it is not an IA limitation.
Anyway, you can easily delete them using the "Delete Files" command at the end of the un-install sequence in your main script.
Note, the "Delete Files" command is a Windows Installer command (purple command) and normally deferred to Apply Install /Un-install execution.
Due of this, you need to call the command within a Native Engine ON/OFF sequence to execute it immediately.
Example;
Set Variable NATIVE_ENGINE to TRUE
Delete Files ....
Set Variable NATIVE_ENGINE to FALSE
Regards
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
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
Who is online
Users browsing this forum: No registered users and 126 guests