Page 1 of 1

How can I rename a folder?

Posted: Thu Aug 29, 2013 4:38 am
by JohnO
I want to preserve a folder during uninstallation. There doesn't appear to be a 'rename' command, but in a Unix-like way, it looks as though the 'Move Local Files' would have the same effect:

Code: Select all

  Move Local Files $MYPROFILES$\Romonet\$TITLE$\resources\*.* to $MYPROFILES$\Romonet\$TITLE$\resources_old\ (include subfolders)

This didn't work - the folder was deleted! So I tried using the debugger to see what was happening.
In order to get the uninstall code to run, I had to set 'REMOVE' to TRUE. NATIVE_ENGINE is also TRUE.
What I saw happening was:
The 'resources' folder was copied to 'resources_old' when the statement was executed. However, when the " Apply Uninstall" statement was run, both folders disappeared.

Is this a bug (IA 16) - I think only the 'resources' folder should have been deleted? If not, how should I do a rename of a folder?

Regards, John

Re: How can I rename a folder?

Posted: Fri Aug 30, 2013 2:39 am
by FrancescoT
Dear John,

did you put back to FALSE the Native Engine after the Copy command execution or before the Apply Install statement?

Example:

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Move Local Files $MYPROFILES$\Romonet\$TITLE$\resources\*.* to $MYPROFILES$\Romonet\$TITLE$\resources_old\ (include subfolders)
Set Variable NATIVE_ENGINE to FALSE


Regards

Re: How can I rename a folder?

Posted: Fri Aug 30, 2013 5:16 am
by JohnO
Dear Francesco
No. I have obviously not understood how to use NATIVE_ENGINE. I thought, you set it to true early on, and left it on in order to get the benefits of using it.
It looks to me as though NATIVE_ENGINE is something you toggle on when you need it, and off when you don't.

In my case, I think it is toggled on so that the 'move' gets done when the statement is 'met', then toggled off, so that the other statements are done at the Apply time.

I will experiment with that.


Regards, John

Re: How can I rename a folder?

Posted: Fri Aug 30, 2013 9:29 am
by bokkie
You can set it on or off at anytime. It gives you the advantage of immediate execution. Use it sparingly and then only for the specific reason you need it. If you do too much with it enabled then anything you do with it can't be "uninstalled" later, meaning you'd have to know what to do manually yourself. The native engine is a really powerful facility but you need to be careful that you don't too much with it. :)

Re: How can I rename a folder?

Posted: Mon Sep 02, 2013 4:59 am
by JohnO
Thanks bokkie

John