@echo off&set FileName=%~n0&shift :: ============================================= :: AutoHelp PlugLab Concept: 2006 by Reatogo :: ============================================= :: Help Info: :: ======================= set Routine_Type=3 :: 1=Getting Data 2=Prompts 3=Getting Files 4=Creating Files 5=General set Routine_Vers=1 set Routine_Date=2007-02-15 set RoutineName=UpxFiles set RoutineAuthor=Siegfried set Using_work_from= set Example_call_1=%%UpxFiles%% set Example_call_2=%%UpxFiles%% "ask" set Example_call_3= set text_01=Upx the files in "Files". set text_02=. set text_03=User prompt yes/no if param 1 is "ask" set text_04=. set text_05=NOTE: Most files can be UPXed without loosing their functionality. set text_06=But you have to test the plugin. Just test, whether after UPXing, the program does everything on CD that it is supposed to. set text_07=If it doesn΄t: don΄t use UPX. set text_08=. set text_09=Userprompt: UPX takes normally quite a while. So unless the plugin only has few files and you find that UPX is done fairly quick, you should give the user the choice to skip UPX. set text_10=. if "%~1" == "GetHelp" goto :EOF echo.&echo %* :: ============================================= %FINDAPP% "upx.exe" if exist "%SharedAPPs%\upx.exe" (set UPXapp=%SharedAPPs%\upx.exe) else goto :EOF if "%~1" == "" goto StartUPX call :UPXdialog if "%BTN%" == "cancel" goto :EOF :StartUPX set tempName=%Prog_Name_In_Header% SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION if exist *.exe call :PromptMessage_UPX "Processing *.EXE in main folder" if exist *.exe %UPXapp% --best --compress-icons=0 *.exe if exist *.dll call :PromptMessage_UPX "Processing *.DLL in main folder" if exist *.dll %UPXapp% --best --compress-icons=0 *.dll dir /B /O:N >> "%temp%\tempFolder.txt" for /f "tokens=1-2 delims=." %%i in (%temp%\tempFolder.txt) do ( if not "%%i" == "SCRIPTS" if not "%%i" == "PROFILES" if not "%%i" == "EXTRA" if "%%j" == "" set MainFolder=%%i&call :UPxMainFolders set MainFolder= ) del "%temp%\tempFolder.txt" ENDLOCAL cls goto :EOF :: ============================================= :UPxMainFolders :: ====================== pushd "!MainFolder!" if exist *.exe call :PromptMessage_UPX "Processing *.EXE in !MainFolder!" if exist *.exe %UPXapp% --best --compress-icons=0 *.exe if exist *.dll call :PromptMessage_UPX "Processing *.DLL in !MainFolder!" if exist *.dll %UPXapp% --best --compress-icons=0 *.dll dir /B /O:N >> %temp%\tempFolder-1.txt for /f "tokens=1-2 delims=." %%i in (%temp%\tempFolder-1.txt) do ( if "%%j" == "" ( set FOLDER=%%i call :UPxFOLDER set FOLDER= ) ) if exist "%temp%\tempFolder-1.txt" del "%temp%\tempFolder-1.txt" popd goto :EOF :UPxFOLDER :: ====================== pushd "!Folder!" if exist *.exe call :PromptMessage_UPX "Processing *.EXE in subfolder !Folder!" if exist *.exe %UPXapp% --best --compress-icons=0 *.exe if exist *.dll call :PromptMessage_UPX "Processing *.DLL in subfolder !Folder!" if exist *.dll %UPXapp% --best --compress-icons=0 *.dll dir /B /O:N >> "%temp%\tempFolder-2.txt" for /f "tokens=1-2 delims=." %%i in (%temp%\tempFolder-2.txt) do ( if "%%j" == "" ( set subFOLDER=%%i call :UPxsubFOLDER set subFOLDER= ) ) if exist "%temp%\tempFolder-2.txt" del "%temp%\tempFolder-2.txt" popd goto :EOF :UPxsubFOLDER :: ====================== if exist *.exe call :PromptMessage_UPX "Processing *.EXE in subfolder !subFOLDER!" if exist *.exe %UPXapp% --best --compress-icons=0 *.exe if exist *.dll call :PromptMessage_UPX "Processing *.DLL in subfolder !subFOLDER!" if exist *.dll %UPXapp% --best --compress-icons=0 *.dll goto :EOF :: ============================================= :UPXdialog :: ====================== %MessageBox% "quest" "UPX The Files" "UPX-Compress files to save space on CD ? ~~The process takes a while. ~~Do not interrupt once started ..." cls echo. ECHO ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» ECHO Ί Ί ECHO Ί Compressing Files (upx) to save space on CD Ί ECHO Ί Ί ECHO Ί Takes a while, do not interrupt... Ί ECHO Ί Ί ECHO ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ echo. goto :EOF :: ====================== :PromptMessage_UPX :: ====================== set PromptMsg=Processing ... if not "%~1" == "" set PromptMsg=%~1 set PlugNameMsg=%tempName% if "%tempName%" == "" set PlugNameMsg=The Current Plugin echo. ECHO ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ» ECHO Ί UPX: %PlugNameMsg% ECHO Ί %PromptMsg% ECHO ΘΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΌ echo. set PromptMsg= goto :EOF :: ======================