Hi,
I need to edit a file in an unespecified folder (I have to use the Search resource before), find some specific lines and delete them. Is there any prebuilt function in AI to do this? Is there a way to solve the problem?
This can be done only with a custom action. Create a file search in the "Search" page to find the file you want to modify.
With a VBS custom action you can modify that file indicated by the property of the search. To get the value of a property in a VBS custom action you can use this code:
Code: Select all
strFilePath = Session.Property("SEARCH_RESULT")
Where SEARCH_RESULT is the property of the search (in this property is stored the result of the search).
On how to create the custom action you can do like this:
1. Create a .vbs file with the VBS code in it.
2. Switch to "Custom Actions" page and add a "New Attached Custom Action" under "InstallExecuteSequence" standard action and browse for file just created.
3. Use (Not Installed) as execution condition for this custom action (will be executed only on install).
Hope this helps.
Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
FOLLOW US
Get the latest news in Application Packaging