Page 1 of 1

Rename File not working

Posted: Mon Jun 04, 2012 4:40 am
by Ton_B
I've got some files wich needs to be renamed during or after installation.
I've looked for a solution, but nothing seems to work.

Trying to copy, remove and delete files do not work.
So this topic: is not the solution http://www.installaware.com/forum/viewt ... f=2&t=6656

Any tips on how to rename files ?

Thanx

(i'm using IA 8)

Re: Rename File not working

Posted: Mon Jun 04, 2012 8:08 am
by FrancescoT
Dear Bob,

using "Copy /Move Local Files" should work. Of course it have to be done after Apply Install, if those files are part of your installation.

Can you share the code you are using?

Regards

Re: Rename File not working

Posted: Wed Jun 06, 2012 7:38 am
by Ton_B
I came up with another solution.

The thing is, that my setup supports multi-language.
Therefore I had som files inside one directory like this:

MyInifile_en-GB.ini
MyInifile_en-US.ini
Myinifile_nl-NL.ini
Myinifile_fr-BE.ini
Myinifile_fr-FR.ini

now i've made a culture directory, contining the "renamed" files like so:

Root\Culture\en-GB\MyInifile.ini
Root\Culture\en-US\MyInifile.ini
Root\Culture\nl-NL\MyInifile.ini
Root\Culture\fr-FR\MyInifile.ini
Root\Culture\fr-FR\MyInifile.ini

Now, i check wich culture is chosen, ant then installs the file inside the correct culture directory.
Unfortuanally it is not possible to use variables insite the INSTALL FILE function, so i've made for each culture a install file command.

Code: Select all

if $CULTURE$ = en-GB
   install file Root\Culture\en-GB\MyInifile.ini
end 

if $CULTURE$ = en-US
   install file Root\Culture\en-US\MyInifile.ini
end 

if $CULTURE$ = nl-NL
   install file Root\Culture\nl-NL\MyInifile.ini
end
.. and so on ..
Isn't there a more clever way to do this ?

Re: Rename File not working

Posted: Wed Jun 06, 2012 10:01 am
by FrancescoT
Dear Ton,

Probably you could try this instead of using Install Files;

- Use "File Bag" to store temporarily your ini files.
- Use "Copy / Move Local Files" that allows the use of variables (use the returned value from File Bag).

The "Copy / Move Local Files" command must be used with NATIVE ENGINE on.
It should not be used for installing new files onto the system when the Windows Installer engine is active; however the command is more flexible with the Native Engine and may be used extensively (it will be especially useful in creating "live CD" type distributions).
With the above suggestion your INI file which was actually copied to your target folder, will be not removed with uninstall.
This because "Copy / Move Local Files" is executed using NATIVE ENGINE and consequently it is placed out of MSI database.
So during uninstall if you want to remove it, you must force its deletion.

Hope this helps you.

Regards