Simple rename

Got a problem you cannot solve? Try here.
SharkTooth
Posts: 1
Joined: Thu Jul 14, 2005 12:45 pm

Simple rename

Postby SharkTooth » Thu Jul 14, 2005 12:55 pm

Hello,

I'm currently a wise user and am interested in switching products. I have rebuilt one of my wise scripts in InstallAware and am stuck on a silly procedure - renaming a file :) . In WISE, you can rename the destination file in the install files action, but in InstallAware, I've learned that you have to use the copy/move action. Here's my code:

Install Files D:\\binaries\\MyProduct\\#VERSION#\\#BUILD_NUM#\\#REVISION#\\register#REVISION#.ini to $TARGETDIR$
Move Local Files $TARGETDIR$\\register#REVISION#.ini to $TARGETDIR$\\register.ini

The install file works fine, but the move action unfortunately does nothing. If you have any suggestions, that'd be great? Thanks.

sinan
Site Admin
Posts: 1020
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Thu Jul 14, 2005 6:39 pm

That's a good question which highlights the main difference between Wise and InstallAware. Due to limitations in Windows Installer, no script command that is displayed in purple (purple is the color used for highlighting Windows Installer commands) actually executes until the Apply Install command is called. You can think of this as the purple commands being "cached" until Apply Install is actually called. Therefore your Move File command fails because it is not called after Apply Install.

While you could call Move File after Apply Install, you would then also need to call Apply Install a second time so the call to Move File would take effect. A simpler solution would be to just call the MoveFile Windows API function in kernel32.dll using the Call DLL Function plug-in, immediately after Apply Install. This would rename your file right after its actually been copied.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 52 guests