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
- :
- Re: Copying a file at runtime from the directory where the .msi is located
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
‎Feb 06, 2008
01:19 PM
Copying a file at runtime from the directory where the .msi is located
I'm working on an install where I need to be able to deliver a unique credentials file for each customer running my install.
My options are:
1) to try to stuff the file into the .msi (replacing a placeholder in it) prior to distributing to each individual customer.
2) supply a file that can be downloaded by the customer along side their .msi file and have this file be copied to the correct location when the .msi is run.
I've opted for option 2 because it seems like it will be much easier to implement and less error prone.
I have added an entry into the MoveFiles table via the direct editor. If I place the source file into a location like C:\Foo and set a property that contains that value, I can supply the property name in the MoveFiles entry and everything works as expected.
What I would ultimately like to do is to use a property that resolves to the location from which the .msi file is being run. For instance, if the .msi is copied to a system's desktop, the property should resolve to that location. If its being run C:\Temp, then the property should resolve to C:\Temp, etc... I cannot figure out if a property exists that will do this for me. I tried using SourceDir but I got an error from Windows Installer.
Does anyone have any insight into how I can do this?
Will this work if the .msi (and credential file) are located on a network share? That is to ask whether or not the value returned will be a unc path that can be used in the MoveFiles table/action.
Thanks,
-Al
My options are:
1) to try to stuff the file into the .msi (replacing a placeholder in it) prior to distributing to each individual customer.
2) supply a file that can be downloaded by the customer along side their .msi file and have this file be copied to the correct location when the .msi is run.
I've opted for option 2 because it seems like it will be much easier to implement and less error prone.
I have added an entry into the MoveFiles table via the direct editor. If I place the source file into a location like C:\Foo and set a property that contains that value, I can supply the property name in the MoveFiles entry and everything works as expected.
What I would ultimately like to do is to use a property that resolves to the location from which the .msi file is being run. For instance, if the .msi is copied to a system's desktop, the property should resolve to that location. If its being run C:\Temp, then the property should resolve to C:\Temp, etc... I cannot figure out if a property exists that will do this for me. I tried using SourceDir but I got an error from Windows Installer.
Does anyone have any insight into how I can do this?
Will this work if the .msi (and credential file) are located on a network share? That is to ask whether or not the value returned will be a unc path that can be used in the MoveFiles table/action.
Thanks,
-Al
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
02:38 PM
I have a similar requirement I use in different situations. Only way I was able to do this is via InstallScript custom action using the SETUPEXEDIR property to seed the path to the custom action and doing a CopyFile function.
The downside is that Windows installer won't know about the file and therefore won't uninstall or repair it and I had to create another custom action to deal with it.
The downside is that Windows installer won't know about the file and therefore won't uninstall or repair it and I had to create another custom action to deal with it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
03:22 PM
I read about SourceDir in the help, but when I try to use it, its not working properly... I get an error:
"Error 2706. Source paths not created. No path exists for entry SOURCEDIR in Directory table."
The ResolveSource action is in my Execute Sequence long before the MoveFiles Action.
"Error 2706. Source paths not created. No path exists for entry SOURCEDIR in Directory table."
The ResolveSource action is in my Execute Sequence long before the MoveFiles Action.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
03:38 PM
Make sure it's set for Immediate Execution rather than deferred. In 'Deferred' properties don't seem to work well.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 06, 2008
03:47 PM
The solution was so simple...
using SOURCEDIR instead of SourceDir in the entry in the MoveFiles table works great.
I have to say... the Help for Windows Installer stinks.
using SOURCEDIR instead of SourceDir in the entry in the MoveFiles table works great.
I have to say... the Help for Windows Installer stinks.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)