diff --git a/U3H_appStart.ahk b/U3H_appStart.ahk index dd9acef..f470260 100644 --- a/U3H_appStart.ahk +++ b/U3H_appStart.ahk @@ -30,3 +30,4 @@ Loop %0% } OnExit ASOnExit RunWait %cmdl% +OnExit diff --git a/U3H_appStop.ahk b/U3H_appStop.ahk index a207614..7a62482 100644 --- a/U3H_appStop.ahk +++ b/U3H_appStop.ahk @@ -6,7 +6,7 @@ If (StrLen(RunBeforeStop) > 0) StepsStep := 100/StepsAll StepsPos = 0 -Progress b2 x%PL% y%PT% w%PW% m FM%PFM% FS%PFS%, U3Helper %U3HVer% - (c)2006-2007 Markus Birth , Cleaning up %AppName% ..., AHKProgress-%AppName% +Progress b2 x%PL% y%PT% w%PW% m FM%PFM% FS%PFS%, U3Helper %U3HVer% - (c)2006-2007 Markus Birth , Stopping %AppName% ..., AHKProgress-%AppName% WinSet Transparent, %PTrans%, AHKProgress-%AppName% If (StrLen(RunBeforeStop) > 0) @@ -41,3 +41,4 @@ Goto TryClose CloseDone: Progress 100, appStop done. +ExitApp diff --git a/U3H_hostCleanUp.ahk b/U3H_hostCleanUp.ahk index 5d4a25c..5d0644a 100644 --- a/U3H_hostCleanUp.ahk +++ b/U3H_hostCleanUp.ahk @@ -162,27 +162,30 @@ Else { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/datini0, Translating paths in file %CurFile% ... CurFile := datini%A_Index% - TmpFile := "$$$" . CurFile - FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 - Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/datini0, Translating paths in file %CurFile% ... - Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% + IfExist %U3_APP_DATA_PATH%\%CurFile% { - IfNotInString A_LoopReadLine, = + TmpFile := "$$$" . CurFile + FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 + Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/datini0, Translating paths in file %CurFile% ... + Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% { - ; no key/value-pair --- skip processing - FileAppend %A_LoopReadLine%`n - Continue + IfNotInString A_LoopReadLine, = + { + ; no key/value-pair --- skip processing + FileAppend %A_LoopReadLine%`n + Continue + } + IfNotInString A_LoopReadLine, \ + { + ; no paths to replace --- skip processing + FileAppend %A_LoopReadLine%`n + Continue + } + SplitFirst(IKey, IVal, A_LoopReadLine, "=") + FileAppend % IKey . "=" . EnvUnparseStr(IVal) . "`n" } - IfNotInString A_LoopReadLine, \ - { - ; no paths to replace --- skip processing - FileAppend %A_LoopReadLine%`n - Continue - } - SplitFirst(IKey, IVal, A_LoopReadLine, "=") - FileAppend % IKey . "=" . EnvUnparseStr(IVal) . "`n" + FileDelete %U3_APP_DATA_PATH%\%TmpFile% } - FileDelete %U3_APP_DATA_PATH%\%TmpFile% } If datini0 > 0 diff --git a/U3H_hostConfigure.ahk b/U3H_hostConfigure.ahk index 8fa4e03..2541c58 100644 --- a/U3H_hostConfigure.ahk +++ b/U3H_hostConfigure.ahk @@ -101,27 +101,31 @@ Loop %datini0% { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/datini0, Translating paths in file %CurFile% ... CurFile := datini%A_Index% - TmpFile := "$$$" . CurFile - FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 - Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/datini0, Translating paths in file %CurFile% ... - Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% + IfExist %U3_APP_DATA_PATH%\%CurFile% { - IfNotInString A_LoopReadLine, = + TmpFile := "$$$" . CurFile + FileMove %U3_APP_DATA_PATH%\%CurFile%, %U3_APP_DATA_PATH%\%TmpFile%, 1 + Progress % StepsPos*StepsStep+StepsStep*(A_Index-0.5)/datini0, Translating paths in file %CurFile% ... + Loop Read, %U3_APP_DATA_PATH%\%TmpFile%, %U3_APP_DATA_PATH%\%CurFile% { - ; no key/value-pair --- skip processing + IfNotInString A_LoopReadLine, = + { + ; no key/value-pair --- skip processing FileAppend %A_LoopReadLine%`n - Continue - } - IfNotInString A_LoopReadLine, `% - { - ; no envvars to replace --- skip processing - FileAppend %A_LoopReadLine%`n - Continue - } - SplitFirst(IKey, IVal, A_LoopReadLine, "=") - FileAppend % IKey . "=" . EnvParseStr(IVal) . "`n" + Continue + } + IfNotInString A_LoopReadLine, `% + { + ; no envvars to replace --- skip processing + FileAppend %A_LoopReadLine%`n + Continue + } + SplitFirst(IKey, IVal, A_LoopReadLine, "=") + FileAppend % IKey . "=" . EnvParseStr(IVal) . "`n" + + } + FileDelete %U3_APP_DATA_PATH%\%TmpFile% } - FileDelete %U3_APP_DATA_PATH%\%TmpFile% } If datini0 > 0