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
- :
- Replacing text in files copied using XCopyFile
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 28, 2011
09:47 AM
Replacing text in files copied using XCopyFile
I'm creating an InstallScript MSI project that copies additional files to the target system from a custom external folder located on the installation media. I also need to perform text replacement in some of these files.
My issue is that I can't figure out where in the Execute sequence I need to copy the files so that I can take advantage of the built-in Text Replacement feature. I'm already using this feature to replace text in files that are copied to the target system based on Features/Components, so I'd just like it to update the 'custom' files as well.
I've tried using the 'Installed' event for the Feature, as well as the 'OnInstallFilesActionAfter' event, but I'm not having any luck. The sequence I need to achieve is:
1) Copy files from Features to target system (standard action/behavior)
2) Copy files from 'custom' folder to target system (custom - some of these may overwrite files copied from step 1)
3) Replace text in some of the installed files based on installer properties (standard action/behavior)
Where should I perform step 2 ?
Thanks!
-Mike
My issue is that I can't figure out where in the Execute sequence I need to copy the files so that I can take advantage of the built-in Text Replacement feature. I'm already using this feature to replace text in files that are copied to the target system based on Features/Components, so I'd just like it to update the 'custom' files as well.
I've tried using the 'Installed' event for the Feature, as well as the 'OnInstallFilesActionAfter' event, but I'm not having any luck. The sequence I need to achieve is:
1) Copy files from Features to target system (standard action/behavior)
2) Copy files from 'custom' folder to target system (custom - some of these may overwrite files copied from step 1)
3) Replace text in some of the installed files based on installer properties (standard action/behavior)
Where should I perform step 2 ?
Thanks!
-Mike
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 01, 2011
12:49 AM
Apparently, [Text Replacement] feature is invoked from custom action [ISSearchReplaceInstall] as deferred.
So, your custom action should be located before the custom action.
Or I'm not sure,but why don't you write the custom code in 'Installing' rather than 'Installed' feature event?
So, your custom action should be located before the custom action.
Or I'm not sure,but why don't you write the custom code in 'Installing' rather than 'Installed' feature event?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 01, 2011
06:33 AM
weakness wrote:
Apparently, [Text Replacement] feature is invoked from custom action [ISSearchReplaceInstall] as deferred.
So, your custom action should be located before the custom action.
Or I'm not sure,but why don't you write the custom code in 'Installing' rather than 'Installed' feature event?
Thanks for the reply.
I'll try another custom action, but my previous attempts have failed. I originally had code in the 'Installing' event handler, but that's called BEFORE the feature is installed, and I need to copy files AFTER the feature is installed. The 'Installed' event seemed to be occuring after the text replacement action had been executed, so none of my text was replaced.
I'll post if I have luck with a custom action...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2011
08:37 AM
Ok - Finally got it working. I added a custom action after WriteEnvironmentStrings, which is right before ISSearchReplaceInstall.
Had to figure out how to pass the two folder paths using CustomActionData, as the regular properties didn't work at that point (should they?).
Also needed an install condition so that it didn't get executed during uninstall.
I'd be curious to here comments from others as to whether this seems like the 'correct' way to implement this.
Thanks in advance!
Had to figure out how to pass the two folder paths using CustomActionData, as the regular properties didn't work at that point (should they?).
Also needed an install condition so that it didn't get executed during uninstall.
I'd be curious to here comments from others as to whether this seems like the 'correct' way to implement this.
Thanks in advance!
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)