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
- :
- OnInstalledFile()
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 02, 2010
07:16 AM
OnInstalledFile - need example help
INSTALLSCRIPT PROJECT
So I want to manipulate a file once it is installed; updates, etc don't need the manipulation so it seems OnInstalledFile event handler is the way to go. I must be having a bad day because I can't figure out how to code this. I added the event handle to my rul file.
the szFile parameter - the file I want to manipulate is:\company\product\abc.config
So do I put FOLDER_COMMON_APP\\company\\product\\abc.config in place of szFile? since we install to both 32 and 64 bit systems we rely a lot on the predefined variables for install locations.
So I want to manipulate a file once it is installed; updates, etc don't need the manipulation so it seems OnInstalledFile event handler is the way to go. I must be having a bad day because I can't figure out how to code this. I added the event handle to my rul file.
the szFile parameter - the file I want to manipulate is:
So do I put FOLDER_COMMON_APP\\company\\product\\abc.config in place of szFile? since we install to both 32 and 64 bit systems we rely a lot on the predefined variables for install locations.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 02, 2010
08:14 AM
szFile = FOLDER_COMMON_APP ^"company\\product\\abc.config"
should set the correct value
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 02, 2010
09:40 AM
I understand that I can set a string to the path/file name, but where do I set the string, and then what?
Since its an event, I don't actually "call" OnInstallFile.
This is added to my rul:
OnInstallFile(myfilename)
begin
end;
I want to do different things for 4 different files. Do I add 4 OnInstallFile events? How do I differentiate each one? How do each get 'called'?
Thanks. Sorry to be dense on this topic.....
Since its an event, I don't actually "call" OnInstallFile.
This is added to my rul:
OnInstallFile(myfilename)
begin
end;
I want to do different things for 4 different files. Do I add 4 OnInstallFile events? How do I differentiate each one? How do each get 'called'?
Thanks. Sorry to be dense on this topic.....
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 02, 2010
09:58 AM
You have to use the feature events.
After you have added your files to a feature you can select the feature in the right frame of your InstallScript (yello mark), Select your feature, then select in the box right the "Installed" property. IS generates a Function which is called when the feature was installed.
After you have added your files to a feature you can select the feature in the right frame of your InstallScript (yello mark), Select your feature, then select in the box right the "Installed" property. IS generates a Function which is called when the feature was installed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 02, 2010
10:11 AM
understand and have used feature_installed events before.
so you are saying I need to start with a feature_installed event for the feature that contains the component that contains the specific file I want to trigger the action.
I set szFile inside the feature_installed()? then 'call'
OnInstalledFile(myfileString)? Where do I put the code for what I want to happen after that file is installed? inside OnInstalledFile() do I have a switch statement for each file I want activity to be triggered off of?
so you are saying I need to start with a feature_installed event for the feature that contains the component that contains the specific file I want to trigger the action.
I set szFile inside the feature_installed()? then 'call'
OnInstalledFile(myfileString)? Where do I put the code for what I want to happen after that file is installed? inside OnInstalledFile() do I have a switch statement for each file I want activity to be triggered off of?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 03, 2010
02:30 AM
just put all files you want to overwrite and change in one feature, after the files are installed the Component_Installed() function is called automatically and you can change all files.
You can also make a feature for every file you want to change and edit them in FilleX_Installed() but I don't recommend that.
You can also make a feature for every file you want to change and edit them in FilleX_Installed() but I don't recommend that.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 09, 2010
11:51 AM
I looking to understand how to use OnInstalledFile(), not Component_installed().
The "overwrite" parameter on the components that contain the files will dictate if any of the files I will need to edit are installed. Only if the file is installed do I need to edit it. Not if the component is installed, if that file in the component is installed. Let's say a component has 12 files and the update parameter is set to "newer version". For my next release 3 of the 12 files have been updated and now have newer versions. When I run the installer, only those 3 files will be put on the client system because the other 9 do not have a newer version. I only need to edit 1 of the 3 to insert specific information from the registry into the file. Therefore I want to use OnFileInstalled() for the one file I need to edit. There is another file that I edited at installation time, but since it does not have a newer version it will not be installed and therefore I do not need to re-edit it.
Thanks.
The "overwrite" parameter on the components that contain the files will dictate if any of the files I will need to edit are installed. Only if the file is installed do I need to edit it. Not if the component is installed, if that file in the component is installed. Let's say a component has 12 files and the update parameter is set to "newer version". For my next release 3 of the 12 files have been updated and now have newer versions. When I run the installer, only those 3 files will be put on the client system because the other 9 do not have a newer version. I only need to edit 1 of the 3 to insert specific information from the registry into the file. Therefore I want to use OnFileInstalled() for the one file I need to edit. There is another file that I edited at installation time, but since it does not have a newer version it will not be installed and therefore I do not need to re-edit it.
Thanks.
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)