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: "Custom Actions" to include my script
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
‎Jan 28, 2013
02:46 PM
"Custom Actions" to include my script
Created a VBscript :
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\Windows\System32\drivers\etc\services", ForAppending, True)
filetxt.WriteLine("sapmsERP 3601/tcp")
filetxt.WriteLine("sapmsEP0 3601/tcp")
filetxt.WriteLine("sapmsAP0 3602/tcp")
filetxt.WriteLine("sapmsGPW 3630/tcp")
filetxt.WriteLine("sapmsAT1 3603/tcp")
filetxt.WriteLine("sapmsGPA 3600/tcp")
filetxt.WriteLine("sapmsERT 3600/tcp")
filetxt.Close
I seem to be missing a step, I am unable to configure my package to write the entries to C:\Windows\System32\drivers\etc
Thank You
Kennyp
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\Windows\System32\drivers\etc\services", ForAppending, True)
filetxt.WriteLine("sapmsERP 3601/tcp")
filetxt.WriteLine("sapmsEP0 3601/tcp")
filetxt.WriteLine("sapmsAP0 3602/tcp")
filetxt.WriteLine("sapmsGPW 3630/tcp")
filetxt.WriteLine("sapmsAT1 3603/tcp")
filetxt.WriteLine("sapmsGPA 3600/tcp")
filetxt.WriteLine("sapmsERT 3600/tcp")
filetxt.Close
I seem to be missing a step, I am unable to configure my package to write the entries to C:\Windows\System32\drivers\etc
Thank You
Kennyp
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 29, 2013
06:36 AM
Hi I have modified your code to so .
and its is working.
only thing is how you add to custom action.
what i have done is
in coustom action create an new custom action that is installed with the product and schedule to run in excute sequence after install finalize. and its working
///////////////////////////////////////////////////////////////////////////////////////////////////
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\Windows\System32\text.txt", ForAppending, True)
filetxt.WriteLine("sapmsERP 3601/tcp")
filetxt.WriteLine("sapmsEP0 3601/tcp")
filetxt.WriteLine("sapmsAP0 3602/tcp")
filetxt.WriteLine("sapmsGPW 3630/tcp")
filetxt.WriteLine("sapmsAT1 3603/tcp")
filetxt.WriteLine("sapmsGPA 3600/tcp")
filetxt.WriteLine("sapmsERT 3600/tcp")
filetxt.Close
///////////////////////////////////////////////////////////////////////////////////////////////////
and its is working.
only thing is how you add to custom action.
what i have done is
in coustom action create an new custom action that is installed with the product and schedule to run in excute sequence after install finalize. and its working
///////////////////////////////////////////////////////////////////////////////////////////////////
dim filesys, filetxt
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile("C:\Windows\System32\text.txt", ForAppending, True)
filetxt.WriteLine("sapmsERP 3601/tcp")
filetxt.WriteLine("sapmsEP0 3601/tcp")
filetxt.WriteLine("sapmsAP0 3602/tcp")
filetxt.WriteLine("sapmsGPW 3630/tcp")
filetxt.WriteLine("sapmsAT1 3603/tcp")
filetxt.WriteLine("sapmsGPA 3600/tcp")
filetxt.WriteLine("sapmsERT 3600/tcp")
filetxt.Close
///////////////////////////////////////////////////////////////////////////////////////////////////
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 29, 2013
06:39 AM
And one more thing is services is not an text file it is an type of file so you were not able to write it.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)