



Steegy wrote:BTW: If you create Inno Setups, I strongly recommend the ISTool setup creation GUI (avaliable as package from Inno's website, together with the setup compiler).
'-------------------------OPEN---------------------------------
Dim FSO : Set FSO=CreateObject("Scripting.FileSystemObject")
Dim SDB : Set SDB=CreateObject("SongsDB.SDBApplication")
While Not SDB.isRunning : WScript.Sleep 500 : Wend
'--------------------------------------------------------------
InstallScriptTo "Auto\XXXXXXXXX.vbs", LineBegin, LineEnd , _
_
"Script Successfully Installed!" &vbLf&_
"Please restart MediaMonkey" &vbLf&_
"Other notes to user after install....."
'--------------------------CLOSE-------------------------------
SDB.ShutdownAfterDisconnect=True
Set FSO=Nothing : Set SDB=Nothing : Wscript.Quit
'--------------------------------------------------------------
'This is line 20, and you can paste your script in here and see
'what the end line is to do the InstallScriptTo command options
'
'Like a 100 Line Script would need a command above like
'
'InstallScriptTo "Auto\MyScriptName.vbs", 20, 120, "MessageText"
'%%%%%%%%%%%%%%%%% START OF SCRIPT INSTALLER %%%%%%%%%%%%%%%%%%
Sub InstallScriptTo(ScriptName, LineBegin, LineEnd, Message)
ScriptName=SDB.ApplicationPath & "Scripts\" & ScriptName
RenameOldScript(ScriptName)
Set TXT=FSO.OpenTextFile(WScript.ScriptFullName,1)
STR=TXT.ReadAll
TXT.Close
LNS=Split(STR,vbNewLine)
Set TXT=FSO.CreateTextFile(ScriptName, True)
For i=LineBegin-1 To LineEnd-1
TXT.WriteLine LNS(i)
Next
TXT.Close
If FSO.FileExists(ScriptName) And Message<>"none" Then _
SDB.MessageBox Message , 2, Array(4)
End Sub
Sub RenameOldScript(ScriptName)
If FSO.FileExists(ScriptName) Then _
FSO.MoveFile ScriptName, BakFile(ScriptName)
End Sub
Function BakFile(ScriptName)
Do
TMP=Left(ScriptName, Len(ScriptName)-3) & "old" & v
v=v+1
Loop While FSO.FileExists(TMP)
BakFile=TMP
End Function
'%%%%%%%%%%%%%%%%%% END OF SCRIPT INSTALLER %%%%%%%%%%%%%%%%%%%
Users browsing this forum: No registered users and 8 guests