From 0e58eae164a5d669e22c2eb709fbb4a1cdc13235 Mon Sep 17 00:00:00 2001 From: mbirth Date: Tue, 17 Apr 2007 16:49:19 +0000 Subject: [PATCH] + remove bad attributes from files/dirs before deleting them on hostCleanUp x create directory if needed in FileCopyNewer() * more optimizations so that U3Helper now can be installed as a separate U3-Package (GUID: 0f90f88c-5e05-4cab-8c3a-e1c0112b06fd) --- U3H_appStart.ahk | 1 + U3H_hostCleanUp.ahk | 2 ++ U3Helper.ahk | 23 +++++++++++++++-------- readme.txt | 3 ++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/U3H_appStart.ahk b/U3H_appStart.ahk index f470260..bdaba19 100644 --- a/U3H_appStart.ahk +++ b/U3H_appStart.ahk @@ -20,6 +20,7 @@ IfNotExist %APPDATA% FileCreateDir %APPDATA% } +SetWorkingDir %U3_HOST_EXEC_PATH% cmdl := AppExe Loop %0% { diff --git a/U3H_hostCleanUp.ahk b/U3H_hostCleanUp.ahk index 5d0644a..356585e 100644 --- a/U3H_hostCleanUp.ahk +++ b/U3H_hostCleanUp.ahk @@ -265,11 +265,13 @@ If (KeepSettings = "0" or Unattended = "1") IfInString FilAttr, D { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/fildel0, Removing directory #%A_Index% from host ... + FileSetAttrib -rhs, %CurFile% FileRemoveDir %CurFile%, 1 } Else { Progress % StepsPos*StepsStep+StepsStep*(A_Index-1)/fildel0, Removing file #%A_Index% from host ... + FileSetAttrib -rhs, %CurFile% FileDelete %CurFile% } } diff --git a/U3Helper.ahk b/U3Helper.ahk index c555125..6179282 100644 --- a/U3Helper.ahk +++ b/U3Helper.ahk @@ -3,10 +3,19 @@ #Include mb_EnvTools.ahk #Include mb_IniTools.ahk #Include mb_TextTools.ahk -U3HVer = 1.8 +U3HVer = 2.0 + +U3_APP_DATA_PATH := EnvValue("U3_APP_DATA_PATH") +U3_HOST_EXEC_PATH := EnvValue("U3_HOST_EXEC_PATH") +U3_DEVICE_EXEC_PATH := EnvValue("U3_DEVICE_EXEC_PATH") +EnvGet U3_IS_DEVICE_AVAILABLE, U3_IS_DEVICE_AVAILABLE +EnvGet U3_IS_AUTORUN, U3_IS_AUTORUN SplitPath A_ScriptFullPath, null, ScrDir, null, ScrFile, ScrDrive INIFile = %ScrDir%\%ScrFile%.ini +If (StrLen(U3_HOST_EXEC_PATH) > 0) + INIFile = %U3_HOST_EXEC_PATH%\%ScrFile%.ini + IniRead AppName, %INIFile%, U3Helper, AppName, unknown IniRead AppExe, %INIFile%, U3Helper, AppExe, cmd.exe IniRead Unattended, %INIFile%, U3Helper, Unattended, 0 @@ -19,12 +28,6 @@ IniGetKeys("regbak", INIFile, "RegBackup") IniGetKeys("regdel", INIFile, "RegDelete") IniGetKeys("fildel", INIFile, "FileDelete") -U3_APP_DATA_PATH := EnvValue("U3_APP_DATA_PATH") -U3_HOST_EXEC_PATH := EnvValue("U3_HOST_EXEC_PATH") -U3_DEVICE_EXEC_PATH := EnvValue("U3_DEVICE_EXEC_PATH") -EnvGet U3_IS_DEVICE_AVAILABLE, U3_IS_DEVICE_AVAILABLE -EnvGet U3_IS_AUTORUN, U3_IS_AUTORUN - WinGetPos,Tx,Ty,Tw,Th,ahk_class Shell_TrayWnd,,, ; Tw>Th: horizontal taskbar (top or bottom) ; Tw + MsgBox 48, U3Helper %U3HVer% - About, This is the U3Helper tool for making applications U3-Smart. It cannot be directly started.`n`nNo parameter given.`n`nSee http://www.autohotkey.com/forum/topic11839.html for info.`n`n(c)2006-2007 Markus Birth MsgBox 64, U3Helper %U3HVer% - Debug info, % EnvList(), 30 } diff --git a/readme.txt b/readme.txt index f540e7c..eaf89ed 100644 --- a/readme.txt +++ b/readme.txt @@ -11,7 +11,7 @@ inside the - such as: BUT: If you app DOES store some stuff inside %USERPROFILE% (mostly noticeable if there appears something under C:\Documents and Settings\\Application Data\\), call it as follows: - appstart + appstart This way, the environment variables %USERPROFILE% and a bunch of other related will be set to point to the data directory on the U3-stick and therefore those app will store its data there instead of on the host system. @@ -25,3 +25,4 @@ format. U3Helper Forum: http://vanilla.birth-online.de/3/ U3Helper English info: http://www.autohotkey.com/forum/topic11839.html U3Helper German info: http://blog.birth-online.de/archives/164-Programme-U3-faehig-machen.html +U3Helper Bugtracker: http://mantis.birth-online.de/set_project.php?project_id=5