How can I rename a folder?

Got a problem you cannot solve? Try here.
JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

How can I rename a folder?

Postby JohnO » Thu Aug 29, 2013 4:38 am

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

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

Re: How can I rename a folder?

Postby FrancescoT » Fri Aug 30, 2013 2:39 am

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
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

JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

Re: How can I rename a folder?

Postby JohnO » Fri Aug 30, 2013 5:16 am

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

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

Re: How can I rename a folder?

Postby bokkie » Fri Aug 30, 2013 9:29 am

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. :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

JohnO
Posts: 127
Joined: Tue Jun 18, 2013 9:52 am

Re: How can I rename a folder?

Postby JohnO » Mon Sep 02, 2013 4:59 am

Thanks bokkie

John


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 74 guests