cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Paul_Nicholas
Level 3

Install file with different target filename?

Hi all,

I must be missing something simple here. I have an installer project which has a file called, say "Config_Empty.xml". When it installs to a machine, I want the deployed/target filename to be just "Config.xml".

I cannot seem to find a way in InstallShield to do this. If anyone could point me in the right direction, I'd really appreciate it.

Thanks,

Paul.
Labels (1)
0 Kudos
(5) Replies
TsungH
Level 12

There are several ways to go about it.

1) During automated build, after checking out and/or moving it to appropriate location, rename the filename before building ISM project.
2) After adding the file to ISM project, you can try manually edit File table (under Direct Editor view). If my memory serves, I tried it once or twice before. But I don't remember if it worked as intended.
3) You may want to take a look at MoveFile Table and MoveFiles Action. I don't remember where exactly the action is scheduled relative to InstallFiles action, but Suggested InstallExecuteSequence says it should be before. If that's the case, this won't work.
0 Kudos
Paul_Nicholas
Level 3

Thanks TsungH for your suggestions, though it does sound that I'm fighting the system to get this happening (which just amazes me).

Regarding your suggestions:
1) I think this is the only method that will *work*, sadly this kinda defeats the point of me having three files in the same source folder which then get renamed via three different installer projects (if I've understood you correctly). As I'd have a clash each time I switch installer projects.
2) Will give this a go - but again sounds like I'm *bending* the system.
3) I think you're right, this won't work as it will try to rename the file before it's been deployed.

Thanks again for your suggestions - I think just avoid having to do this full-stop until the software gives us this functionality (which seems such an obvious one!) 🙂
0 Kudos
Kevmeister
Level 3

I just went looking for the same thing in InstallShield and I *cannot believe* this feature is not made available.

Especially when you can click on the file and modify its:

- Attributes
- Security Permissions
- etc

But you cannot change its target name.

I guess it could be a limitation of MSI itself?

The simple workaround is to put the different files into separate directories, but that just convolutes things for no great benefit.
0 Kudos
DebbieL
Level 17

In the Direct Editor view, click the File table and then find the file whose name you want to change. The ISBuildSourcePath field lists the current path and file name of the file. The FileName field would contain the name of the file that Windows Installer installs on the target system; you can change this to be different than the name that's listed in ISBuildSourcePath.

In other words, the file on your development system could be named Config_Empty.xml (part of the value of ISBuildSourcePath), but the file that gets installed on the target system would be named Config.xml (the value of FileName).
0 Kudos
Kevmeister
Level 3

Thanks for the heads-up (I've just had to revisit our installer, so I've returned to this thread).

But I still think this is something that should be able to be done from the Properties dialog of a file. I'm concerned that if someone else maintains my installation, they won't realise the "trickery" I've used to get the file to rename during installation.
0 Kudos