* raised version to 1.4
x fixed bug with unchanged single files (non-directories)
This commit is contained in:
parent
da17fdfc7f
commit
5b5ee6ed25
@ -26,7 +26,7 @@ Else
|
|||||||
{
|
{
|
||||||
Loop %regbak0%
|
Loop %regbak0%
|
||||||
{
|
{
|
||||||
Status("Translating paths in registry #" . A_Index . " ...")
|
Status("Translating paths in registry #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
CurBranch := regbak%A_Index%
|
CurBranch := regbak%A_Index%
|
||||||
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
||||||
Loop %RegRoot%, %RegSub%, 0, 1
|
Loop %RegRoot%, %RegSub%, 0, 1
|
||||||
@ -55,7 +55,7 @@ Else
|
|||||||
Loop %regbak0%
|
Loop %regbak0%
|
||||||
{
|
{
|
||||||
CurBranch := regbak%A_Index%
|
CurBranch := regbak%A_Index%
|
||||||
Status("Saving registry settings #" . A_Index . " ...")
|
Status("Saving registry settings #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
RunWait regedit /E "%U3_APP_DATA_PATH%\regdata%A_Index%.reg" "%CurBranch%"
|
RunWait regedit /E "%U3_APP_DATA_PATH%\regdata%A_Index%.reg" "%CurBranch%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,13 +70,22 @@ Else
|
|||||||
{
|
{
|
||||||
IfExist %U3_HOST_EXEC_PATH%\%CurFile%
|
IfExist %U3_HOST_EXEC_PATH%\%CurFile%
|
||||||
{
|
{
|
||||||
Status("Saving data directory " . CurFile . " ...")
|
StatDots := ""
|
||||||
SetWorkingDir %U3_HOST_EXEC_PATH%\%CurFile%
|
SetWorkingDir %U3_HOST_EXEC_PATH%\%CurFile%
|
||||||
Loop *.*, 0, 1
|
Loop *.*, 0, 1
|
||||||
{
|
{
|
||||||
|
Status("Saving data directory " . CurFile . " " . StatDots)
|
||||||
FileCopyNewer(A_LoopFileLongPath, U3_APP_DATA_PATH . "\" CurFile . "\" . A_LoopFileFullPath)
|
FileCopyNewer(A_LoopFileLongPath, U3_APP_DATA_PATH . "\" CurFile . "\" . A_LoopFileFullPath)
|
||||||
If ErrorLevel
|
If ErrorLevel > 0
|
||||||
CopyErrors := CopyErrors . "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . "`n"
|
CopyErrors .= "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . "`n"
|
||||||
|
If ErrorLevel = 2
|
||||||
|
StatDots .= "E"
|
||||||
|
else if ErrorLevel = 1
|
||||||
|
StatDots .= "N"
|
||||||
|
else if ErrorLevel = -1
|
||||||
|
StatDots .= "."
|
||||||
|
else
|
||||||
|
StatDots .= ">"
|
||||||
}
|
}
|
||||||
SetWorkingDir %A_ScriptDir%
|
SetWorkingDir %A_ScriptDir%
|
||||||
}
|
}
|
||||||
@ -93,8 +102,8 @@ Else
|
|||||||
{
|
{
|
||||||
Status("Saving data file " . CurFile . " ...")
|
Status("Saving data file " . CurFile . " ...")
|
||||||
FileCopyNewer(U3_HOST_EXEC_PATH . "\" . CurFile, U3_APP_DATA_PATH . "\" . CurFile)
|
FileCopyNewer(U3_HOST_EXEC_PATH . "\" . CurFile, U3_APP_DATA_PATH . "\" . CurFile)
|
||||||
If ErrorLevel
|
If ErrorLevel > 0
|
||||||
CopyErrors := CopyErrors . "File: " . CurFile . "`n"
|
CopyErrors .= "File: " . CurFile . "`n"
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
@ -134,13 +143,13 @@ If (KeepSettings = "0" or RevertSettings = "1")
|
|||||||
{
|
{
|
||||||
Loop %regbak0%
|
Loop %regbak0%
|
||||||
{
|
{
|
||||||
Status("Removing registry settings #" . A_Index . " from host system ...")
|
Status("Removing registry settings #" . A_Index . " from host system " . StrCopy(".", A_Index))
|
||||||
CurBranch := regbak%A_Index%
|
CurBranch := regbak%A_Index%
|
||||||
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
||||||
RegDelete %RegRoot%, %RegSub%
|
RegDelete %RegRoot%, %RegSub%
|
||||||
If (RevertSettings = "1")
|
If (RevertSettings = "1")
|
||||||
{
|
{
|
||||||
Status("Restoring registry settings #" . A_Index . " from backup ...")
|
Status("Restoring registry settings #" . A_Index . " from backup " . StrCopy(".", A_Index))
|
||||||
RunWait regedit /S "%U3_HOST_EXEC_PATH%\U3Hregbak%A_Index%.reg"
|
RunWait regedit /S "%U3_HOST_EXEC_PATH%\U3Hregbak%A_Index%.reg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,7 +158,7 @@ If (KeepSettings = "0" or Unattended = "1")
|
|||||||
{
|
{
|
||||||
Loop %regdel0%
|
Loop %regdel0%
|
||||||
{
|
{
|
||||||
Status("Removing add. registry settings #" . A_Index . " from host system ...")
|
Status("Removing add. registry settings #" . A_Index . " from host system " . StrCopy(".", A_Index))
|
||||||
CurBranch := regdel%A_Index%
|
CurBranch := regdel%A_Index%
|
||||||
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
||||||
RegDelete %RegRoot%, %RegSub%
|
RegDelete %RegRoot%, %RegSub%
|
||||||
@ -159,7 +168,7 @@ If (KeepSettings = "0" or Unattended = "1")
|
|||||||
Loop %regsvr0%
|
Loop %regsvr0%
|
||||||
{
|
{
|
||||||
CurDLL := regsvr%A_Index%
|
CurDLL := regsvr%A_Index%
|
||||||
Status("Unregistering file " . CurDLL . " ...")
|
Status("Unregistering file " . CurDLL . " " . StrCopy(".", A_Index))
|
||||||
RunWait regsvr32 /S /U "%U3_HOST_EXEC_PATH%\%CurDLL%"
|
RunWait regsvr32 /S /U "%U3_HOST_EXEC_PATH%\%CurDLL%"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,12 +191,12 @@ If (KeepSettings = "0" or Unattended = "1")
|
|||||||
FileGetAttrib FilAttr, %CurFile%
|
FileGetAttrib FilAttr, %CurFile%
|
||||||
IfInString FilAttr, D
|
IfInString FilAttr, D
|
||||||
{
|
{
|
||||||
Status("Removing directory #" . A_Index . " from host system ...")
|
Status("Removing directory #" . A_Index . " from host system " . StrCopy(".", A_Index))
|
||||||
FileRemoveDir %CurFile%, 1
|
FileRemoveDir %CurFile%, 1
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
Status("Removing file #" . A_Index . " from host system ...")
|
Status("Removing file #" . A_Index . " from host system " . StrCopy(".", A_Index))
|
||||||
FileDelete %CurFile%
|
FileDelete %CurFile%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,9 @@ Loop %regbak0%
|
|||||||
}
|
}
|
||||||
If (keycount > 0)
|
If (keycount > 0)
|
||||||
{
|
{
|
||||||
Status("Backing up registry settings #" . A_Index . " ...")
|
Status("Backing up registry settings #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
RunWait regedit /E "%U3_HOST_EXEC_PATH%\U3Hregbak%A_Index%.reg" "%CurBranch%"
|
RunWait regedit /E "%U3_HOST_EXEC_PATH%\U3Hregbak%A_Index%.reg" "%CurBranch%"
|
||||||
Status("Cleaning registry settings #" . A_Index . " ...")
|
Status("Cleaning registry settings #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
RegDelete %RegRoot%, %RegSub%
|
RegDelete %RegRoot%, %RegSub%
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ If (ForeignSettings = "0")
|
|||||||
{
|
{
|
||||||
Loop %regbak0%
|
Loop %regbak0%
|
||||||
{
|
{
|
||||||
Status("Importing registry settings #" . A_Index . " ...")
|
Status("Importing registry settings #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
RunWait regedit /S "%U3_APP_DATA_PATH%\regdata%A_Index%.reg"
|
RunWait regedit /S "%U3_APP_DATA_PATH%\regdata%A_Index%.reg"
|
||||||
}
|
}
|
||||||
IfExist %U3_APP_DATA_PATH%\regdataX.reg
|
IfExist %U3_APP_DATA_PATH%\regdataX.reg
|
||||||
@ -55,7 +55,7 @@ If (ForeignSettings = "0")
|
|||||||
}
|
}
|
||||||
Loop %regbak0%
|
Loop %regbak0%
|
||||||
{
|
{
|
||||||
Status("Translating paths in registry #" . A_Index . " ...")
|
Status("Translating paths in registry #" . A_Index . " " . StrCopy(".", A_Index))
|
||||||
CurBranch := regbak%A_Index%
|
CurBranch := regbak%A_Index%
|
||||||
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
SplitFirst(RegRoot, RegSub, CurBranch, "\")
|
||||||
Loop %RegRoot%, %RegSub%, 0, 1
|
Loop %RegRoot%, %RegSub%, 0, 1
|
||||||
@ -91,12 +91,12 @@ Loop %datexe0%
|
|||||||
FileGetAttrib FilAttr, %U3_APP_DATA_PATH%\%CurFile%
|
FileGetAttrib FilAttr, %U3_APP_DATA_PATH%\%CurFile%
|
||||||
IfInString FilAttr, D
|
IfInString FilAttr, D
|
||||||
{
|
{
|
||||||
Status("Copying data directory " . CurFile . " ...")
|
Status("Copying data directory " . CurFile . " " . StrCopy(".", A_Index))
|
||||||
FileCopyDir %U3_APP_DATA_PATH%\%CurFile%, %U3_HOST_EXEC_PATH%\%CurFile%, 1
|
FileCopyDir %U3_APP_DATA_PATH%\%CurFile%, %U3_HOST_EXEC_PATH%\%CurFile%, 1
|
||||||
}
|
}
|
||||||
Else
|
Else
|
||||||
{
|
{
|
||||||
Status("Copying data file " . CurFile . " ...")
|
Status("Copying data file " . CurFile . " " . StrCopy(".", A_Index))
|
||||||
FileCopy %U3_APP_DATA_PATH%\%CurFile%, %U3_HOST_EXEC_PATH%\%CurFile%, 1
|
FileCopy %U3_APP_DATA_PATH%\%CurFile%, %U3_HOST_EXEC_PATH%\%CurFile%, 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ If (KeepSettings = "0")
|
|||||||
Loop %regsvr0%
|
Loop %regsvr0%
|
||||||
{
|
{
|
||||||
CurDLL := regsvr%A_Index%
|
CurDLL := regsvr%A_Index%
|
||||||
Status("Registering file " . CurDLL . " ...")
|
Status("Registering file " . CurDLL . " " . StrCopy(".", A_Index))
|
||||||
RunWait regsvr32 /S "%U3_HOST_EXEC_PATH%\%CurDLL%"
|
RunWait regsvr32 /S "%U3_HOST_EXEC_PATH%\%CurDLL%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
U3Helper.ahk
14
U3Helper.ahk
@ -2,7 +2,7 @@
|
|||||||
#NoEnv
|
#NoEnv
|
||||||
#Include mb_IniTools.ahk
|
#Include mb_IniTools.ahk
|
||||||
#Include mb_TextTools.ahk
|
#Include mb_TextTools.ahk
|
||||||
U3HVer = 1.3
|
U3HVer = 1.4
|
||||||
|
|
||||||
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:)
|
||||||
@ -53,6 +53,16 @@ Status(msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StrCopy(str, ct)
|
||||||
|
{
|
||||||
|
res := ""
|
||||||
|
Loop %ct%
|
||||||
|
{
|
||||||
|
res .= str
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
FileCopyNewer(srcf, dstf)
|
FileCopyNewer(srcf, dstf)
|
||||||
{
|
{
|
||||||
IfNotExist %srcf%
|
IfNotExist %srcf%
|
||||||
@ -68,7 +78,7 @@ FileCopyNewer(srcf, dstf)
|
|||||||
FileGetTime FilStamp2, %dstf%
|
FileGetTime FilStamp2, %dstf%
|
||||||
if ((FilSize1 = FilSize2) and (FilStamp1 = FilStamp2)) {
|
if ((FilSize1 = FilSize2) and (FilStamp1 = FilStamp2)) {
|
||||||
; Both versions are same size and same date/time - skip
|
; Both versions are same size and same date/time - skip
|
||||||
ErrorLevel = 0
|
ErrorLevel = -1
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user