Protecting a file from being deleted in a previous version

Got a problem you cannot solve? Try here.
PerMalmstedt
Posts: 2
Joined: Tue Jan 29, 2013 5:36 am
Location: Sweden and Thailand

Protecting a file from being deleted in a previous version

Postby PerMalmstedt » Fri Dec 18, 2015 9:06 pm

Hi!

I have a tricky one that i'm running out of ideas on :oops:

The situation is that a revamped installation setup is marked to first uninstall the previous version. So far all is good. The setup informs in the prereq part that it needs to remove the existing version, before rebooting and continuing.
Now for the problem. That old version contains a license file in tve $TARGETDIR$ that should remain untouched by the uninstall/install process.
My lack of knowledge at the time of creating the old setup resulted inme NOT flagging this file as "leave and never uninstall" so that ship has passed :-)
I have tried to copy it, rename it etc. I the prereq section, but nothing happens, which i find a bit weird. Is it so that all such commands really happens at a later stage in the setup, and not when the script reaches that line?

Could you please give me an idea of how to solve this problem

Best regards
Per Malmstedt

Ps. Just upgraded to X3 from ver 17 :-) ds.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Protecting a file from being deleted in a previous versi

Postby bokkie » Sat Dec 19, 2015 6:48 am

is it so that all such commands really happens at a later stage in the setup, and not when the script reaches that line?


Per, for the most part that is true and in this forum you'll find a sticky thread about the so-called "purple" commands where a script's execution is sequenced, but deferred, until the Apply Install or Apply Uninstall commands are run towards the end of script and after the user-interview process (dialogs) have been run and closed. The quick "fix" to your problem will be (I suspect) to enable the native engine and then rename/copy/delete the files you're interested in and then you'll know the script statements are executed at the time they are encountered. You can then disable the native engine after and that will revert the script back to its normal behavior. You can read about the native engine in the online help and I think the section on pre-defined variables contains information about it.

I hope this helps you in your mission... :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

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

Re: Protecting a file from being deleted in a previous versi

Postby FrancescoT » Mon Dec 21, 2015 11:44 am

Dear Per Malmstedt,

in addition to the previous Peter's notes, which are all correct, you may also try to use the "Permanent File (don't remove upon uninstallation)" option available with the Install Files command.

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 166 guests