Rename File not working

Got a problem you cannot solve? Try here.
Post Reply
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Rename File not working

Post 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)
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Rename File not working

Post 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
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
Ton_B
Posts: 115
Joined: Wed Nov 16, 2005 8:34 am
Location: Netherlands
Contact:

Re: Rename File not working

Post 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 ?
Ton Blokhuizen
Tooling Engineer
BMA BV - Netherlands
[i]BMA: leading the way in obstetrical data management
http://www.bma-mosos.nl[/i]
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Rename File not working

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