Archived
1
0

+ added U3Helper-GUID to variable U3HUUID

+ added example manifest to SVN
x also copy empty directories on hostConfigure / hostCleanUp
x hostCleanUp fails if device is unplugged
(Issue: 2,9)
This commit is contained in:
mbirth 2007-04-29 14:35:54 +00:00
parent 180a78acc2
commit 61831aed16
4 changed files with 73 additions and 22 deletions

View File

@ -100,28 +100,41 @@ Else
OutIndex = %A_Index% OutIndex = %A_Index%
FileCount = 0 FileCount = 0
SetWorkingDir %U3_HOST_EXEC_PATH%\%CurFile% SetWorkingDir %U3_HOST_EXEC_PATH%\%CurFile%
Loop *.*, 0, 1 Loop *.*, 1, 1
{ {
FileCount++ FileCount++
} }
Loop *.*, 0, 1 Loop *.*, 1, 1
{ {
Progress % StepsPos*StepsStep+StepsStep*(OutIndex-1.00+(A_Index/FileCount))/datexe0, Saving data directory %CurFile% ... (CPY:%Copied% / SKP:%Skipped% / ERR:%Errors%) Progress % StepsPos*StepsStep+StepsStep*(OutIndex-1.00+(A_Index/FileCount))/datexe0, Saving data directory %CurFile% ... (CPY:%Copied% / SKP:%Skipped% / ERR:%Errors%)
FileCopyNewer(A_LoopFileLongPath, U3_APP_DATA_PATH . "\" CurFile . "\" . A_LoopFileFullPath) FileGetAttrib FAttr, %A_LoopFileLongPath%
If ErrorLevel = 2 IfInString FAttr, D
{ {
CopyErrors .= "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . " (Error while copying)`n" IfNotExist %U3_APP_DATA_PATH%\%CurFile%\%A_LoopFileFullPath%
Errors++ FileCreateDir %U3_APP_DATA_PATH%\%CurFile%\%A_LoopFileFullPath%
If ErrorLevel
Errors++
Else
Copied++
} }
else if ErrorLevel = 1 Else
{ {
CopyErrors .= "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . " (File does not exist)`n" FileCopyNewer(A_LoopFileLongPath, U3_APP_DATA_PATH . "\" CurFile . "\" . A_LoopFileFullPath)
Errors++ If ErrorLevel = 2
{
CopyErrors .= "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . " (Error while copying)`n"
Errors++
}
else if ErrorLevel = 1
{
CopyErrors .= "Dir-entry: " . CurFile . "\" . A_LoopFileFullPath . " (File does not exist)`n"
Errors++
}
else if ErrorLevel = -1
Skipped++
else
Copied++
} }
else if ErrorLevel = -1
Skipped++
else
Copied++
} }
SetWorkingDir %A_ScriptDir% SetWorkingDir %A_ScriptDir%
} }

View File

