+ specify paths to add to local PATH variable
+ show version number + "Cancel"-button to erase registry settings if there were some upon launch (if LaunchPad didn't shutdown correctly and registry settings were left) x Unattended-switch didn't do cleanup of registry and regsvr32
This commit is contained in:
parent
25f89966fb
commit
91e79130e7
51
U3Helper.ahk
51
U3Helper.ahk
@ -2,6 +2,7 @@
|
|||||||
#NoEnv
|
#NoEnv
|
||||||
#Include mb_IniTools.ahk
|
#Include mb_IniTools.ahk
|
||||||
#Include mb_TextTools.ahk
|
#Include mb_TextTools.ahk
|
||||||
|
U3HVer = 1.2
|
||||||
|
|
||||||
EnvGet U3_DEVICE_SERIAL, U3_DEVICE_SERIAL ; serial number of device (copy protection)
|
EnvGet U3_DEVICE_SERIAL, U3_DEVICE_SERIAL ; serial number of device (copy protection)
|
||||||
EnvGet U3_DEVICE_PATH, U3_DEVICE_PATH ; drive letter to device (F:)
|
EnvGet U3_DEVICE_PATH, U3_DEVICE_PATH ; drive letter to device (F:)
|
||||||
@ -61,7 +62,7 @@ If 1 = config
|
|||||||
; ##########################################################################
|
; ##########################################################################
|
||||||
|
|
||||||
Menu Tray, Icon
|
Menu Tray, Icon
|
||||||
TrayTip Preparing %AppName% ..., U3Helper`n(c)2006 Markus Birth`nmbirth@webwriters.de, 3, 1
|
TrayTip Preparing %AppName% ..., U3Helper %U3HVer%`n(c)2006 Markus Birth`nmbirth@webwriters.de, 3, 1
|
||||||
|
|
||||||
Status("Checking registry settings...")
|
Status("Checking registry settings...")
|
||||||
keycount = 0
|
keycount = 0
|
||||||
@ -88,7 +89,7 @@ If 1 = config
|
|||||||
Status("")
|
Status("")
|
||||||
IniWrite 1, %INIFile%, U3Helper, KeepSettings
|
IniWrite 1, %INIFile%, U3Helper, KeepSettings
|
||||||
If (Unattended = "0")
|
If (Unattended = "0")
|
||||||
{
|
{
|
||||||
MsgBox 4132, %AppName%: Duplicate settings, Settings for %AppName% were already found on this PC. Do you want to use them?`n`nIf you select NO, the local settings will be overwritten by those saved on your U3 stick.`n(They have been backed up and can be restored upon eject of the stick.)
|
MsgBox 4132, %AppName%: Duplicate settings, Settings for %AppName% were already found on this PC. Do you want to use them?`n`nIf you select NO, the local settings will be overwritten by those saved on your U3 stick.`n(They have been backed up and can be restored upon eject of the stick.)
|
||||||
IfMsgBox Yes
|
IfMsgBox Yes
|
||||||
{
|
{
|
||||||
@ -185,7 +186,7 @@ Else If 1 = unconfig
|
|||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
; U3 stick plugged in
|
; U3 stick plugged in
|
||||||
IniRead ForeignSettings, %INIFile%, U3Helper, ForeignSettings, 0
|
IniRead ForeignSettings, %INIFile%, U3Helper, ForeignSettings, 0
|
||||||
If (ForeignSettings <> "0")
|
If (ForeignSettings <> "0")
|
||||||
{
|
{
|
||||||
@ -257,16 +258,20 @@ Else If 1 = unconfig
|
|||||||
If (KeepSettings <> "0")
|
If (KeepSettings <> "0")
|
||||||
{
|
{
|
||||||
If (Unattended = "0")
|
If (Unattended = "0")
|
||||||
{
|
{
|
||||||
MsgBox 4132, %AppName%: Foreign settings, Do you want to keep the changed settings for %AppName%?`n`n(Select No to revert to the former settings.)
|
MsgBox 4131, %AppName%: Foreign settings, Do you want to keep the changed settings for %AppName%?`n`n(Select No to revert to the former settings. Cancel to erase settings.)
|
||||||
IfMsgBox No
|
IfMsgBox No
|
||||||
{
|
{
|
||||||
RevertSettings := "1"
|
RevertSettings := "1"
|
||||||
}
|
}
|
||||||
|
IfMsgBox Cancel
|
||||||
|
{
|
||||||
|
KeepSettings := "0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
RevertSettings := "1"
|
RevertSettings := "1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
If (KeepSettings = "0" or RevertSettings = "1")
|
If (KeepSettings = "0" or RevertSettings = "1")
|
||||||
@ -284,7 +289,7 @@ Else If 1 = unconfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
If (KeepSettings = "0")
|
If (KeepSettings = "0" or Unattended = "1")
|
||||||
{
|
{
|
||||||
Loop %regdel0%
|
Loop %regdel0%
|
||||||
{
|
{
|
||||||
@ -334,7 +339,7 @@ Else If 1 = unconfig
|
|||||||
|
|
||||||
Status("")
|
Status("")
|
||||||
If (U3_IS_DEVICE_AVAILABLE = "true")
|
If (U3_IS_DEVICE_AVAILABLE = "true")
|
||||||
{
|
{
|
||||||
IniDelete %INIFile%, U3Helper, ForeignSettings
|
IniDelete %INIFile%, U3Helper, ForeignSettings
|
||||||
IniDelete %INIFile%, U3Helper, KeepSettings
|
IniDelete %INIFile%, U3Helper, KeepSettings
|
||||||
}
|
}
|
||||||
@ -344,10 +349,36 @@ Else If 1 = appstart
|
|||||||
EnvSet USERPROFILE, %U3_APP_DATA_PATH%
|
EnvSet USERPROFILE, %U3_APP_DATA_PATH%
|
||||||
EnvSet HOMEPATH, %U3_APP_DATA_PATH%
|
EnvSet HOMEPATH, %U3_APP_DATA_PATH%
|
||||||
EnvSet APPDATA, %U3_APP_DATA_PATH%\Application Data
|
EnvSet APPDATA, %U3_APP_DATA_PATH%\Application Data
|
||||||
|
|
||||||
|
; add custom PATH directories
|
||||||
|
EnvGet ePATH, PATH
|
||||||
|
IniGetKeys("envdir", INIFile, "EnvPath")
|
||||||
|
Loop %envdir0%
|
||||||
|
{
|
||||||
|
CurPath := envdir%A_Index%
|
||||||
|
StringReplace CurPath, CurPath, % "%ALLUSERSPROFILE%", %eALLUSERSPROFILE%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%APPDATA%", %eAPPDATA%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%CommonProgramFiles%", %eCommonProgramFiles%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%HOMEPATH%", %eHOMEPATH%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%ProgramFiles%", %eProgramFiles%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%SystemRoot%", %eSystemRoot%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%USERPROFILE%", %eUSERPROFILE%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%WINDIR%", %ewindir%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%TEMP%", %eTEMP%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%U3_APP_DATA_PATH%", %U3_APP_DATA_PATH%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%U3_DEVICE_DOCUMENT_PATH%", %U3_DEVICE_DOCUMENT_PATH%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%U3_DEVICE_EXEC_PATH%", %U3_DEVICE_EXEC_PATH%, A
|
||||||
|
StringReplace CurPath, CurPath, % "%U3_HOST_EXEC_PATH%", %U3_HOST_EXEC_PATH%, A
|
||||||
|
|
||||||
|
ePATH := CurPath . ";" . ePATH
|
||||||
|
}
|
||||||
|
EnvSet PATH, %ePATH%
|
||||||
|
|
||||||
IfNotExist %APPDATA%
|
IfNotExist %APPDATA%
|
||||||
{
|
{
|
||||||
FileCreateDir %APPDATA%
|
FileCreateDir %APPDATA%
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdl := AppExe
|
cmdl := AppExe
|
||||||
Loop %0%
|
Loop %0%
|
||||||
{
|
{
|
||||||
@ -364,8 +395,10 @@ Else If 1 = appstop
|
|||||||
|
|
||||||
ToolTip Closing %AppName% ...
|
ToolTip Closing %AppName% ...
|
||||||
|
|
||||||
|
SplitPath AppExe, AppFile, null, null, null, null
|
||||||
|
|
||||||
TryClose:
|
TryClose:
|
||||||
Process Exist, %AppExe%
|
Process Exist, %AppFile%
|
||||||
If ErrorLevel
|
If ErrorLevel
|
||||||
ProgPID = %ErrorLevel%
|
ProgPID = %ErrorLevel%
|
||||||
Else
|
Else
|
||||||
|
@ -34,3 +34,9 @@ safe.ind
|
|||||||
; %ProgramFiles%, %SystemRoot%, %TEMP%, %USERPROFILE%, %WINDIR%,
|
; %ProgramFiles%, %SystemRoot%, %TEMP%, %USERPROFILE%, %WINDIR%,
|
||||||
; %U3_APP_DATA_PATH%, %U3_DEVICE_DOCUMENT_PATH%, %U3_DEVICE_EXEC_PATH%
|
; %U3_APP_DATA_PATH%, %U3_DEVICE_DOCUMENT_PATH%, %U3_DEVICE_EXEC_PATH%
|
||||||
%ALLUSERSPROFILE%\Application Data\Spybot - Search & Destroy
|
%ALLUSERSPROFILE%\Application Data\Spybot - Search & Destroy
|
||||||
|
|
||||||
|
[EnvPath]
|
||||||
|
; enter folders to be added to the PATH environment variable
|
||||||
|
; upon running the application. All variables mentioned under
|
||||||
|
; [FileDelete] get replaced.
|
||||||
|
%U3_HOST_EXEC_PATH%\lib\gtk\bin
|
||||||
|
Reference in New Issue
Block a user