Skip to content

Commit

Permalink
added reinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
mcandre committed Jan 15, 2012
1 parent b5b6e4c commit 8195335
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Expand Up @@ -23,7 +23,15 @@ Glue can install itself onto a USB drive for portability.


Success 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 ## Usage


Expand All @@ -32,7 +40,7 @@ If installation fails, try removing Glue from the USB drive, then reinstalling G
* Autorun may execute Glue automatically. * Autorun may execute Glue automatically.
* If not, nagivate to `USB:\glue\` and execute `glue.exe`. * 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 ## Removal


Expand Down
37 changes: 37 additions & 0 deletions reinstall.vbs
@@ -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.