@ -5,6 +5,8 @@
; ########################################################################## ; ##########################################################################
StepsAll = 0 StepsAll = 0
IfNotExist %U3_HOST_EXEC_PATH%\%A_ScriptName%
StepsAll++
If regsvr0 > 0 If regsvr0 > 0
StepsAll++ StepsAll++
If datini0 > 0 If datini0 > 0
@ -21,7 +23,15 @@ StepsPos = 0
Progress b2 x%PL% y%PT% w%PW% m FM%PFM% FS%PFS%, U3Helper %U3HVer% - (c)2006-2007 Markus Birth <mbirth@webwriters.de>, Preparing %AppName% ..., AHKProgress-%AppName% Progress b2 x%PL% y%PT% w%PW% m FM%PFM% FS%PFS%, U3Helper %U3HVer% - (c)2006-2007 Markus Birth <mbirth@webwriters.de>, Preparing %AppName% ..., AHKProgress-%AppName%
WinSet Transparent, %PTrans%, AHKProgress-%AppName% WinSet Transparent, %PTrans%, AHKProgress-%AppName%
Progress, , Checking registry settings... ; made following step not to display b/c it occurs only once on the first launch of any U3H-app
IfNotExist %U3_HOST_EXEC_PATH%\%A_ScriptName%
{
Progress % StepsPos*StepsStep, Copying U3Helper to disk...
FileCopy %A_ScriptFullPath%, %U3_HOST_EXEC_PATH%\%A_ScriptName%, 0
StepsPos++
}
Progress % StepsPos*StepsStep, Checking registry settings...
keycount = 0 keycount = 0
;Registry stuff ;Registry stuff
Loop %regbak0% Loop %regbak0%
@ -143,18 +153,27 @@ Loop %datexe0%
OutIndex = %A_Index% OutIndex = %A_Index%
FileCount = 0 FileCount = 0
SetWorkingDir %U3_APP_DATA_PATH%\%CurFile% SetWorkingDir %U3_APP_DATA_PATH%\%CurFile%
Loop *.*, 0, 1 Loop *.*, 1, 1
{ {
FileCount++ FileCount++
} }
IfNotExist %U3_HOST_EXEC_PATH%\%CurFile% IfNotExist %U3_HOST_EXEC_PATH%\%CurFile%
FileCreateDir %U3_HOST_EXEC_PATH%\%CurFile% FileCreateDir %U3_HOST_EXEC_PATH%\%CurFile%
Loop *.*, 0, 1 Loop *.*, 1, 1
{ {
Progress % StepsPos*StepsStep+StepsStep*(OutIndex-1.00+(A_Index/FileCount))/datexe0, Copying data directory %CurFile% ... (CPY:%Copied% / ERR:%Errors%) Progress % StepsPos*StepsStep+StepsStep*(OutIndex-1.00+(A_Index/FileCount))/datexe0, Copying data directory %CurFile% ... (CPY:%Copied% / ERR:%Errors%)
IfNotExist %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileDir% FileGetAttrib FAttr, %A_LoopFileLongPath%
FileCreateDir %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileDir% IfInString FAttr, D
FileCopy %A_LoopFileLongPath%, %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileFullPath%, 1 {
IfNotExist %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileFullPath%
FileCreateDir %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileFullPath%
}
Else
{
IfNotExist %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileDir%
FileCreateDir %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileDir%
FileCopy %A_LoopFileLongPath%, %U3_HOST_EXEC_PATH%\%CurFile%\%A_LoopFileFullPath%, 1
}
If ErrorLevel If ErrorLevel
Errors++ Errors++
Else Else

View File

@ -3,7 +3,8 @@
#Include mb_EnvTools.ahk #Include mb_EnvTools.ahk
#Include mb_IniTools.ahk #Include mb_IniTools.ahk
#Include mb_TextTools.ahk #Include mb_TextTools.ahk
U3HVer = 2.0 U3HVer = 2.1
U3HUUID = 0f90f88c-5e05-4cab-8c3a-e1c0112b06fd
U3_APP_DATA_PATH := EnvValue("U3_APP_DATA_PATH") U3_APP_DATA_PATH := EnvValue("U3_APP_DATA_PATH")
U3_HOST_EXEC_PATH := EnvValue("U3_HOST_EXEC_PATH") U3_HOST_EXEC_PATH := EnvValue("U3_HOST_EXEC_PATH")

18
manifestex.u3i Normal file
View File

@ -0,0 +1,18 @@
<u3manifest version="1.0">
<application uuid="6873fef3-2000-44ff-81fa-f1a1aa0797a7" version="1.31.0.0325">
<icon>CCleaner.ico</icon>
<name>CCleaner</name>
<vendor url="http://www.ccleaner.com/">Piriform Ltd.</vendor>
<description>CCleaner is a freeware system optimization and privacy tool. It removes unused files from your system - allowing Windows to run faster and freeing up valuable hard disk space. It also cleans traces of your online activities such as your Internet history.</description>
<options>
<upgrade appData="add" deviceExec="add" />
<minFreeSpace>2.0</minFreeSpace>
</options>
</application>
<actions>
<hostConfigure cmd="%U3_DEVICE_EXEC_PATH%\..\..\0f90f88c-5e05-4cab-8c3a-e1c0112b06fd\Exec\U3Helper.exe">config</hostConfigure>
<appStart workingdir="%U3_APP_DATA_PATH%" cmd="%U3_HOST_EXEC_PATH%\ccleaner.exe"></appStart>
<appStop cmd="%U3_HOST_EXEC_PATH%\U3Helper.exe">appstop</appStop>
<hostCleanUp cmd="%U3_HOST_EXEC_PATH%\U3Helper.exe">unconfig</hostCleanUp>
</actions>
</u3manifest>