Page 1 of 1

Protecting a file from being deleted in a previous version

Posted: Fri Dec 18, 2015 9:06 pm
by PerMalmstedt
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.

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

Posted: Sat Dec 19, 2015 6:48 am
by bokkie
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... :)

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

Posted: Mon Dec 21, 2015 11:44 am
by FrancescoT
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