]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WinOF] RC2 changes
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 18 May 2007 17:27:55 +0000 (17:27 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 18 May 2007 17:27:55 +0000 (17:27 +0000)
added HammerTime function to purge [INSTALLDIR] as IS-12 seems to forgotten how to cleanup...

git-svn-id: svn://openib.tc.cornell.edu/gen1@668 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WinOF/InstallShield/CustomActions.vbs

index 9a2bc0290cc54293012e6f0ba8e7f6c393bbba44..ffb42f0d8d4694029f70c0f056b956cc0fdf2e49 100644 (file)
@@ -349,6 +349,7 @@ End Function
 \r
 \r
 ' Function to add registry string val.\r
+\r
 Function AddRegStringValue(strKeyPath, strValueName, dwValue)\r
 const HKEY_LOCAL_MACHINE = &H80000002\r
 strComputer = "."\r
@@ -499,36 +500,15 @@ Function Find_IPOIB_LAC()
 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
@@ -765,6 +745,26 @@ Function ChkInstallAndReboot()
        \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