This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Rename file while installing
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 23, 2009
11:11 AM
Rename file while installing
Hi,
I'm hoping to build an installer that can take a generically named file, reference it from a .ism file to produce a .msi, but have the .msi call the file something different when it's installed to the end-user's PC. In other words, I would like the file to be renamed as part of the compilation or installation process.
For example, if I have have a file called application.exe on the machine where the installer is being compiled, I want to make an installer that places the same file on the end-user's PC, but have it called application_v3.exe. It doesn't matter to me if the file is stored internally in the .msi as application.exe or application_v3.exe.
To compound things, I would like the version to come from a property, if possible.
I realize there are other options, such as placing the file in a folder that contains the version number, and/or using the version property of application.exe, but for various business reasons, I need to include the version in the name of the file itself.
Thanks!
I'm hoping to build an installer that can take a generically named file, reference it from a .ism file to produce a .msi, but have the .msi call the file something different when it's installed to the end-user's PC. In other words, I would like the file to be renamed as part of the compilation or installation process.
For example, if I have have a file called application.exe on the machine where the installer is being compiled, I want to make an installer that places the same file on the end-user's PC, but have it called application_v3.exe. It doesn't matter to me if the file is stored internally in the .msi as application.exe or application_v3.exe.
To compound things, I would like the version to come from a property, if possible.
I realize there are other options, such as placing the file in a folder that contains the version number, and/or using the version property of application.exe, but for various business reasons, I need to include the version in the name of the file itself.
Thanks!
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 23, 2009
09:01 PM
For two sort-of built-in options, you might look at using the DuplicateFile table (to make a copy of a file you just installed with a component) or the MoveFile table (to copy a file that already exists somewhere---perhaps a support file?). You can access both tables in the Direct Editor view, and the MSI help describes what to enter...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 29, 2009
11:08 AM
Thanks.
Do you know if either the DuplicateFile or MoveFile support using [] or {} in the filenames themselves?
The renaming part isn't difficult--just use the direct editor on the Files table--but I cannot derive part of the name from a property using this method, and was really hoping to do that.
JD.
Do you know if either the DuplicateFile or MoveFile support using [] or {} in the filenames themselves?
The renaming part isn't difficult--just use the direct editor on the Files table--but I cannot derive part of the name from a property using this method, and was really hoping to do that.
JD.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 30, 2009
05:13 PM
Alas, no, it appears DuplicateFile and MoveFile don't support [PropName] expressions in the target file name. In general, you can look at the MSI topic for a table; a field using the "Formatted" data type supports expanding [Prop] values.
So it seems some sort of custom action will be required to go down this road. (As you know, any technique involving a renamed file will probably affect future patching, will need to address uninstallations and repairs, and so on, so those are things to consider...)
So it seems some sort of custom action will be required to go down this road. (As you know, any technique involving a renamed file will probably affect future patching, will need to address uninstallations and repairs, and so on, so those are things to consider...)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 30, 2009
05:20 PM
Thanks again Robert.
For now, I'll just leave it the way it is and when I want to change the value of the file name, update it in multiple places. It's not ideal, but it works. Much less of a headache than going the CA route.
Perhaps a future release suggestion - Scan the files table as part of the [] and/or {} interpolation process, extending this preprocessing step to as many tables as possible.
For now, I'll just leave it the way it is and when I want to change the value of the file name, update it in multiple places. It's not ideal, but it works. Much less of a headache than going the CA route.
Perhaps a future release suggestion - Scan the files table as part of the [] and/or {} interpolation process, extending this preprocessing step to as many tables as possible.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 30, 2009
05:49 PM
I'm sure this is what you're describing, but you can use MSI Automation if your .ism project is in binary format, or text/XML processing if your .ism project is in XML format, so at least you can set up a process to avoid manually changing the table values before a build.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)