\r
\r
' Function to add registry string val.\r
+\r
Function AddRegStringValue(strKeyPath, strValueName, dwValue)\r
const HKEY_LOCAL_MACHINE = &H80000002\r
strComputer = "."\r
End Function\r
\r
\r
-' Not used - sub works although the script invoked does \r
-' not remove the intended files?\r
-' Get file delete script name and put it in the runonce registry key for\r
-' file delete on restart.\r
+' Not used - run the specified command during next startup.\r
\r
-Sub RunAtReboot()\r
- dim run_once_cmd\r
- dim src\r
- dim dstp\r
+Function RunAtReboot(run_once_cmd)\r
dim key_name\r
- Dim fso\r
- Dim sInstalldir\r
- \r
- Set fso = CreateObject("Scripting.FileSystemObject")\r
- sInstalldir = Session.Property("INSTALLDIR")\r
-\r
- ' msgbox "INSTALLED " & Session.property("INSTALLED") ' XXX\r
- ' msgbox "REBOOT " & Session.property("REBOOT")\r
- ' msgbox "INSTALL " & Session.property("INSTALL")\r
- \r
- src = sInstalldir & "IBcore\WinOFDelDriverFiles.bat" \r
- dst = fso.GetSpecialFolder(2) & "WinOFDelDriverFiles.bat"\r
- If fso.FileExists(src) Then\r
- FileDelete(dst)\r
- fso.MoveFile src, dst\r
- run_once_cmd = "cmd.exe /c " & dst\r
- key_name = "Software\Microsoft\Windows\CurrentVersion\RunOnce"\r
- AddRegStringValue key_name,"WinOF",run_once_cmd\r
- End if \r
-End Sub\r
+ key_name = "Software\Microsoft\Windows\CurrentVersion\RunOnce"\r
+ AddRegStringValue key_name,"WinOF",run_once_cmd\r
+ msgbox "RunAtReboot() " & run_once_cmd\r
+ RunAtReboot = 0\r
+End Function\r
\r
\r
\r
\r
End Function\r
\r
+' This routine should never be...InstallShield-12 for some reason has\r
+' decided not to completely remove [INSTALLDIR]? Until such a time\r
+' that 'why' is understood, this routine removes [INSTALLDIR]! Sigh...\r
+' nuke some driver files which remain due to devcon device install.\r
+' Immediate execution; called after MsiCleanupOnSuccess\r
+\r
+Function HammerTime\r
+ Dim fso, sInstallDir, RC, cmd\r
+\r
+ Set fso=CreateObject("Scripting.FileSystemObject") \r
+ Set WshShell=CreateObject("WScript.Shell")\r
+\r
+ sInstallDir = Session.Property("INSTALLDIR")\r
+ If fso.FolderExists(sInstallDir) Then\r
+ cmd = "cmd.exe /c rmdir /S /Q """ & sInstallDir & """"\r
+ RC = wshShell.Run(cmd,0,true)\r
+ End if\r
+\r
+ RemoveInstallFolder = 0\r
+End Function\r
\r
\r
' NOT USED - deferred action to increment ticks while action is taking place\r