summaryrefslogtreecommitdiff
path: root/setup/uninstall.vbs
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2020-09-14 12:27:22 +0200
committerJörg Frings-Fürst <debian@jff.email>2020-09-14 12:27:22 +0200
commit0e9b185152b56ff33fe8a2a89a4f84923a308300 (patch)
treea5921c0b328a249f4978fa27c641e13512f16d44 /setup/uninstall.vbs
parentc71bf8390b9a06fa498d2cb4f8a4924309f4875e (diff)
New upstream version 3.1.7upstream/3.1.7
Diffstat (limited to 'setup/uninstall.vbs')
-rw-r--r--setup/uninstall.vbs63
1 files changed, 63 insertions, 0 deletions
diff --git a/setup/uninstall.vbs b/setup/uninstall.vbs
new file mode 100644
index 0000000..b392a46
--- /dev/null
+++ b/setup/uninstall.vbs
@@ -0,0 +1,63 @@
+' This VBScript should run before any files are actually removed
+
+On Error Resume Next
+
+Set sh = CreateObject("WScript.Shell")
+' Set fso = CreateObject("Scripting.FileSystemObject")
+
+Dim installer : Set installer = Nothing
+Set installer = CreateObject("WindowsInstaller.Installer")
+
+'key = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRoot"
+'SysLoc = sh.RegRead(key) & "\system32"
+
+' remove the showsel EventLog source entries
+keybase = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\showsel"
+key1 = keybase & "\EventMessageFile"
+key2 = keybase & "\TypesSupported"
+sh.RegDelete key1
+sh.RegDelete key2
+sh.RegDelete keybase
+
+' Find out where our files were installed
+If(IsEmpty(Session)) Then
+ 'Not running from within installer. Source path is current directory.
+ InstallLoc = sh.CurrentDirectory
+Else
+ 'Running inside the installer, use CustomActionData "[TARGETDIR]".
+ ' InstallLoc = installer.ProductInfo(productCode, "InstallLocation")
+ InstallLoc = Session.Property("CustomActionData")
+ If(IsEmpty(InstallLoc)) Then
+ InstallLoc = "C:\Program Files\sourceforge\ipmiutil"
+ End If
+End If
+' wscript.echo "InstallLoc=" & InstallLoc
+
+' Remove the InstallLoc from the Environment Path
+key3 = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path"
+EnvPath = sh.RegRead(key3)
+' wscript.echo "EnvPath= " & EnvPath
+
+' Calculates strStartAt which cuts the strSearchFor value from the path
+' strSearchFor = ";C:\program files\intel\ipmirastools"
+strSearchFor = ";" & InstallLoc
+newPath = EnvPath
+iStartAt = "0"
+strSearchForLen=len(strSearchFor)
+strStartAt = inStr(lCase(newPath), lCase(strSearchFor))
+If (strStartAt > "0") then
+ iStartAt = (strStartAt-1)
+' wscript.echo "strStartAt= " & strStartAt & " iStartAt= " & iStartAt
+
+' Builds the new Path
+' Joins the Values to the left and right of strSearchFor
+ strTotalLen=len(newPath)
+ newPathLeft=left(newPath,iStartAt)
+ newPathRight=right(newPath, (strTotalLen-strSearchForLen-iStartAt))
+ newPath=newPathLeft + newPathRight
+end if
+
+' wscript.echo "newPath= " & newPath
+sh.RegWrite key3, newPath, "REG_EXPAND_SZ"
+
+