- Mark as New
- Subscribe
- Mute
- Permalink
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
