OK, RedX, you were faster than me, but I'll put my answer, anyway
Big_Berny, first you need to put a section like this in your install.ini:
Code: Select all
[Execute]
File=Install.vbs
Function=Install()
Then, you need to create an Install.vbs like this:
Code: Select all
Sub Install()
'You can use this to create the entry in Scripts.ini
Dim inipath : inipath = SDB.ApplicationPath&"Scripts\Scripts.ini"
Dim ini : Set ini = SDB.Tools.IniFileByPath(inipath)
If Not (ini Is Nothing) Then
ini.StringValue("YourScriptSection","Filename") = "YourScript.vbs"
ini.StringValue("YourScriptSection","Procname") = "YourScript"
ini.StringValue("YourScriptSection","Order") = "30"
ini.StringValue("YourScriptSection","DisplayName") = "Your script menu item..."
ini.StringValue("YourScriptSection","Description") = "Your script description"
ini.StringValue("YourScriptSection","Language") = "VBScript"
ini.StringValue("YourScriptSection","ScriptType") = "0"
End If
SDB.RefreshScriptItems
'And this can be used to store default settings for your script during install
Set ini = SDB.IniFile
If Not (ini Is Nothing) Then
'We define default settings only if they do not exist in ini file yet
If ini.StringValue("YourScriptSection","ShowSomething") = "" Then
ini.BoolValue("YourScriptSection","ShowSomething") = False
End If
If ini.StringValue("YourScriptSection","DoThat") = "" Then
ini.BoolValue("YourScriptSection","DoThat") = True
End If
If ini.StringValue("YourScriptSection","SomeStringValue") = "" Then
ini.StringValue("YourScriptSection","SomeStringValue") = "Blah"
End If
If ini.StringValue("YourScriptSection","SomeNumericalValue") = "" Then
ini.IntValue("YourScriptSection","SomeNumericalValue") = 8
End If
End If
End Sub