Permalink
Browse files

added reinstall script

  • Loading branch information...
mcandre committed Jan 15, 2012
1 parent b5b6e4c commit 819533556a33cd1db1723d1d93d7f05d736bcb33
Showing with 47 additions and 2 deletions.
  1. +10 −2 README.md
  2. +37 −0 reinstall.vbs
View
@@ -23,7 +23,15 @@ Glue can install itself onto a USB drive for portability.
Success
-If installation fails, try removing Glue from the USB drive, then reinstalling Glue.
+If installation fails, try reinstalling Glue.
+
+ > reinstall
+ Where is the USB drive?
+ E:
+
+ ...
+
+ Success
## Usage
@@ -32,7 +40,7 @@ If installation fails, try removing Glue from the USB drive, then reinstalling G
* Autorun may execute Glue automatically.
* If not, nagivate to `USB:\glue\` and execute `glue.exe`.
-Antivirus may delete `pwdump.exe` and other necessary files. If this happens, try reinstalling Glue onto the USB drive to restore the files. Disable Antivirus, run Glue, and reenable antivirus.
+Antivirus may delete `pwdump.exe` and other necessary files. If this happens, try reinstalling Glue. Disable Antivirus, run Glue, and reenable antivirus.
## Removal
View
@@ -0,0 +1,37 @@
+' Restores glue binaries from a USB drive,
+' Restores the autorun file,
+' And reassigns the volume label.
+
+set fso = CreateObject("Scripting.FileSystemObject")
+set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2")
+set shell = WScript.CreateObject("WScript.Shell")
+
+usb = InputBox("Where is the USB drive?", "Glue Installer", "E:")
+
+autorun = usb & "\autorun.inf"
+glue = usb & "\glue"
+
+fso.DeleteFile autorun, True
+fso.DeleteFolder glue, True
+
+set colDrives = objWMIService.ExecQuery("Select * from Win32_LogicalDisk where DeviceID = '" & usb & "'")
+for Each objDrive in colDrives
+ objDrive.VolumeName = "HD"
+ objDrive.Put_
+next
+
+cwd = Replace(WScript.ScriptFullName, WScript.ScriptName, "")
+cwd = mid(cwd, 1, len(cwd) - 1) ' Remove trailing backslash
+
+autorun = cwd & "\autorun.inf"
+
+fso.CopyFile autorun, usb & "\", True
+fso.CopyFolder cwd, usb & "\", True
+
+set colDrives = objWMIService.ExecQuery("Select * from Win32_LogicalDisk where DeviceID = '" & usb & "'")
+for Each objDrive in colDrives
+ objDrive.VolumeName = "Glue"
+ objDrive.Put_
+next
+
+MsgBox "Success", 0, "Glue Installer"

0 comments on commit 8195335

Please sign in to comment.