diff --git a/.gitignore b/.gitignore index e6ad413..d2ba2cd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,11 +10,11 @@ /*.pyc -/Data/** +/bin/** -/Other/Source/PortableApps.comInstaller* -/App/AppInfo/Launcher/Debug.nsh -/App/AppInfo/Launcher/Custom.nsh +/etc/source/PortableApps.comInstaller* +/App/AppInfo/Debug.nsh +/App/AppInfo/ExtendedWrapper.nsh # generated by sphinx from Other/Source/Manual /App/Manual/** diff --git a/Other/Source/CheckForPlatformSplashDisable.nsh b/Other/Source/CheckForPlatformSplashDisable.nsh deleted file mode 100644 index 788c647..0000000 --- a/Other/Source/CheckForPlatformSplashDisable.nsh +++ /dev/null @@ -1,51 +0,0 @@ -; CheckForPlatformSplashDisable 1.0 (2010-06-16) -; -; Checks if the platform wants the splash screen disabled -; Copyright 2008-2010 John T. Haller of PortableApps.com -; Released under the GPL -; -; Usage: ${CheckForPlatformSplashDisable} _v -; -; Example: ${CheckForPlatformSplashDisable} $DISABLESPLASHSCREEN -; If the platform wants it disabled, $DISABLESPLASHSCREEN will be true. -; Otherwise it will be whatever its previous value was - -!macro CheckForPlatformSplashDisable _v - StrCmp ${_v} true _CFPSDEnd - ;Get the parameter and sort out the stack - Push $0 - Push $1 - Push $R0 - - StrCpy $0 ${_v} - - ;Read from the INI - ReadEnvStr $1 PortableApps.comDisableSplash - StrCmp $1 true "" _CFPSDStackEnd - - ${GetParent} $EXEDIR $1 - IfFileExists $1\PortableApps.com\PortableAppsPlatform.exe "" _CFPSDStackEnd - - MoreInfo::GetProductName `$1\PortableApps.com\PortableAppsPlatform.exe` - Pop $R0 - StrCmp $R0 "PortableApps.com Platform" "" _CFPSDStackEnd - - MoreInfo::GetCompanyName `$1\PortableApps.com\PortableAppsPlatform.exe` - Pop $R0 - StrCmp $R0 PortableApps.com "" _CFPSDStackEnd - - FindProc $R0 PortableAppsPlatform.exe - IntCmp $R0 1 "" _CFPSDStackEnd _CFPSDStackEnd - - StrCpy $0 true - - _CFPSDStackEnd: - ; Restore the stack and sort everything out - Pop $R0 - Pop $1 - Exch $0 - Pop ${_v} - - _CFPSDEnd: -!macroend -!define CheckForPlatformSplashDisable '!insertmacro CheckForPlatformSplashDisable' diff --git a/Other/Source/CompilerWizard.nsi b/Other/Source/CompilerWizard.nsi deleted file mode 100644 index 65e4cb5..0000000 --- a/Other/Source/CompilerWizard.nsi +++ /dev/null @@ -1,366 +0,0 @@ -/** - * PortableApps Compiler developed by Devin "demon.devin" Gaul - * For support, visit the GitHub project page: - * https://github.com/demondevin/pac-man - * - */ - -;=== For NSIS3 -Unicode true -;ManifestDPIAware true - -!define CustomIconAndName - -;=== Require at least Unicode NSIS 2.46 -!include RequireLatestNSIS.nsh - -;=== Program Details -Name "PortableApps Compiler" -OutFile ..\..\PortableAppsCompiler.exe -Icon ..\..\App\AppInfo\appicon.ico -Caption "PortableApps Compiler" -VIProductVersion 3.0.0.0 -VIAddVersionKey ProductName "PortableApps Compiler" -VIAddVersionKey Comments "A compiler for custom-built, portable applications based on PortableApps.com Launcher provided by PortableApps.com" -VIAddVersionKey CompanyName "How Dumb, LLC" -VIAddVersionKey LegalCopyright "Copyleft demon.devin" -VIAddVersionKey FileDescription "PortableApps Compiler" -VIAddVersionKey FileVersion 3.0.0.0 -VIAddVersionKey ProductVersion 3.0.0.0 -VIAddVersionKey InternalName "PortableApps Compiler" -VIAddVersionKey LegalTrademarks "PortableApps.com is a Trademark of Rare Ideas, LLC." -VIAddVersionKey OriginalFilename PortableAppsCompiler.exe - -;=== Runtime Switches -RequestExecutionLevel user - -; Best Compression -SetCompress Auto -SetCompressor /SOLID lzma -SetCompressorDictSize 32 -SetDatablockOptimize On - -;=== Include -;(Standard) -!include FileFunc.nsh -!include LogicLib.nsh -!include MUI.nsh - -;(NSIS Plugins) -!include NewTextReplace.nsh -!AddPluginDir Plugins - -;(Custom) -!include ReplaceInFileWithTextReplace.nsh - -;=== Icon & Stye === -!define MUI_ICON "..\..\App\AppInfo\appicon.ico" -!define MUI_HEADERIMAGE -!define MUI_HEADERIMAGE_RIGHT -!define MUI_HEADERIMAGE_BITMAP header.bmp - -BrandingText "PortableApps Compiler - Port And Let Portable!" -InstallButtonText "Go >" -ShowInstDetails show -SubCaption 3 " | Compiling Portable Launcher" - - -;=== Variables -Var FINISHTEXT -Var FINISHTITLE -Var NSIS -Var PACKAGE -Var SKIPWELCOMEPAGE -Var AUTOMATICCOMPILE -Var ERROROCCURED -Var AppID -Var Name - -;=== Pages -!define MUI_WELCOMEFINISHPAGE_BITMAP welcomefinish.bmp -!define MUI_WELCOMEPAGE_TITLE "PortableApps Compiler" -!define MUI_WELCOMEPAGE_TEXT "Welcome to the PortableApps Compiler.\r\n\r\nThis utility is based on the PortableApps.com Launcher Generator. This advanced compiler allows you to create a portable launcher for an application in the PortableApps.com Format specifications. Click next to start the compiling process." -!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowWelcomeWindow -!insertmacro MUI_PAGE_WELCOME -Page custom ShowOptionsWindow LeaveOptionsWindow " | Portable App Folder Selection" -Page instfiles -!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowFinishPage -!define MUI_FINISHPAGE_TITLE "$FINISHTITLE" -!define MUI_FINISHPAGE_TEXT "$FINISHTEXT" -!define MUI_FINISHPAGE_RUN -!define MUI_FINISHPAGE_RUN_NOTCHECKED -!define MUI_FINISHPAGE_RUN_TEXT "Test Launcher" -!define MUI_FINISHPAGE_RUN_FUNCTION "RunOnFinish" -!define MUI_FINISHPAGE_SHOWREADME "$EXEDIR\Data\PortableAppsCompilerLog.txt" -!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED -!define MUI_FINISHPAGE_SHOWREADME_TEXT "View log file" -!insertmacro MUI_PAGE_FINISH - -;=== Languages -;!insertmacro MUI_LANGUAGE "English" - -Function .onInit - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "CompilerWizardForm.ini" - SetOutPath $EXEDIR - - CreateDirectory $EXEDIR\Data - - ReadINIStr $SKIPWELCOMEPAGE $EXEDIR\Data\settings.ini CompilerWizard SkipWelcomePage - ReadINIStr $0 $EXEDIR\Data\settings.ini CompilerWizard Drive - ReadINIStr $PACKAGE $EXEDIR\Data\settings.ini CompilerWizard Package - ; Update drive letter; doesn't matter if $0 == "" - StrLen $1 $0 - StrCpy $2 $PACKAGE $1 - ${If} $2 == $0 - StrCpy $PACKAGE $PACKAGE "" $1 - StrCpy $PACKAGE $0$PACKAGE - ${EndIf} - - ;StrCpy $NSIS "$EXEDIR\App\NSIS\makensis.exe" - ReadINIStr $NSIS $EXEDIR\Data\settings.ini CompilerWizard makensis - ${If} $NSIS == "" - StrCpy $NSIS ..\NSISPortable\App\NSIS\makensis.exe - WriteINIStr $EXEDIR\Data\settings.ini CompilerWizard makensis $NSIS - ${EndIf} - - ${GetParameters} $R0 - StrCmp $R0 "" PreFillForm - StrCpy $PACKAGE $R0 - StrCpy $SKIPWELCOMEPAGE "true" - StrCpy $AUTOMATICCOMPILE "true" - ;Strip quotes from $PACKAGE - StrCpy $R0 $PACKAGE 1 - StrCmp $R0 `"` "" PreFillForm - StrCpy $PACKAGE $PACKAGE "" 1 - StrCpy $PACKAGE $PACKAGE -1 - - PreFillForm: - ;=== Pre-Fill Path with Directory - WriteINIStr $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" "$PACKAGE" -FunctionEnd - -Function ShowWelcomeWindow - StrCmp $SKIPWELCOMEPAGE "true" "" ShowWelcomeWindowEnd - Abort - ShowWelcomeWindowEnd: -FunctionEnd - -Function ShowOptionsWindow - !insertmacro MUI_HEADER_TEXT "PortableApps Compiler" "a better alternative to PA.c Launcher" - ${IfThen} $AUTOMATICCOMPILE == "true" ${|} Abort ${|} - InstallOptions::InitDialog /NOUNLOAD "$PLUGINSDIR\CompilerWizardForm.ini" - Pop $0 - InstallOptions::Show -FunctionEnd - -Function LeaveOptionsWindow - ReadINIStr $PACKAGE $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" - - ${If} $PACKAGE == "" - MessageBox MB_OK|MB_ICONEXCLAMATION `Please select a valid portable app's base directory to create a launcher for.` - Abort - ${EndIf} - ${GetRoot} $EXEDIR $0 - WriteINIStr $EXEDIR\Data\settings.ini CompilerWizard Drive $0 - WriteINIStr $EXEDIR\Data\settings.ini CompilerWizard Package $PACKAGE -FunctionEnd - -!define WriteErrorToLog "!insertmacro WriteErrorToLog" - -!macro WriteErrorToLog ErrorToWrite - FileOpen $9 "$EXEDIR\Data\PortableAppsCompilerLog.txt" a - FileSeek $9 0 END - FileWrite $9 `ERROR: ${ErrorToWrite}` - FileWriteByte $9 "13" - FileWriteByte $9 "10" - FileClose $9 - StrCpy $ERROROCCURED "true" -!macroend - -!macro UpdatePath Source Target - ${If} ${FileExists} "$PACKAGE\${Source}" - DetailPrint "${Source} -> ${Target}" - SetDetailsPrint none - Rename "$PACKAGE\${Source}" "$PACKAGE\${Target}" - SetDetailsPrint lastused - ${EndIf} -!macroend - -Function UpdateLanguageEnvironmentVariables - Pop $9 # file - - FileOpen $8 $9 r - FileReadWord $8 $7 - FileClose $8 - - SetDetailsPrint none - ${If} $7 = 0xFEFF - ${ReplaceInFileUTF16LE} $9 PortableApps.comLanguageCode PAL:LanguageCode - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode2 PAL:LanguageCode2 - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode3 PAL:LanguageCode3 - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleGlibc PAL:LanguageGlibc - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleWinName PAL:LanguageNSIS - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleName PAL:LanguageName - ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleID PAL:LanguageLCID - ${Else} - ${ReplaceInFile} $9 PortableApps.comLanguageCode PAL:LanguageCode - ${ReplaceInFile} $9 PortableApps.comLocaleCode2 PAL:LanguageCode2 - ${ReplaceInFile} $9 PortableApps.comLocaleCode3 PAL:LanguageCode3 - ${ReplaceInFile} $9 PortableApps.comLocaleGlibc PAL:LanguageGlibc - ${ReplaceInFile} $9 PortableApps.comLocaleWinName PAL:LanguageNSIS - ${ReplaceInFile} $9 PortableApps.comLocaleName PAL:LanguageName - ${ReplaceInFile} $9 PortableApps.comLocaleID PAL:LanguageLCID - ${EndIf} - SetDetailsPrint lastused -FunctionEnd - -Section Main - ${IfNot} ${FileExists} $NSIS - StrCpy $ERROROCCURED true - ${WriteErrorToLog} "NSIS not found at $NSIS." - MessageBox MB_ICONSTOP "NSIS was not found! (Looked for it in $NSIS)$\r$\n$\r$\nYou can specify a custom path to makensis.exe in $EXEDIR\Data\settings.ini, [CompilerWizard]:makensis" - Abort - ${EndIf} - - ; Fix the package path, if necessary - StrCpy $R1 $PACKAGE 1 -1 - ${IfThen} $R1 == "\" ${|} StrCpy $PACKAGE $PACKAGE -1 ${|} - - SetDetailsPrint ListOnly - DetailPrint "App: $PACKAGE" - DetailPrint " " - RealProgress::SetProgress /NOUNLOAD 0 - RealProgress::GradualProgress /NOUNLOAD 1 20 90 "Processing complete." - - ; Check if any upgrade needs to be done from 2.0 to 2.1 - ; ${If} ${FileExists} $PACKAGE\Other\Source\PortableApps.comLauncherCustom.nsh - ; ${OrIf} ${FileExists} $PACKAGE\Other\Source\PortableApps.comLauncherDebug.nsh - ; DetailPrint "Upgrading from 2.0 to 2.1..." - ; !insertmacro UpdatePath Other\Source\PortableApps.comLauncherCustom.nsh App\AppInfo\Launcher\Custom.nsh - ; !insertmacro UpdatePath Other\Source\PortableApps.comLauncherDebug.nsh App\AppInfo\Launcher\Debug.nsh - - ;Replace ${ReadUserOverrideConfig} with ${ReadUserConfig} - ;Check if it's UTF-16LE - ; FileOpen $0 $PACKAGE\App\AppInfo\Launcher\Custom.nsh r - ; FileReadWord $0 $1 - ; FileClose $0 - ;Avoid ${...} being taken amiss - ; StrCpy $0 $${ReadUser - ; ${If} $1 = 0xFEFF - ; ${If} $5 == UTF-16LE - ; ${ReplaceInFileUTF16LECS} $PACKAGE\App\AppInfo\Launcher\Custom.nsh $0OverrideConfig} $0Config} - ; ${Else} - ; ${ReplaceInFileCS} $PACKAGE\App\AppInfo\Launcher\Custom.nsh $0OverrideConfig} $0Config} - ; ${EndIf} - ; ${EndIf} - ; DetailPrint " " - ; ${EndIf} - - ; Check if any upgrade needs to be done from 2.1 - ; DetailPrint "Upgrading from 2.1 if needed..." - ; Replace the PortableApps.com language environment variables with their PAL counterparts - ;Push $PACKAGE\App\AppInfo\Launcher\Custom.nsh - ;Call UpdateLanguageEnvironmentVariables - ;FindFirst $0 $1 $PACKAGE\App\AppInfo\Launcher\*.ini - ;${DoUntil} $1 == "" - ; Push $PACKAGE\App\AppInfo\Launcher\$1 - ; Call UpdateLanguageEnvironmentVariables - ; FindNext $0 $1 - ;${Loop} - ;FindClose $0 - ;DetailPrint " " - - - DetailPrint "Compiling portable launcher..." - SetDetailsPrint none - - Delete "$EXEDIR\Data\PortableAppsCompilerLog.txt" - - !ifdef CustomIconAndName - !define _ $PACKAGE - !else - !define _ $EXEDIR - !endif - ${IfNot} ${FileExists} "${_}\App\AppInfo\appinfo.ini" - StrCpy $ERROROCCURED true - ${WriteErrorToLog} "${_}\App\AppInfo\appinfo.ini doesn't exist!" - ${Else} - ClearErrors - ReadINIStr $Name "${_}\App\AppInfo\appinfo.ini" Details Name - ReadINIStr $AppID "${_}\App\AppInfo\appinfo.ini" Details AppID - ReadINIStr $1 "$EXEDIR\App\AppInfo\appinfo.ini" Version PackageVersion - - ${If} ${Errors} - StrCpy $ERROROCCURED true - ${WriteErrorToLog} "[Details]:Name [Details]:AppID or [Version]:PackageVersion not found in appinfo.ini files" - ${Else} - ;Delete existing installer if there is one - Delete "$PACKAGE\$AppID.exe" - ${If} ${FileExists} "$PACKAGE\$AppID.exe" - StrCpy $ERROROCCURED true - ${WriteErrorToLog} "Unable to delete $PACKAGE\$AppID.exe, is it running?" - ${EndIf} - ${EndIf} - ${EndIf} - - ${If} ${FileExists} "${_}\App\AppInfo\Launcher\$AppID.ini" - ; If not, never mind. It'll complain when the user tries to run it if they haven't created it yet. - - StrCpy $2 "" - ; See if we need to enable XML - ReadINIStr $3 "${_}\App\AppInfo\Launcher\$AppID.ini" Activate XML - ${If} $3 == true - StrCpy $2 "$2 /DXML_ENABLED" - ${EndIf} - - ; See if we need to use the RequestExecutionLevel admin - ReadINIStr $3 "${_}\App\AppInfo\Launcher\$AppID.ini" Launch RunAsAdmin - ${If} $3 == compile-force - StrCpy $2 "$2 /DRUNASADMIN_COMPILEFORCE" - ${EndIf} - ${EndIf} - - ${If} $ERROROCCURED != true - ; Build the thing - ExecDos::exec `"$NSIS" /O"$EXEDIR\Data\PortableAppsCompilerLog.txt" /DPACKAGE="$PACKAGE" /DNamePortable="$Name" /DAppID="$AppID" /DVersion="$1"$2 "$EXEDIR\Other\Source\PortableAppsCompiler.nsi"` "" "" - Pop $R1 - ${If} $R1 <> 0 - StrCpy $ERROROCCURED true - ${WriteErrorToLog} "MakeNSIS exited with status code $R1" - ${EndIf} - ${EndIf} - - SetDetailsPrint ListOnly - - DetailPrint " " - DetailPrint "Processing complete." - ${If} ${FileExists} $PACKAGE\$AppID.exe - StrCpy $FINISHTITLE "Launcher Created" - StrCpy $FINISHTEXT "The launcher has been created. Launcher location:\r\n$PACKAGE\r\n\r\nLauncher name:\r\n$AppID.exe" - ${Else} - StrCpy $FINISHTITLE "An Error Occurred" - StrCpy $FINISHTEXT "The launcher was not created. You can view the log file for more information." - StrCpy $ERROROCCURED true - ${EndIf} -SectionEnd - -Function ShowFinishPage - ${If} $AUTOMATICCOMPILE == "true" - ${AndIf} $ERROROCCURED != true - Abort - ${Else} - ${If} $ERROROCCURED == true - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Flags" "DISABLED" - !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" "1" - ${EndIf} - ${EndIf} -FunctionEnd - -Function RunOnFinish - Exec $PACKAGE\$AppID.exe -FunctionEnd - -Function .onGUIEnd - RealProgress::Unload -FunctionEnd - diff --git a/Other/Source/Debug.nsh b/Other/Source/Debug.nsh deleted file mode 100644 index d09dc66..0000000 --- a/Other/Source/Debug.nsh +++ /dev/null @@ -1,87 +0,0 @@ -; Macro: check if in debug mode for the current section {{{1 -!macro !getdebug - !ifdef DEBUG - !undef DEBUG - !endif - !ifdef DEBUG_ALL - !define DEBUG - !else - !ifdef Segment - !ifdef DEBUG_SEGMENT_${Segment} - !define DEBUG - !endif - !else ifdef DEBUG_GLOBAL - !define DEBUG - !endif - !endif -!macroend -!define !getdebug "!insertmacro !getdebug" - -; Macro: print a debug message {{{1 -!macro DebugMsg _MSG - ${!getdebug} - !ifdef DEBUG - - ; Logging to file {{{2 - !ifndef DEBUG_OUTPUT - !define _DebugMsg_OK - !else if ${DEBUG_OUTPUT} == file - !define _DebugMsg_OK - !endif - !ifdef _DebugMsg_OK - !ifdef Segment - !define _DebugMsg_Seg "${Segment}/${__FUNCTION__}" - !else - !define _DebugMsg_Seg "Global" - !endif - !ifndef _DebugMsg_FileOpened - Var /GLOBAL _DebugMsg_File - FileOpen $_DebugMsg_File $EXEDIR\Data\debug.log w - FileWrite $_DebugMsg_File "PortableApps Compiler ${Version} debug messages for ${NamePortable} (${AppID})$\r$\n" - ; TODO: hg revision number from .hg/branch, branchheads.cache - ; My ${!ifexist} doesn't work in Wine, not sure if I can fix it - !define _DebugMsg_FileOpened - !else - FileOpen $_DebugMsg_File $EXEDIR\Data\debug.log a - FileSeek $_DebugMsg_File 0 END - !endif - FileWrite $_DebugMsg_File "${_DebugMsg_Seg} (line ${__LINE__}): ${_MSG}$\r$\n$\r$\n" - FileClose $_DebugMsg_File - !undef _DebugMsg_Seg - !undef _DebugMsg_OK - !endif ;}}} - - ; Logging to display: message box {{{2 - !ifndef DEBUG_OUTPUT - !define _DebugMsg_OK - !else if ${DEBUG_OUTPUT} == messagebox - !define _DebugMsg_OK - !endif - !ifdef _DebugMsg_OK - !ifdef Segment - !define _DebugMsg_Seg "$\r$\n$\r$\nSegment: ${Segment}$\r$\nHook: ${__FUNCTION__}" - !else - !define _DebugMsg_Seg "" - !endif - MessageBox MB_OKCANCEL|MB_ICONINFORMATION "Debug message at line ${__LINE__}${_DebugMsg_Seg}$\r$\n____________________$\r$\n$\r$\n${_MSG}" IDOK +2 - Abort - !undef _DebugMsg_Seg - !undef _DebugMsg_OK - !endif ;}}} - !endif -!macroend -!define DebugMsg "!insertmacro DebugMsg" ; }}} - -; If you want to debug this, create Debug.nsh in the package's -; App\AppInfo\Launcher directory. It should then have lines like these: -; · Debug everything -; !define DEBUG_ALL -; · This leaves out the "about to execute segment" and "finished executing -; segment" messages unless you put this line in: -; !define DEBUG_SEGWRAP -; · Debug just certain portions -; · Debug outside any segments -; !define DEBUG_GLOBAL -; · Debug a given segment or segments -; !define DEBUG_SEGMENT_[SegmentName] -!include /NONFATAL "${PACKAGE}\App\AppInfo\Launcher\Debug.nsh" diff --git a/Other/Source/Defines.nsh b/Other/Source/Defines.nsh deleted file mode 100644 index 3d053c7..0000000 --- a/Other/Source/Defines.nsh +++ /dev/null @@ -1,448 +0,0 @@ -;=# -; -; Defines.nsh -; -; This file gathers all the necessary settings definitions for runtime. -; -!define APPINFOINI `${PACKAGE}\App\AppInfo\appinfo.ini` -!define CUSTOM `${PACKAGE}\App\AppInfo\Launcher\custom.nsh` -!define LAUNCHERINI `${PACKAGE}\App\AppInfo\Launcher\${AppID}.ini` - -${!ECHO} "${NEWLINE}Retrieving information from files in the AppInfo directory...${NEWLINE}${NEWLINE}" - -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `ProgramExecutable64=` APPEXE64 -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Registry=` REGISTRY -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Java=` JAVA -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `JDK=` JDK -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `XML=` XML_PLUGIN -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Services=` SERVICES -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `RegDLLs=` REGISTERDLL -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Ghostscript=` GHOSTSCRIPT -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `RunAsAdmin=` UAC -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `ExecAsUser=` ExecAsUser -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `RegRedirection=` DISABLEFSR -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Redirection=` SYSTEMWIDE_DISABLEREDIR -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `ForceRedirection=` FORCE_SYSTEMWIDE_DISABLEREDIR -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `Tasks=` TaskCleanUp -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `RegCopyKeys=` RegCopy -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `FileCleanup=` FileCleanup -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `DirectoryCleanup=` DirectoryCleanup -!searchparse /ignorecase /noerrors /file "${LAUNCHERINI}" `FontsFolder=` FONTS_ENABLE - -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `AppID=` APPNAME -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `Name=` PORTABLEAPPNAME -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `CertSigning=` Certificate -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `UsesDotNetVersion=` dotNET_Version -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `ElevatedPrivileges=` Elevate -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `FileWriteReplace=` REPLACE -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `RegistryValueWrite=` RegValueWrite -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `UseStdUtils=` StdUtils -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `InstallINF=` INF_Install -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `FileLocking=` FileLocking -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `Junctions=` NTFS -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `ACLRegSupport=` ACL -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `ACLDirSupport=` ACL_DIR -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `RMEmptyDir=` RMEMPTYDIRECTORIES -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `LocalLow=` LocalLow -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `PublicDoc=` PublicDoc -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `CompareVersions=` CompareVersions -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `ConfigFunctions=` ConFunc -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `CloseWindow=` CloseWindow -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `JSONSupport=` JSON -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `RestartSleep=` SleepValue -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `WinMessages=` WinMessages -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `LineWrite=` LineWrite -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `TrimString=` TrimString -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `CloseProcess=` CloseProc -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `Include64=` Include64 -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `IncludeWordRep=` IncludeWordRep -!searchparse /ignorecase /noerrors /file "${APPINFOINI}" `GetBetween=` GetBetween - -!searchreplace APP "${APPNAME}" "Portable" "" -!searchreplace FULLNAME "${PORTABLEAPPNAME}" " Portable" "" -!define APPDIR `$EXEDIR\App\${APP}` -!if ! "${APPEXE64}" == "" - !searchreplace APP64 "${APPNAME}" "Portable" "64" -!else - !ifdef APPEXE64 - !undef APPEXE64 - !endif -!endif -!ifdef APP64 - !define APPDIR64 `$EXEDIR\App\${APP64}` -!endif -!if "${Certificate}" == true - !define /REDEF Certificate -!else - !ifdef Certificate - !undef Certificate - !endif -!endif -!if "${REGISTRY}" == true - !define /REDEF REGISTRY - !ifdef APP64 - !if ${DISABLEFSR} == true - !define /REDEF DISABLEFSR ;= Disable Registry redirection for x64 machines. - !endif - !endif -!else - !ifdef REGISTRY - !undef REGISTRY - !endif -!endif -!ifdef dotNET_Version - !if ! ${dotNET_Version} == "" - !define DOTNET - !include DotNetVer.nsh - !else - !error "The key 'UsesDotNetVersion' in AppInfo.ini is set but has no value! If this PAF does not require the .NET Framework please omit this key entirely." - !endif -!else - !ifdef dotNET_Version - !undef dotNET_Version - !endif -!endif -!if "${JAVA}" == "find" - !define /REDEF JAVA -!else if "${JAVA}" == "require" - !define /REDEF JAVA -!else - !ifdef JAVA - !undef JAVA - !endif -!endif -!if "${JDK}" == "find" - !define /REDEF JDK -!else if "${JDK}" == "require" - !define /REDEF JDK -!else - !ifdef JDK - !undef JDK - !endif -!endif -!if "${XML_PLUGIN}" == true - !define /REDEF XML_PLUGIN - !include XML.nsh -!else - !ifdef XML_PLUGIN - !undef XML_PLUGIN - !endif -!endif -!if "${GHOSTSCRIPT}" == "find" - !define /REDEF GHOSTSCRIPT -!else if "${GHOSTSCRIPT}" == "require" - !define /REDEF GHOSTSCRIPT -!else - !ifdef GHOSTSCRIPT - !undef GHOSTSCRIPT - !endif -!endif -!if ! ${TrimString} == "" - !if ${TrimString} == true - !define /REDEF TrimString - !else if ${TrimString} == false - !undef TrimString - !endif -!else - !error "The key 'TrimString' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${CloseProc} == "" - !if ${CloseProc} == true - !define /REDEF CloseProc - !else if ${CloseProc} == false - !undef CloseProc - !endif -!else - !error "The key 'CloseProcess' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if "${UAC}" == "force" - !define /REDEF UAC - !ifndef TrimString - !define TrimString - !endif -!else if "${UAC}" == "compile-force" - !define /REDEF UAC - !ifndef TrimString - !define TrimString - !endif -!else if "${UAC}" == "try" - !define /REDEF UAC - !ifndef TrimString - !define TrimString - !endif - !include UAC.nsh -!else if "${Elevate}" == "auto" - !define /REDEF UAC - !ifndef TrimString - !define TrimString - !endif -!else - !ifdef UAC - !undef UAC - !endif -!endif -!if ${SERVICES} == true - !define /REDEF SERVICES ;= Enable support for Services -!else - !ifdef SERVICES - !undef SERVICES - !endif -!endif -!if ${REGISTERDLL} == true - !define /REDEF REGISTERDLL ;= Enable support for registering library (DLLs) files -!else - !ifdef REGISTERDLL - !undef REGISTERDLL - !endif -!endif -!if ! ${SleepValue} == "" - !define Sleep ${SleepValue} ;= Specify a number (milliseconds) to set a Sleep value for applications that need to restart. -!else - !error "The key 'RestartSleep' in AppInfo.ini needs a value that's an integer!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${LineWrite} == "" - !if ${LineWrite} == true ;= include LineWrite.nsh - !define Include_LineWrite - !else if ${LineWrite} == false - !undef LineWrite - !endif -!else - !error "The key 'LineWrite' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${WinMessages} == "" - !if ${WinMessages} == true ;= include WinMessages.nsh - !define Include_WinMessages - !else if ${WinMessages} == false - !undef WinMessages - !endif -!else - !error "The key 'WinMessages' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${GetBetween} == "" - !if ${GetBetween} == true ;= include GetBetween.nsh - !define GetBetween.nsh - !else if ${GetBetween} == false - !undef GetBetween - !endif -!else - !error "The key 'GetBetween' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${IncludeWordRep} == "" - !if ${IncludeWordRep} == true ;= include the WordRep(S) functions. - !define Include_WordRep - !else if ${IncludeWordRep} == false - !undef IncludeWordRep - !endif -!else - !error "The key 'IncludeWordRep' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${Include64} == "" - !if ${Include64} == true ;= include x64.nsh - !define 64.nsh - !else if ${Include64} == false - !undef Include64 - !endif -!else - !error "The key 'Include64' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${ConFunc} == "" - !if ${ConFunc} == true ;= Enable ConfigWrite(S), ConfigRead(S) Functions. - !define /REDEF ConFunc - !else if ${ConFunc} == false - !undef ConFunc - !endif -!else - !error "The key 'ConfigFunctions' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${LocalLow} == "" - !if ${LocalLow} == true ;= Enable GetLocalAppDataLow Function. - !define /REDEF LocalLow - !else if ${LocalLow} == false - !undef LocalLow - !endif -!else - !error "The key 'LocalLow' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${CompareVersions} == "" - !if ${CompareVersions} == true ;= Enable VersionCompare Function. - !define /REDEF CompareVersions - !else if ${CompareVersions} == false - !undef CompareVersions - !endif -!else - !error "The key 'CompareVersions' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${PublicDoc} == "" - !if ${PublicDoc} == true ;= Enable GetPublicDoc Function. - !define /REDEF PublicDoc - !else if ${PublicDoc} == false - !undef PublicDoc - !endif -!else - !error "The key 'PublicDoc' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${RegValueWrite} == "" - !if ${RegValueWrite} == true - !define RegSleep 50 ;= Sleep value for the [RegistryValueWrite] section. Function is inaccurate otherwise. - !else if ${RegValueWrite} == false - !undef RegValueWrite - !endif -!else - !error "The key 'RegistryValueWrite' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${REPLACE} == "" - !if ${REPLACE} == true ;= Enables Replace functionality in [FileWrite] - !define /REDEF REPLACE - !else if ${REPLACE} == false - !undef REPLACE - !endif -!else - !error "The key 'FileWriteReplace' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${RMEMPTYDIRECTORIES} == "" - !if ${RMEMPTYDIRECTORIES} == true ;= Enable RMEmptyDir Function. - !define /REDEF RMEMPTYDIRECTORIES - !else if ${RMEMPTYDIRECTORIES} == false - !undef RMEMPTYDIRECTORIES - !endif -!else - !error "The key 'RMEmptyDir' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${StdUtils} == "" - !if ${StdUtils} == true - !define /REDEF StdUtils ;= Include StndUtils without ExecAsUser - !else if ${StdUtils} == false - !undef StdUtils - !endif -!else - !error "The key 'UseStdUtils' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${ExecAsUser} == "" - !if ${ExecAsUser} == true - !define /REDEF ExecAsUser ;= For applications which need to run as normal user. - !else if ${ExecAsUser} == false - !undef ExecAsUser - !endif -!else - !error "The key 'ExecAsUser' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${INF_Install} == "" - !if ${INF_Install} == true - !define /REDEF INF_Install ;= Enable for INF installation support. - !else if ${INF_Install} == false - !undef INF_Install - !endif -!else - !error "The key 'InstallINF' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${SYSTEMWIDE_DISABLEREDIR} == "" - !if ${SYSTEMWIDE_DISABLEREDIR} == true - !define /REDEF SYSTEMWIDE_DISABLEREDIR - !else if ${SYSTEMWIDE_DISABLEREDIR} == false - !undef SYSTEMWIDE_DISABLEREDIR - !endif -!else - !error "The key 'DisableRedirection' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${FORCE_SYSTEMWIDE_DISABLEREDIR} == "" - !if ${FORCE_SYSTEMWIDE_DISABLEREDIR} == true - !define /REDEF FORCE_SYSTEMWIDE_DISABLEREDIR - !else if ${FORCE_SYSTEMWIDE_DISABLEREDIR} == false - !undef FORCE_SYSTEMWIDE_DISABLEREDIR - !endif -!else - !error "The key 'ForceDisableRedirection' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${FONTS_ENABLE} == "" - !if ${FONTS_ENABLE} == true - !define /REDEF FONTS_ENABLE ;= Enable font support in ..\Data\Fonts - !else if ${FONTS_ENABLE} == false - !undef FONTS_ENABLE - !endif -!else - !error "The key 'FontsFolder' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${JSON} == "" - !if ${JSON} == true - !define /REDEF JSON ;= Enable the Close function - !else if ${JSON} == false - !undef JSON - !endif -!else - !error "The key 'JSONSupport' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${CloseWindow} == "" - !if ${CloseWindow} == true - !define /REDEF CloseWindow ;= Enable the Close function - !else if ${CloseWindow} == false - !undef CloseWindow - !endif -!else - !error "The key 'CloseWindow' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${FileLocking} == "" - !if ${FileLocking} == true - !define IsFileLocked ;= If enabled, PortableApp will ensure DLL(s) are unlocked. - !ifndef CloseWindow - !define CloseWindow - !endif - !else if ${FileLocking} == false - !undef FileLocking ;= Disable - !endif -!else - !error "The key 'FileLocking' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${NTFS} == "" - !if ${NTFS} == true - !define /REDEF NTFS ;= Enable support for Junctions (Symlinks) - !else if ${NTFS} == false - !undef NTFS ;= Disable - !endif -!else - !error "The key 'Junctions' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${ACL} == "" - !if ${ACL} == true - !define /REDEF ACL ;= Enable AccessControl support for registry keys - !else if ${ACL} == false - !undef ACL ;= Disable AccessControl support for registry keys - !endif -!else - !error "The key 'ACLRegSupport' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${ACL_DIR} == "" - !if ${ACL_DIR} == true - !define /REDEF ACL_DIR ;= Enable AccessControl support for directories - !else if ${ACL_DIR} == false - !undef ACL_DIR ;= Disable AccessControl support for directories - !endif -!else - !error "The key 'ACLDirSupport' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${FileCleanup} == "" - !if ${FileCleanup} == true - !define /REDEF FileCleanup ;= Enable FileCleanup segment - !else if ${FileCleanup} == false - !undef FileCleanup ;= Disable FileCleanup segment - !endif -!else - !error "The key 'FileCleanup' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${DirectoryCleanup} == "" - !if ${DirectoryCleanup} == true - !define /REDEF DirectoryCleanup ;= Enable DirectoryCleanup segment - !else if ${DirectoryCleanup} == false - !undef DirectoryCleanup ;= Disable DirectoryCleanup segment - !endif -!else - !error "The key 'DirectoryCleanup' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif -!if ! ${TaskCleanup} == "" - !if ${TaskCleanup} == true - !define /REDEF TaskCleanup ;= Enable TaskCleanup segment - !else if ${TaskCleanup} == false - !undef TaskCleanup ;= Disable TaskCleanup segment - !endif -!else - !error "The key 'TaskCleanup' in AppInfo.ini needs a true/false value!${NewLine}${NewLine}If support for this isn't needed, omit this key entirely!" -!endif diff --git a/Other/Source/License.txt b/Other/Source/License.txt deleted file mode 100644 index d6a3987..0000000 --- a/Other/Source/License.txt +++ /dev/null @@ -1,344 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT -PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, -EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY -AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL -NECESSARY SERVICING, REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR -AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY -OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM -AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING -ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM -(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY -OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS -BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) 19yy - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. \ No newline at end of file diff --git a/Other/Source/Manual/_static/donation_button.png b/Other/Source/Manual/_static/donation_button.png deleted file mode 100644 index f19dea7..0000000 Binary files a/Other/Source/Manual/_static/donation_button.png and /dev/null differ diff --git a/Other/Source/Manual/_static/favicon.ico b/Other/Source/Manual/_static/favicon.ico deleted file mode 100644 index ed849b2..0000000 Binary files a/Other/Source/Manual/_static/favicon.ico and /dev/null differ diff --git a/Other/Source/Manual/_static/help_background_footer.png b/Other/Source/Manual/_static/help_background_footer.png deleted file mode 100644 index 5ebdc02..0000000 Binary files a/Other/Source/Manual/_static/help_background_footer.png and /dev/null differ diff --git a/Other/Source/Manual/_static/help_background_header.png b/Other/Source/Manual/_static/help_background_header.png deleted file mode 100644 index cf1ebf7..0000000 Binary files a/Other/Source/Manual/_static/help_background_header.png and /dev/null differ diff --git a/Other/Source/Manual/_static/help_logo_top.png b/Other/Source/Manual/_static/help_logo_top.png deleted file mode 100644 index 1a70505..0000000 Binary files a/Other/Source/Manual/_static/help_logo_top.png and /dev/null differ diff --git a/Other/Source/Readme.txt b/Other/Source/Readme.txt deleted file mode 100644 index 10402c7..0000000 --- a/Other/Source/Readme.txt +++ /dev/null @@ -1 +0,0 @@ -Please read help.html for documentation and examples. diff --git a/Other/Source/Segments/Environment.nsh b/Other/Source/Segments/Environment.nsh deleted file mode 100644 index 6236aac..0000000 --- a/Other/Source/Segments/Environment.nsh +++ /dev/null @@ -1,12 +0,0 @@ -${SegmentFile} -${SegmentInit} - !ifmacrodef Variables - !insertmacro Variables - !endif -!macroend -${SegmentPre} - ${ForEachINIPair} Environment $0 $1 - ExpandEnvStrings $1 $1 - System::Call `Kernel32::SetEnvironmentVariable(tr0,tr1)` - ${NextINIPair} -!macroend diff --git a/Other/Source/Segments/RegistryCopyKeys.nsh b/Other/Source/Segments/RegistryCopyKeys.nsh deleted file mode 100644 index fccc1e8..0000000 --- a/Other/Source/Segments/RegistryCopyKeys.nsh +++ /dev/null @@ -1,85 +0,0 @@ -!ifndef PAF - !define PAF `HKCU\Software\PortableApps` -!endif -!ifndef PAFKEYS - !define PAFKEYS `${PAF}\Keys` -!endif -${SegmentFile} -${SegmentPrePrimary} - ${If} $Registry == true - ${ForEachINIPair} RegistryCopyKeys $R0 $R1 - ${ValidateRegistryKey} $R1 - ExpandEnvStrings $R1 $R1 - ${IfNot} ${RegistryKeyExists} `${PAFKEYS}\$R1` - ${AndIf} ${RegistryKeyExists} $R1 - StrCpy $R2 $R1 4 - StrCmp $R2 HKLM 0 +2 - StrCmp $ADMIN true 0 +3 - Registry::_CopyKey /NOUNLOAD $R1 `${PAFKEYS}\$R1` - Pop $R2 - ${EndIf} - StrCmp $R0 - +11 - ExpandEnvStrings $R0 $R0 - IfFileExists `${SET}\$R0.reg` 0 +9 - IfFileExists `${REGEDIT}` 0 +5 - !ifdef DisableFSR - ExecDos::exec /TOSTACK /DISABLEFSR `"${REGEDIT}" /s "${SET}\$R0.reg"` - !else - ExecDos::exec /TOSTACK `"${REGEDIT}" /s "${SET}\$R0.reg"` - !endif - Pop $R1 - Pop $R2 - StrCmp $R1 0 +4 - !ifdef DisableFSR - ExecDos::exec /TOSTACK /DISABLEFSR `"${REGEXE}" IMPORT "${SET}\$R0.reg"` - !else - ExecDos::exec /TOSTACK `"${REGEXE}" IMPORT "${SET}\$R0.reg"` - !endif - Pop $R1 - Pop $R2 - ${NextINIPair} - ${EndIf} -!macroend -${SegmentPostPrimary} - ${If} $REGISTRY == true - ${ForEachINIPair} RegistryCopyKeys $R0 $R1 - ${ValidateRegistryKey} $R1 - ExpandEnvStrings $R1 $R1 - StrCmp $R0 - +14 - StrCmp $RunLocally true +13 - ExpandEnvStrings $R0 $R0 - Registry::_SaveKey /NOUNLOAD $R1 `${SET}\$R0.reg` "" - Pop $R2 - StrCmp $R2 0 +9 - IfFileExists `${REGEDIT}` 0 +5 - !ifdef DisableFSR - ExecDos::exec /TOSTACK /DISABLEFSR `"${REGEDIT}" /e "${SET}\$R0.reg" "$R1"` - !else - ExecDos::exec /TOSTACK `"${REGEDIT}" /e "${SET}\$R0.reg" "$R1"` - !endif - Pop $R2 - Pop $R3 - StrCmp $R2 0 +4 - !ifdef DisableFSR - ExecDos::exec /TOSTACK /DISABLEFSR `"${REGEXE}" SAVE "$R1" "${SET}\$R0.reg"` - !else - ExecDos::exec /TOSTACK `"${REGEXE}" SAVE "$R1" "${SET}\$R0.reg"` - !endif - Pop $R2 - Pop $R3 - Registry::_DeleteKey /NOUNLOAD $R1 - Pop $R2 - ${If} ${RegistryKeyExists} `${PAFKEYS}\$R1` - Registry::_MoveKey /NOUNLOAD `${PAFKEYS}\$R1` $R1 - Pop $R2 - ${Do} - ${GetParent} $R1 $R1 - Registry::_DeleteKeyEmpty /NOUNLOAD `${PAFKEYS}\$R1` - Pop $R2 - ${LoopUntil} $R1 == "" - ${EndIf} - ${NextINIPair} - Registry::_DeleteKeyEmpty /NOUNLOAD `${PAF}` - Pop $R2 - ${EndIf} -!macroend \ No newline at end of file diff --git a/Other/Source/Segments/RunBeforeAfter.nsh b/Other/Source/Segments/RunBeforeAfter.nsh deleted file mode 100644 index d697c93..0000000 --- a/Other/Source/Segments/RunBeforeAfter.nsh +++ /dev/null @@ -1,28 +0,0 @@ -${SegmentFile} - -!macro _RunBeforeAfter_Contents Time - StrCpy $R0 1 - ${Do} - ClearErrors - ${ReadLauncherConfig} $1 Launch Run${Time}$R0 - ${IfThen} ${Errors} ${|} ${ExitDo} ${|} - ${ParseLocations} $1 - - ; Safety check so paths with spaces work - StrCpy $R1 $1 1 - ${If} $R1 != '"' - MessageBox MB_ICONEXCLAMATION `[Launch]:Run${Time}$R0 doesn't have the path quoted, which is against the rules (remember to have a line like Run${Time}$R0='"$1"').` - ${EndIf} - - ExecWait $1 - IntOp $R0 $R0 + 1 - ${Loop} -!macroend - -${SegmentPreExec} - !insertmacro _RunBeforeAfter_Contents Before -!macroend - -${SegmentPostExec} - !insertmacro _RunBeforeAfter_Contents After -!macroend diff --git a/Other/Source/Segments/SplashScreen.nsh b/Other/Source/Segments/SplashScreen.nsh deleted file mode 100644 index 76c0c23..0000000 --- a/Other/Source/Segments/SplashScreen.nsh +++ /dev/null @@ -1,44 +0,0 @@ -; ${SegmentFile} - -; Var DisableSplashScreen - -; ${SegmentInit} - ; ${If} $DisableSplashScreen != true - ; ${ReadUserConfig} $DisableSplashScreen DisableSplashScreen - ; Hmm... I think we'll skip validating this. - - ; ClearErrors - ; ${ReadLauncherConfig} $0 Launch SplashTime - ; ${IfNot} ${Errors} - ; ${AndIf} $0 = 0 ; = is IntCmp, which which a string is 0 - ; ${AndIf} $0 != 0 ; ... but "0" is valid. Silly, but valid. - ; ${InvalidValueError} [Launch]:SplashTime $0 ; string, not int - ; ${EndIf} - - ; ${IfNotThen} ${FileExists} $EXEDIR\App\AppInfo\Launcher\splash.jpg ${|} StrCpy $DisableSplashScreen true ${|} - - ; ${CheckForPlatformSplashDisable} $DisableSplashScreen - - ; ${If} $DisableSplashScreen != true - ; ${IfThen} $0 = 0 ${|} StrCpy $0 1200 ${|} - ; newadvsplash::show /NOUNLOAD $0 0 0 -1 /L $EXEDIR\App\AppInfo\Launcher\splash.jpg - ; ${EndIf} - ; ${EndIf} -; !macroend - -; ${SegmentPreExecPrimary} - ; ClearErrors - ; ${ReadLauncherConfig} $DisableSplashScreen Launch LaunchAppAfterSplash - ; ${If} $DisableSplashScreen == true - ; newadvsplash::stop /WAIT - ; ${ElseIfNot} ${Errors} - ; ${AndIf} $DisableSplashScreen != false - ; ${InvalidValueError} [Launch]:LaunchAppAfterSplash $DisableSplashScreen - ; ${EndIf} -; !macroend - -; ${SegmentUnload} - ; ${If} $DisableSplashScreen != true - ; newadvsplash::stop /WAIT - ; ${EndIf} -; !macroend diff --git a/Other/Source/Segments/WorkingDirectory.nsh b/Other/Source/Segments/WorkingDirectory.nsh deleted file mode 100644 index efc661e..0000000 --- a/Other/Source/Segments/WorkingDirectory.nsh +++ /dev/null @@ -1,8 +0,0 @@ -${SegmentFile} -${SegmentPreExec} - ClearErrors - ${ReadLauncherConfig} $0 Launch WorkingDirectory - IfErrors +3 - ExpandEnvStrings $0 $0 - SetOutPath $0 -!macroend \ No newline at end of file diff --git a/Other/Source/Segments/XML.nsh b/Other/Source/Segments/XML.nsh deleted file mode 100644 index d2e31ab..0000000 --- a/Other/Source/Segments/XML.nsh +++ /dev/null @@ -1,19 +0,0 @@ -${SegmentFile} - -; For usage of XML features, see FileWrite.nsh and Language.nsh. - -; !ifdef XML_ENABLED - ; !include MyXML.nsh -; !endif - -; Used in combination with XML_ENABLED in FileWrite.nsh and Language.nsh to -; warn the user if they try to use XML features without enabling it. -!macro XML_WarnNotActivated Section - MessageBox MB_OK|MB_ICONSTOP "To use XML features of the Launcher you must set [Activate]:XML=true and then regenerate the launcher. Continuing, but ${Section} will not be used." -!macroend - -; ${SegmentUnload} -; !ifdef XML_ENABLED - ; ${xml::Unload} -; !endif -; !macroend diff --git a/Other/Source/Version.nsh b/Other/Source/Version.nsh deleted file mode 100644 index 1b7d6ea..0000000 --- a/Other/Source/Version.nsh +++ /dev/null @@ -1,8 +0,0 @@ -;=# -; -; Version.nsh -; -; This file gathers all the necessary settings definitions for runtime. -; -!define PACVER "2.0.1.0" -!define PACUSERVER "2.0.1" diff --git a/PortableAppsCompiler.exe b/PortableAppsCompiler.exe index 9ff42e5..80b4781 100644 Binary files a/PortableAppsCompiler.exe and b/PortableAppsCompiler.exe differ diff --git a/README.md b/README.md index a13559a..ab5840c 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,98 @@ # PortableApps Compiler - _Development Branch_ ---------- -This branch is meant for the cutting-edge of development. Don't expect this version to work flawlessly. There may be bugs hidden throughout this experimental version of PortableApps Compiler. With this branch you will find the code stylings of Chris Morgan, FukenGruven, Azure Zanculmarktum, and myself (demon.devin). You will also see minor influence from other contributors like LegendaryHawk, DoomStorm, and other fellow developers as well. So you can expect to see great things to come out of this experimental build. +This branch is meant for the cutting-edge of development. Don't expect this version to work flawlessly. There may be bugs hidden throughout this experimental version of PortableApps Compiler. With this branch you will find the coding practices of Chris Morgan, FukenGruven, Azure Zanculmarktum, and myself (daemon.devin). You will also see minor influence from contributors like LegendaryHawk, DoomStorm, and other fellow developers as well. So you can expect to see great things to come out of this experimental build. With all that said, enjoy the fresh ideas which are currently being worked out. ## CHANGES ---------- +##### Environment Variables - All environment variables that start with `PAL` have been changed to `PAC` - _I.E._ `%PAL:AppDir%` is now `%PAC:AppDir%` and so on.. - All environment variables that start with `PortableApps.com` have been changed to `PortableApps` - _I.E._ `%PortableApps.comDocuments%` is now `%PortableAppsDocuments%` and so on.. +##### Folder Structure +- I've changed the folder structure. To illustrate the new directory layout let's imagine we're looking at a portable version of 7-Zip which was compiled using this new design layout. + +> Example Directory Tree: +> ``` +> 7-ZipPortable (Root) +> | 7-ZipPortable.exe (Portable Launcher) +> | 7-ZipPortable.ini (User Config File) +> | +> +---app +> | +---AppInfo (Kept for Compatibility with PA.c Menu) +> | | AppIcon.ico (Needed with PA.c Menu) +> | | AppIcon_128.png ' ' ' ' ' ' +> | | AppIcon_16.png ' ' ' ' ' ' +> | | AppIcon_32.png ' ' ' ' ' ' +> | | AppInfo.ini ' ' ' ' ' ' +> | | CompilerInstaller.ini (Formally Installer.ini) +> | | CompilerWrapper.ini (Formally Launcher.ini) +> | | EULA.txt +> | | ExtendedInstaller.nsh (Formally InstallerCustom.nsh) +> | | ExtendedWrapper.nsh (Formally Custom.nsh) +> | | +> | \---DefaultSettings (Formally DefaultData) +> | | DEFAULT 7-ZIP SETTINGS HERE +> | | +> | \---Config (Formally Default Settings) +> | 7-Zip.reg +> | +> +---bin +> | +---7-Zip (32-Bit Program Files) +> | | | 7-zip.dll +> | | | 7z.dll +> | | | 7z.exe +> | | | 7zFM.exe +> | | | '' '' '' +> | | | +> | | \---Lang +> | | af.txt +> | | an.txt +> | | ar.txt +> | | '' '' +> | | +> | +---7-Zip64 (64-Bit Program Files) +> | | | 7-zip.dll +> | | | 7z.dll +> | | | 7z.exe +> | | | 7zFM.exe +> | | | '' '' '' +> | | | +> | | \---Lang +> | | af.txt +> | | an.txt +> | | ar.txt +> | | '' '' +> | | +> | \---Settings (Fromally Data) +> | | 7-ZIP SETTINGS HERE +> | | +> | \---Config (Fromally Settings) +> | 7-Zip.reg +> | 7-ZipPortableSettings.ini +> | +> \---etc +> 7-ZipPortable.ini +> README +> UNLICENSE (using Unlicense.org/ now) +> ``` + +##### PAF to PAC Conversion +- The compiler can now handle converting PAF PortableApps to the above folder layout. Everything is handled automatically so you do not need to manually set the files in the correct place. I also added support for converting FukenGruven's old PAFs as well. +- Do not expect the PA.c Installer to work out of the box for this new folder structure. Since I've renamed and moved around the applicable configuration files, PA.c Installer won't be able to locate the right files anymore and most likely won't be able to pack your portable anymore. However, I haven't tested this out yet. + ## Features ---------- The following is a list of features that is currently available with PortableApps Compiler. Everything listed here has been tested and is in working order. - Everything that is available with [PortableApps.com Launcher](https://portableapps.com/apps/development/portableapps.com_launcher) is also available with PortableApps Compiler. -- Minipulating Windows Services. +- Manipulating Windows Services. - Dealing with Windows Tasks. - Registering DLL files. - Registry redirection support. @@ -34,7 +107,7 @@ The following is a list of features that is currently available with PortableApp __Environment Variables__ -- `%PROGRAMDATA%` has now been added and kept `%ALLUSERSAPPDATA%` for backwards compatibility. Both can be used anywhere you can use an evironment variable. +- `%PROGRAMDATA%` has now been added and kept `%ALLUSERSAPPDATA%` for backwards compatibility. Both can be used anywhere you can use an environment variable. - `%PAC:CommonFiles%` may now be used within the _Launcher.ini_ configuration file. This environment variable will point to `..\PortableApps\CommonFiles` if applicable. Can be used anywhere you can use an environment variable. > Example: > ```INI @@ -240,7 +313,7 @@ GetBetween=true * __UsesGhostscript:__ Specifies whether the portable application makes use of [Ghostscript Portable][GhostscriptPortable]. -* __UsesDotNetVersion:__ Specify the minimum required version of the .NET framework the portable application needs. Values can be from `1.0` thru `4.7` (*e.g.* `UsesDotNetVersion=1.1` or `UsesDotNetVersion=4.6.2`). +* __UsesDotNetVersion:__ Specify the minimum required version of the .NET framework the portable application needs. Values can be from `1.0` through `4.7` (*e.g.* `UsesDotNetVersion=1.1` or `UsesDotNetVersion=4.6.2`). * __UseStdUtils:__ Include the _StdUtils_ plug-in without `ExecAsUser` diff --git a/etc/UNLICENSE b/etc/UNLICENSE new file mode 100644 index 0000000..00d2e13 --- /dev/null +++ b/etc/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/Other/Source/CallANSIPlugin.nsh b/etc/source/CallANSIPlugin.nsh similarity index 100% rename from Other/Source/CallANSIPlugin.nsh rename to etc/source/CallANSIPlugin.nsh diff --git a/Other/Source/CmdExec.nsh b/etc/source/CmdExec.nsh similarity index 97% rename from Other/Source/CmdExec.nsh rename to etc/source/CmdExec.nsh index ecf13d9..694f1c5 100644 --- a/Other/Source/CmdExec.nsh +++ b/etc/source/CmdExec.nsh @@ -1,46 +1,46 @@ -/*CmdExec -http://nsis.sourceforge.net/CmdExec - -Description -Macro that uses the windows default command line interpreter -(usually $sysdir\cmd.exe) to execute a command and its parameters, -with working directory, optional pause, stay-in-prompt and execwait. - -Example: -${CmdPause} `$ParentFolder` `"d:\tools\free_upx\upx.exe" -v --brute $FileNames` -*/ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Execute a command with cmd.exe -;; P1 :in: Working directory (""=$outdir) -;; P2 :in: Command and parameters -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -!define CmdNoWait "!insertmacro _CmdExec 0" ; nopause/nowait -!define CmdWait "!insertmacro _CmdExec 1" ; wait for end of execution -!define CmdPause "!insertmacro _CmdExec 2" ; pause before exiting -!define CmdPauseWait "!insertmacro _CmdExec 3" ; pause + execwait -!define CmdStay "!insertmacro _CmdExec 4" ; stay in command prompt -!define CmdStayWait "!insertmacro _CmdExec 5" ; stay + execwait -!macro _CmdExec _Mode_ _WorkDir_ _CommandAndParams_ - Push $R0 - ExpandEnvStrings $R0 '%COMSPEC%' - StrCmp "${_WorkDir_}" "" +3 - Push $OutDir - SetOutPath "${_WorkDir_}" - !if '${_Mode_}' = 1 - Exec `"$R0" /c "${_CommandAndParams_}" & echo. & echo. & pause` - !else if '${_Mode_}' = 2 - ExecWait `"$R0" /c "${_CommandAndParams_}"` - !else if '${_Mode_}' = 3 - ExecWait `"$R0" /c "${_CommandAndParams_}" & echo. & echo. & pause` - !else if '${_Mode_}' = 4 - Exec `"$R0" /k "${_CommandAndParams_}"` - !else if '${_Mode_}' = 5 - ExecWait `"$R0" /k "${_CommandAndParams_}"` - !else - Exec `"$R0" /c "${_CommandAndParams_}"` - !endif - StrCmp "${_WorkDir_}" "" +3 - Pop $R0 - SetOutPath "$R0" - Pop $R0 +/*CmdExec +http://nsis.sourceforge.net/CmdExec + +Description +Macro that uses the windows default command line interpreter +(usually $sysdir\cmd.exe) to execute a command and its parameters, +with working directory, optional pause, stay-in-prompt and execwait. + +Example: +${CmdPause} `$ParentFolder` `"d:\tools\free_upx\upx.exe" -v --brute $FileNames` +*/ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Execute a command with cmd.exe +;; P1 :in: Working directory (""=$outdir) +;; P2 :in: Command and parameters +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +!define CmdNoWait "!insertmacro _CmdExec 0" ; nopause/nowait +!define CmdWait "!insertmacro _CmdExec 1" ; wait for end of execution +!define CmdPause "!insertmacro _CmdExec 2" ; pause before exiting +!define CmdPauseWait "!insertmacro _CmdExec 3" ; pause + execwait +!define CmdStay "!insertmacro _CmdExec 4" ; stay in command prompt +!define CmdStayWait "!insertmacro _CmdExec 5" ; stay + execwait +!macro _CmdExec _Mode_ _WorkDir_ _CommandAndParams_ + Push $R0 + ExpandEnvStrings $R0 '%COMSPEC%' + StrCmp "${_WorkDir_}" "" +3 + Push $OutDir + SetOutPath "${_WorkDir_}" + !if '${_Mode_}' = 1 + Exec `"$R0" /c "${_CommandAndParams_}" & echo. & echo. & pause` + !else if '${_Mode_}' = 2 + ExecWait `"$R0" /c "${_CommandAndParams_}"` + !else if '${_Mode_}' = 3 + ExecWait `"$R0" /c "${_CommandAndParams_}" & echo. & echo. & pause` + !else if '${_Mode_}' = 4 + Exec `"$R0" /k "${_CommandAndParams_}"` + !else if '${_Mode_}' = 5 + ExecWait `"$R0" /k "${_CommandAndParams_}"` + !else + Exec `"$R0" /c "${_CommandAndParams_}"` + !endif + StrCmp "${_WorkDir_}" "" +3 + Pop $R0 + SetOutPath "$R0" + Pop $R0 !macroend \ No newline at end of file diff --git a/etc/source/CompilerWizard.nsi b/etc/source/CompilerWizard.nsi new file mode 100644 index 0000000..da5adf0 --- /dev/null +++ b/etc/source/CompilerWizard.nsi @@ -0,0 +1,972 @@ +;=# +; +; PORTABLEAPPS COMPILER +; Developed by daemon.devin +; +; For support visit the GitHub project: +; https://github.com/demondevin/pac-man +; +; CompilerWizard.nsi +; Version 1.1 +; + +;= RUNTIME SWITCHES +;= ################ +Unicode true +ManifestDPIAware true +RequestExecutionLevel user + +!define CustomIconAndName + +;= NSIS VERSION +;= ################ +!include RequireLatestNSIS.nsh + +;= PAC DETAILS +;= ################ +Name "PortableApps Compiler" +OutFile ..\..\PortableAppsCompiler.exe +Icon ..\..\app\AppInfo\appicon.ico +Caption "PortableApps Compiler" +VIProductVersion 3.0.0.0 +VIAddVersionKey ProductName "PortableApps Compiler" +VIAddVersionKey Comments "A small utility for generating a portable wrapper for an application." +VIAddVersionKey CompanyName "How Dumb, LLC" +VIAddVersionKey LegalCopyright "Copyright daemon.devin" +VIAddVersionKey FileDescription "PortableApps Compiler" +VIAddVersionKey FileVersion 3.0.0.0 +VIAddVersionKey ProductVersion 3.0.0.0 +VIAddVersionKey InternalName "PortableApps Compiler" +VIAddVersionKey OriginalFilename PortableAppsCompiler.exe + +;= COMPRESSION +;= ################ +SetCompress Auto +SetCompressor /SOLID lzma +SetCompressorDictSize 32 +SetDatablockOptimize On + +;= INCLUDES/PLUGINS +;= ################ +;(Standard) +!include FileFunc.nsh +!include LogicLib.nsh +!include MUI.nsh +;!include StrRep.nsh +!include NewTextReplace.nsh +!AddPluginDir Plugins +!include ReplaceInFileWithTextReplace.nsh + +;= ICON & STYLE +;= ################ +!define MUI_ICON "..\..\App\AppInfo\appicon.ico" +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_RIGHT +!define MUI_HEADERIMAGE_BITMAP header.bmp +BrandingText "PortableApps Compiler - Port And Let Portable!" +InstallButtonText "Go >" +ShowInstDetails show +SubCaption 3 " | Compiling Portable Wrapper" + +;= VARIABLES +;= ################ +Var FINISHTEXT +Var FINISHTITLE +Var NSIS +Var PACKAGE +Var SKIPWELCOMEPAGE +Var AUTOMATICCOMPILE +Var DEFINES +Var ERROROCCURED +Var AppShortname +Var AppFullname +Var AppID +Var Name + +;= PAGES +;= ################ +!define MUI_WELCOMEFINISHPAGE_BITMAP welcomefinish.bmp +!define MUI_WELCOMEPAGE_TITLE "PortableApps Compiler" +!define MUI_WELCOMEPAGE_TEXT "Welcome to the PortableApps Compiler.\r\n\r\nThis utility is an advanced compiler which allows you to create a portable wrapper for an application which adheres to the PortableApps Compiler format specifications. Click next to start the compiling process." +!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowWelcomeWindow +!insertmacro MUI_PAGE_WELCOME +Page custom ShowOptionsWindow LeaveOptionsWindow " | Portable App Folder Selection" +Page instfiles +!define MUI_PAGE_CUSTOMFUNCTION_PRE ShowFinishPage +!define MUI_FINISHPAGE_TITLE "$FINISHTITLE" +!define MUI_FINISHPAGE_TEXT "$FINISHTEXT" +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_NOTCHECKED +!define MUI_FINISHPAGE_RUN_TEXT "Test Wrapper" +!define MUI_FINISHPAGE_RUN_FUNCTION "RunOnFinish" +!define MUI_FINISHPAGE_SHOWREADME "$EXEDIR\bin\PortableAppsCompilerLog.txt" +!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +!define MUI_FINISHPAGE_SHOWREADME_TEXT "Review Log" +!insertmacro MUI_PAGE_FINISH + +;= DEFINITIONS +;= ################ +!define NEWLINE "$\r$\n" +!define EXTENDED "$PACKAGE\App\AppInfo\ExtendedWrapper.nsh" +!define CWRAPPER "$PACKAGE\App\AppInfo\CompilerWrapper.ini" +!define DEFINES "$EXEDIR\etc\Source\PortableAppsCompilerDefines.nsh" +!define DEFSTART ";=# ${NEWLINE}; ${NEWLINE}; PORTABLEAPPS COMPILER${NEWLINE}; Developed by daemon.devin${NEWLINE}; ${NEWLINE}; For support visit the GitHub project:${NEWLINE}; https://github.com/demondevin/pac-man${NEWLINE}; ${NEWLINE}; PortableAppsCompilerDefines.nsh${NEWLINE}; This file was automatically generated by the PortableApps Compiler and should not be edited!${NEWLINE}; ${NEWLINE}" + +;= MACROS +;= ################ +!define ReadAppInfoConfig `!insertmacro _ReadAppInfoConfig` +!macro _ReadAppInfoConfig _VALUE _SECTION _KEY + ReadINIStr ${_VALUE} `${_}\App\AppInfo\AppInfo.ini` `${_SECTION}` `${_KEY}` +!macroend +!define ReadWrapperConfig `!insertmacro _ReadWrapperConfig` +!macro _ReadWrapperConfig _VALUE _SECTION _KEY + ReadINIStr ${_VALUE} `${_}\App\AppInfo\CompilerWrapper.ini` `${_SECTION}` `${_KEY}` +!macroend +!define WriteDefineConfig "!insertmacro _WriteDefineConfig" +!macro _WriteDefineConfig _DEFINE _VALUE + !if ! "${_VALUE}" == "" + FileWrite $DEFINES "!define ${_DEFINE} `${_VALUE}`${NEWLINE}" + !else + FileWrite $DEFINES "!define ${_DEFINE}${NEWLINE}" + !endif +!macroend +!define AddConditionIfNot "!insertmacro _AddConditionIfNot" +!macro _AddConditionIfNot _DEFINE + FileWrite $DEFINES `!ifndef ${_DEFINE}${NEWLINE}$\t!define ${_DEFINE}${NEWLINE}!endif${NEWLINE}` +!macroend +!define WriteErrorLog "!insertmacro _WriteErrorLog" +!macro _WriteErrorLog _ERROR + FileOpen $9 "$EXEDIR\bin\PortableAppsCompilerLog.txt" a + FileSeek $9 0 END + FileWrite $9 `ERROR: ${_ERROR}` + FileWriteByte $9 "13" + FileWriteByte $9 "10" + FileClose $9 + StrCpy $ERROROCCURED "true" +!macroend +!define ConvertPath "!insertmacro _ConvertPath" +!macro _ConvertPath _SOURCE _TARGET + ${If} ${FileExists} "$PACKAGE\${_SOURCE}" + DetailPrint "${_SOURCE} -> ${_TARGET}" + SetDetailsPrint none + Rename "$PACKAGE\${_SOURCE}" "$PACKAGE\${_TARGET}" + SetDetailsPrint lastused + ${EndIf} +!macroend +!define StringConvertInFile `!insertmacro _StringConvertInFile` +!macro _StringConvertInFile _FILE _SEARCH _REPLACE + FileOpen $R8 ${_FILE} r + FileReadWord $R8 $R7 + FileClose $R8 + SetDetailsPrint none + ${If} $R7 = 0xFEFF + ${ReplaceInFileUTF16LE} ${_FILE} ${_SEARCH} ${_REPLACE} + ${Else} + ${ReplaceInFile} ${_FILE} ${_SEARCH} ${_REPLACE} + ${EndIf} + SetDetailsPrint lastused +!macroend + +;= LANGUAGES +;= ################ +!insertmacro MUI_LANGUAGE "English" + +;= FUNCTIONS +;= ################ +Function .onInit + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "CompilerWizardForm.ini" + SetOutPath $EXEDIR + + CreateDirectory $EXEDIR\bin + + ReadINIStr $SKIPWELCOMEPAGE $EXEDIR\bin\settings.ini CompilerWizard SkipWelcomePage + ReadINIStr $0 $EXEDIR\bin\settings.ini CompilerWizard Drive + ReadINIStr $PACKAGE $EXEDIR\bin\settings.ini CompilerWizard Package + ; Update drive letter; doesn't matter if $0 == "" + StrLen $1 $0 + StrCpy $2 $PACKAGE $1 + ${If} $2 == $0 + StrCpy $PACKAGE $PACKAGE "" $1 + StrCpy $PACKAGE $0$PACKAGE + ${EndIf} + + ;StrCpy $NSIS "$EXEDIR\App\NSIS\makensis.exe" + ReadINIStr $NSIS $EXEDIR\bin\settings.ini CompilerWizard makensis + ${If} $NSIS == "" + StrCpy $NSIS ..\NSISPortable\App\NSIS\makensis.exe + WriteINIStr $EXEDIR\bin\settings.ini CompilerWizard makensis $NSIS + ${EndIf} + + ${GetParameters} $R0 + StrCmp $R0 "" PreFillForm + StrCpy $PACKAGE $R0 + StrCpy $SKIPWELCOMEPAGE "true" + StrCpy $AUTOMATICCOMPILE "true" + ;Strip quotes from $PACKAGE + StrCpy $R0 $PACKAGE 1 + StrCmp $R0 `"` "" PreFillForm + StrCpy $PACKAGE $PACKAGE "" 1 + StrCpy $PACKAGE $PACKAGE -1 + + PreFillForm: + ;=== Pre-Fill Path with Directory + WriteINIStr $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" "$PACKAGE" +FunctionEnd + +Function ShowWelcomeWindow + StrCmp $SKIPWELCOMEPAGE "true" "" ShowWelcomeWindowEnd + Abort + ShowWelcomeWindowEnd: +FunctionEnd + +Function ShowOptionsWindow + !insertmacro MUI_HEADER_TEXT "PortableApps Compiler" "a better alternative to PA.c Launcher" + ${IfThen} $AUTOMATICCOMPILE == "true" ${|} Abort ${|} + InstallOptions::InitDialog /NOUNLOAD "$PLUGINSDIR\CompilerWizardForm.ini" + Pop $0 + InstallOptions::Show +FunctionEnd + +Function LeaveOptionsWindow + ReadINIStr $PACKAGE $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" + + ${If} $PACKAGE == "" + MessageBox MB_OK|MB_ICONEXCLAMATION `Please select a valid base directory to create a wrapper for.` + Abort + ${EndIf} + ${GetRoot} $EXEDIR $0 + WriteINIStr $EXEDIR\bin\settings.ini CompilerWizard Drive $0 + WriteINIStr $EXEDIR\bin\settings.ini CompilerWizard Package $PACKAGE +FunctionEnd + +Function ConvertLanguageEnvironmentVariables + Pop $9 # file + + FileOpen $8 $9 r + FileReadWord $8 $7 + FileClose $8 + + SetDetailsPrint none + ${If} $7 = 0xFEFF + ; Convert old PAL to PAC + ${ReplaceInFileUTF16LE} $9 PortableApps.comLanguageCode PAC:LanguageCode + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode2 PAC:LanguageCode2 + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode3 PAC:LanguageCode3 + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleGlibc PAC:LanguageGlibc + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleWinName PAC:LanguageNSIS + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleName PAC:LanguageName + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleID PAC:LanguageLCID + ; Convert new PAL to PAC + ${ReplaceInFileUTF16LE} $9 PAL:LanguageCode PAC:LanguageCode + ${ReplaceInFileUTF16LE} $9 PAL:LocaleCode2 PAC:LanguageCode2 + ${ReplaceInFileUTF16LE} $9 PAL:LocaleCode3 PAC:LanguageCode3 + ${ReplaceInFileUTF16LE} $9 PAL:LocaleGlibc PAC:LanguageGlibc + ${ReplaceInFileUTF16LE} $9 PAL:LocaleWinName PAC:LanguageNSIS + ${ReplaceInFileUTF16LE} $9 PAL:LocaleName PAC:LanguageName + ${ReplaceInFileUTF16LE} $9 PAL:LocaleID PAC:LanguageLCID + ${Else} + ; Convert old PAL to PAC + ${ReplaceInFile} $9 PortableApps.comLanguageCode PAC:LanguageCode + ${ReplaceInFile} $9 PortableApps.comLocaleCode2 PAC:LanguageCode2 + ${ReplaceInFile} $9 PortableApps.comLocaleCode3 PAC:LanguageCode3 + ${ReplaceInFile} $9 PortableApps.comLocaleGlibc PAC:LanguageGlibc + ${ReplaceInFile} $9 PortableApps.comLocaleWinName PAC:LanguageNSIS + ${ReplaceInFile} $9 PortableApps.comLocaleName PAC:LanguageName + ${ReplaceInFile} $9 PortableApps.comLocaleID PAC:LanguageLCID + ; Convert new PAL to PAC + ${ReplaceInFile} $9 PAL:LanguageCode PAC:LanguageCode + ${ReplaceInFile} $9 PAL:LocaleCode2 PAC:LanguageCode2 + ${ReplaceInFile} $9 PAL:LocaleCode3 PAC:LanguageCode3 + ${ReplaceInFile} $9 PAL:LocaleGlibc PAC:LanguageGlibc + ${ReplaceInFile} $9 PAL:LocaleWinName PAC:LanguageNSIS + ${ReplaceInFile} $9 PAL:LocaleName PAC:LanguageName + ${ReplaceInFile} $9 PAL:LocaleID PAC:LanguageLCID + ${EndIf} + SetDetailsPrint lastused +FunctionEnd + +Function ConvertDefines + Pop $9 # file + + FileOpen $8 $9 r + FileReadWord $8 $7 + FileClose $8 + + SetDetailsPrint none + StrCpy $0 $${ + ${If} $7 = 0xFEFF + ${ReplaceInFileUTF16LE} $9 PortableApps.comLanguageCode PortableAppsLanguageCode + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode2 PortableAppsLocaleCode2 + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleCode3 PortableAppsLocaleCode3 + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleGlibc PortableAppsLocaleGlibc + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleWinName PortableAppsLocaleWinName + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleName PortableAppsLocaleName + ${ReplaceInFileUTF16LE} $9 PortableApps.comLocaleID PortableAppsLocaleID + ${ReplaceInFileUTF16LE} $9 $0ReadUser} $0ReadUserConfig} + ${ReplaceInFileUTF16LE} $9 $0LAUNCHER} $0WRAPPER} + ${ReplaceInFileUTF16LE} $9 $0LAUNCHER2} $0WRAPPER2} + ${ReplaceInFileUTF16LE} $9 $0OTHER} $0ETC} + ${ReplaceInFileUTF16LE} $9 $0SETINI} $0CONFIGINI} + ${ReplaceInFileUTF16LE} $9 $0PAL} $0PAC} + ${ReplaceInFileUTF16LE} $9 $0DEFSET} $0DEFCONF} + ${ReplaceInFileUTF16LE} $9 $0SET} $0CONF} + ${ReplaceInFileUTF16LE} $9 $0DEFDATA} $0DEFSET} + ${ReplaceInFileUTF16LE} $9 $0DATA} $0SET} + ${ReplaceInFileUTF16LE} $9 $0ReadLauncherConfig} $0ReadWrapperConfig} + ${ReplaceInFileUTF16LE} $9 $0WriteLauncherConfig} $0WriteWrapperConfig} + ${ReplaceInFileUTF16LE} $9 $0DeleteLauncherConfig} $0DeleteWrapperConfig} + ${ReplaceInFileUTF16LE} $9 $0DeleteLauncherConfigSec} $0DeleteWrapperConfigSec} + ${ReplaceInFileUTF16LE} $9 $0ReadLauncherConfigWithDefault} $0ReadWrapperConfigWithDefault} + ${ReplaceInFileUTF16LE} $9 $0PAF} $0TREE} + ${ReplaceInFileUTF16LE} $9 $0PAFKEYS} $0TREEKEYS} + ${ReplaceInFileUTF16LE} $9 PAL:LanguageCode PAC:LanguageCode + ${ReplaceInFileUTF16LE} $9 PAL:LocaleCode2 PAC:LanguageCode2 + ${ReplaceInFileUTF16LE} $9 PAL:LocaleCode3 PAC:LanguageCode3 + ${ReplaceInFileUTF16LE} $9 PAL:LocaleGlibc PAC:LanguageGlibc + ${ReplaceInFileUTF16LE} $9 PAL:LocaleWinName PAC:LanguageNSIS + ${ReplaceInFileUTF16LE} $9 PAL:LocaleName PAC:LanguageName + ${ReplaceInFileUTF16LE} $9 PAL:LocaleID PAC:LanguageLCID + ${Else} + ${ReplaceInFile} $9 PortableApps.comLanguageCode PortableAppsLanguageCode + ${ReplaceInFile} $9 PortableApps.comLocaleCode2 PortableAppsLocaleCode2 + ${ReplaceInFile} $9 PortableApps.comLocaleCode3 PortableAppsLocaleCode3 + ${ReplaceInFile} $9 PortableApps.comLocaleGlibc PortableAppsLocaleGlibc + ${ReplaceInFile} $9 PortableApps.comLocaleWinName PortableAppsLocaleWinName + ${ReplaceInFile} $9 PortableApps.comLocaleName PortableAppsLocaleName + ${ReplaceInFile} $9 PortableApps.comLocaleID PortableAppsLocaleID + ${ReplaceInFile} $9 $0ReadUser} $0ReadUserConfig} + ${ReplaceInFile} $9 $0LAUNCHER} $0WRAPPER} + ${ReplaceInFile} $9 $0LAUNCHER2} $0WRAPPER2} + ${ReplaceInFile} $9 $0OTHER} $0ETC} + ${ReplaceInFile} $9 $0SETINI} $0CONFIGINI} + ${ReplaceInFile} $9 $0PAL} $0PAC} + ${ReplaceInFile} $9 $0DEFSET} $0DEFCONF} + ${ReplaceInFile} $9 $0SET} $0CONF} + ${ReplaceInFile} $9 $0DEFDATA} $0DEFSET} + ${ReplaceInFile} $9 $0DATA} $0SET} + ${ReplaceInFile} $9 $0ReadLauncherConfig} $0ReadWrapperConfig} + ${ReplaceInFile} $9 $0WriteLauncherConfig} $0WriteWrapperConfig} + ${ReplaceInFile} $9 $0DeleteLauncherConfig} $0DeleteWrapperConfig} + ${ReplaceInFile} $9 $0DeleteLauncherConfigSec} $0DeleteWrapperConfigSec} + ${ReplaceInFile} $9 $0ReadLauncherConfigWithDefault} $0ReadWrapperConfigWithDefault} + ${ReplaceInFile} $9 $0PAF} $0TREE} + ${ReplaceInFile} $9 $0PAFKEYS} $0TREEKEYS} + ${ReplaceInFile} $9 PAL:LanguageCode PAC:LanguageCode + ${ReplaceInFile} $9 PAL:LocaleCode2 PAC:LanguageCode2 + ${ReplaceInFile} $9 PAL:LocaleCode3 PAC:LanguageCode3 + ${ReplaceInFile} $9 PAL:LocaleGlibc PAC:LanguageGlibc + ${ReplaceInFile} $9 PAL:LocaleWinName PAC:LanguageNSIS + ${ReplaceInFile} $9 PAL:LocaleName PAC:LanguageName + ${ReplaceInFile} $9 PAL:LocaleID PAC:LanguageLCID + ${EndIf} + SetDetailsPrint lastused +FunctionEnd + +Section Main + ${IfNot} ${FileExists} $NSIS + StrCpy $ERROROCCURED true + ${WriteErrorLog} "NSIS not found at $NSIS." + MessageBox MB_ICONSTOP "NSIS was not found! (Looked for it in $NSIS)${NEWLINE}${NEWLINE}You can specify a custom path to makensis.exe in $EXEDIR\bin\settings.ini, [CompilerWizard]:makensis" + Abort + ${EndIf} + + ; Fix the package path, if necessary + StrCpy $R1 $PACKAGE 1 -1 + ${IfThen} $R1 == "\" ${|} StrCpy $PACKAGE $PACKAGE -1 ${|} + + SetDetailsPrint ListOnly + DetailPrint "App: $PACKAGE" + DetailPrint " " + RealProgress::SetProgress /NOUNLOAD 0 + RealProgress::GradualProgress /NOUNLOAD 1 20 90 "Processing complete." + + ; Convert from PAF to PAC needs to be done.. + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\Custom.nsh" + ${OrIf} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\Debug.nsh" + DetailPrint "Converting package from PAF to PAC..." + ${ConvertPath} "App\AppInfo\Launcher\Custom.nsh" "App\AppInfo\ExtendedWrapper.nsh" + ${ConvertPath} "App\AppInfo\Launcher\Debug.nsh" "App\AppInfo\ExtendedDebug.nsh" + ${ConvertPath} "App\AppInfo\installer.ini" "App\AppInfo\CompilerInstaller.ini" + + ; Replace old defines to new defines | i.e. ${LAUNCHER} -> ${WRAPPER} + ; Check if it's UTF-16LE + ; FileOpen $0 "${EXTENDED}" r + ; FileReadWord $0 $1 + ; FileClose $0 + ; StrCpy $0 $${ + ; ${If} $1 = 0xFEFF + ; ${If} $5 == UTF-16LE + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0ReadUser} $0ReadUserConfig} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0LAUNCHER} $0WRAPPER} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0LAUNCHER2} $0WRAPPER2} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0OTHER} $0ETC} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0SETINI} $0CONFIGINI} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0PAL} $0PAC} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0DEFSET} $0DEFCONF} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0DEFDATA} $0DEFSET} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0ReadLauncherConfig} $0ReadWrapperConfig} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0WriteLauncherConfig} $0WriteWrapperConfig} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0DeleteLauncherConfig} $0DeleteWrapperConfig} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0DeleteLauncherConfigSec} $0DeleteWrapperConfigSec} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0ReadLauncherConfigWithDefault} $0ReadWrapperConfigWithDefault} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0PAF} $0TREE} + ; ${ReplaceInFileUTF16LECS} "${EXTENDED}" $0PAFKEYS} $0TREEKEYS} + ; ${Else} + ; ${ReplaceInFileCS} "${EXTENDED}" $0ReadUser} $0ReadUserConfig} + ; ${ReplaceInFileCS} "${EXTENDED}" $0LAUNCHER} $0WRAPPER} + ; ${ReplaceInFileCS} "${EXTENDED}" $0LAUNCHER2} $0WRAPPER2} + ; ${ReplaceInFileCS} "${EXTENDED}" $0OTHER} $0ETC} + ; ${ReplaceInFileCS} "${EXTENDED}" $0SETINI} $0CONFIGINI} + ; ${ReplaceInFileCS} "${EXTENDED}" $0PAL} $0PAC} + ; ${ReplaceInFileCS} "${EXTENDED}" $0DEFSET} $0DEFCONF} + ; ${ReplaceInFileCS} "${EXTENDED}" $0DEFDATA} $0DEFSET} + ; ${ReplaceInFileCS} "${EXTENDED}" $0ReadLauncherConfig} $0ReadWrapperConfig} + ; ${ReplaceInFileCS} "${EXTENDED}" $0WriteLauncherConfig} $0WriteWrapperConfig} + ; ${ReplaceInFileCS} "${EXTENDED}" $0DeleteLauncherConfig} $0DeleteWrapperConfig} + ; ${ReplaceInFileCS} "${EXTENDED}" $0DeleteLauncherConfigSec} $0DeleteWrapperConfigSec} + ; ${ReplaceInFileCS} "${EXTENDED}" $0ReadLauncherConfigWithDefault} $0ReadWrapperConfigWithDefault} + ; ${ReplaceInFileCS} "${EXTENDED}" $0PAF} $0TREE} + ; ${ReplaceInFileCS} "${EXTENDED}" $0PAFKEYS} $0TREEKEYS} + ; ${EndIf} + ; ${EndIf} + ; StrCpy $0 $${ + ; ${StringRIP} "${EXTENDED}" "$0ReadUser}" "$0ReadUserConfig}" + ; ${StringRIP} "${EXTENDED}" "$0ReadUser}" "$0ReadUserConfig}" + ; ${StringRIP} "${EXTENDED}" "$0LAUNCHER}" "$0WRAPPER}" + ; ${StringRIP} "${EXTENDED}" "$0LAUNCHER2}" "$0WRAPPER2}" + ; ${StringRIP} "${EXTENDED}" "$0OTHER}" "$0ETC}" + ; ${StringRIP} "${EXTENDED}" "$0SETINI}" "$0CONFIGINI}" + ; ${StringRIP} "${EXTENDED}" "$0PAL}" "$0PAC}" + ; ${StringRIP} "${EXTENDED}" "$0DEFSET}" "$0DEFCONF}" + ; ${StringRIP} "${EXTENDED}" "$0DEFDATA}" "$0DEFSET}" + ; ${StringRIP} "${EXTENDED}" "$0ReadLauncherConfig}" "$0ReadWrapperConfig}" + ; ${StringRIP} "${EXTENDED}" "$0WriteLauncherConfig}" "$0WriteWrapperConfig}" + ; ${StringRIP} "${EXTENDED}" "$0DeleteLauncherConfig}" "$0DeleteWrapperConfig}" + ; ${StringRIP} "${EXTENDED}" "$0DeleteLauncherConfigSec}" "$0DeleteWrapperConfigSec}" + ; ${StringRIP} "${EXTENDED}" "$0ReadLauncherConfigWithDefault}" "$0ReadWrapperConfigWithDefault}" + ; ${StringRIP} "${EXTENDED}" "$0PAF}" "$0TREE}" + ; ${StringRIP} "${EXTENDED}" "$0PAFKEYS}" "$0TREEKEYS}" + ; ${StringRIP} "${CWRAPPER}" "$0ReadUser}" "$0ReadUserConfig}" + ; ${StringRIP} "${CWRAPPER}" "$0ReadUser}" "$0ReadUserConfig}" + ; ${StringRIP} "${CWRAPPER}" "$0LAUNCHER}" "$0WRAPPER}" + ; ${StringRIP} "${CWRAPPER}" "$0LAUNCHER2}" "$0WRAPPER2}" + ; ${StringRIP} "${CWRAPPER}" "$0OTHER}" "$0ETC}" + ; ${StringRIP} "${CWRAPPER}" "$0SETINI}" "$0CONFIGINI}" + ; ${StringRIP} "${CWRAPPER}" "$0PAL}" "$0PAC}" + ; ${StringRIP} "${CWRAPPER}" "$0DEFSET}" "$0DEFCONF}" + ; ${StringRIP} "${CWRAPPER}" "$0DEFDATA}" "$0DEFSET}" + ; ${StringRIP} "${CWRAPPER}" "$0ReadLauncherConfig}" "$0ReadWrapperConfig}" + ; ${StringRIP} "${CWRAPPER}" "$0WriteLauncherConfig}" "$0WriteWrapperConfig}" + ; ${StringRIP} "${CWRAPPER}" "$0DeleteLauncherConfig}" "$0DeleteWrapperConfig}" + ; ${StringRIP} "${CWRAPPER}" "$0DeleteLauncherConfigSec}" "$0DeleteWrapperConfigSec}" + ; ${StringRIP} "${CWRAPPER}" "$0ReadLauncherConfigWithDefault}" "$0ReadWrapperConfigWithDefault}" + ; ${StringRIP} "${CWRAPPER}" "$0PAF}" "$0TREE}" + ; ${StringRIP} "${CWRAPPER}" "$0PAFKEYS}" "$0TREEKEYS}" + ; DetailPrint " " + ${EndIf} + + ; Check if any conversion needs to be done from PAL to PAC + ; DetailPrint "Converting PAL to PAC..." + ; Replace the PA.c language environment variables with their PAC counterparts + Push "${CWRAPPER}" + Call ConvertLanguageEnvironmentVariables + Push "${EXTENDED}" + Call ConvertDefines + ; FindFirst $0 $1 "$PACKAGE\App\AppInfo\*.ini" + ; ${DoUntil} $1 == "" + ; Push "$PACKAGE\App\AppInfo\$1" + ; Call ConvertLanguageEnvironmentVariables + ; FindNext $0 $1 + ; ${Loop} + ; FindClose $0 + DetailPrint " " + + DetailPrint "Compiling portable wrapper..." + SetDetailsPrint none + + Delete "$EXEDIR\bin\PortableAppsCompilerLog.txt" + + Delete "${DEFINES}" + + !ifdef CustomIconAndName + !define _ $PACKAGE + !else + !define _ $EXEDIR + !endif + + Delete "${DEFINES}" + + ; Read/write the needed defines to PortableAppsCompilerDefines.nsh + FileOpen $DEFINES "${DEFINES}" a + FileSeek $DEFINES 0 END + FileWrite $DEFINES `${DEFSTART}` + + ${IfNot} ${FileExists} "${_}\App\AppInfo\AppInfo.ini" + StrCpy $ERROROCCURED true + ${WriteErrorLog} "${_}\App\AppInfo\AppInfo.ini doesn't exist!" + ${Else} + ; ${ReadAppInfoConfig} $0 "Section" "Key" + ; ${WriteDefineConfig} "Define" "Value" + ClearErrors + ${ReadAppInfoConfig} $Name "Details" "Name" + ${WriteDefineConfig} "PORTABLEAPPNAME" "$Name" + StrCpy $AppFullname $Name -9 + ${WriteDefineConfig} "FULLNAME" "$AppFullname" + + ${ReadAppInfoConfig} $AppID "Details" "AppID" + ${WriteDefineConfig} "APPNAME" "$AppID" + StrCpy $AppShortname $AppID -8 + ${WriteDefineConfig} "APP" "$AppShortname" + ${WriteDefineConfig} "APPDIR" "$$EXEDIR\bin\$${APP}" + ${WriteDefineConfig} "APP64" "$AppShortname64" + ${WriteDefineConfig} "APPDIR64" "$$EXEDIR\bin\$${APP64}" + + ${ReadAppInfoConfig} $1 "Version" "PackageVersion" + ${WriteDefineConfig} "PACKAGE_VERSION" "$1" + + ${If} ${Errors} + StrCpy $ERROROCCURED true + ${WriteErrorLog} "[Details]:Name [Details]:AppID or [Version]:PackageVersion not found in appinfo.ini files" + ${Else} + ;Delete existing installer if there is one + Delete "$PACKAGE\$AppID.exe" + ${If} ${FileExists} "$PACKAGE\$AppID.exe" + StrCpy $ERROROCCURED true + ${WriteErrorLog} "ERROR: Cannot remove $PACKAGE\$AppID.exe! Is $AppID currently running?" + ${EndIf} + ${EndIf} + + ClearErrors + ${ReadAppInfoConfig} $0 "Team" "Developer" + ${If} $0 == "demon.devin" + StrCpy $0 "daemon.devin" + ${EndIf} + ${WriteDefineConfig} "DEVELOPER" "$0" + ClearErrors + ${ReadAppInfoConfig} $0 "Team" "Contributors" + ${IfNot} ${Errors} + ${WriteDefineConfig} "CONTRIBUTORS" "$0" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Details" "Publisher" + ${IfNot} ${Errors} + ${WriteDefineConfig} "PUBLISHER" "$0" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Details" "Trademarks" + ${IfNot} ${Errors} + ${WriteDefineConfig} "TRADEMARK" "$0" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Control" "Start" + ${IfNot} ${Errors} + ${WriteDefineConfig} "OUTFILE" "$0" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "UsesDotNetVersion" + ${IfNot} ${Errors} + ${If} $0 != false + ${WriteDefineConfig} "DOTNET" "" + ${EndIf} + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "UseStdUtils" + ${IfNot} ${Errors} + ${WriteDefineConfig} "UseStdUtils" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "INF_Install" + ${IfNot} ${Errors} + ${WriteDefineConfig} "INF_Install" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "RegistryValueWrite" + ${IfNot} ${Errors} + ${WriteDefineConfig} "RegSleep" "50" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "FileWriteReplace" + ${IfNot} ${Errors} + ${WriteDefineConfig} "REPLACE" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "CloseWindow" + ${IfNot} ${Errors} + ${WriteDefineConfig} "CloseWindow" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "FileLocking" + ${IfNot} ${Errors} + ${WriteDefineConfig} "IsFileLocked" "" + ${AddConditionIfNot} "CloseWindow" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "Firewall" + ${IfNot} ${Errors} + ${WriteDefineConfig} "FIREWALL" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "Junctions" + ${IfNot} ${Errors} + ${WriteDefineConfig} "NTFS" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "ACLRegSupport" + ${IfNot} ${Errors} + ${WriteDefineConfig} "ACL" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "ACLDirSupport" + ${IfNot} ${Errors} + ${WriteDefineConfig} "ACL_DIR" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "RMEmptyDir" + ${IfNot} ${Errors} + ${WriteDefineConfig} "RMEMPTYDIRECTORIES" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "LocalLow" + ${IfNot} ${Errors} + ${WriteDefineConfig} "LocalLow" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "PublicDoc" + ${IfNot} ${Errors} + ${WriteDefineConfig} "PublicDoc" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "CompareVersions" + ${IfNot} ${Errors} + ${WriteDefineConfig} "CompareVersions" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "ConfigFunctions" + ${IfNot} ${Errors} + ${WriteDefineConfig} "ConFunc" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "JSONSupport" + ${IfNot} ${Errors} + ${WriteDefineConfig} "JSON" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "RestartSleep" + ${IfNot} ${Errors} + ${WriteDefineConfig} "Sleep" "$0" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "WinMessages" + ${IfNot} ${Errors} + ${WriteDefineConfig} "Include_WinMessages" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "LineWrite" + ${IfNot} ${Errors} + ${WriteDefineConfig} "Include_LineWrite" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "TrimString" + ${IfNot} ${Errors} + ${WriteDefineConfig} "TrimString" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "CloseProcess" + ${IfNot} ${Errors} + ${WriteDefineConfig} "CloseProc" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "Include64" + ${IfNot} ${Errors} + ${WriteDefineConfig} "64.nsh" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "IncludeWordRep" + ${IfNot} ${Errors} + ${WriteDefineConfig} "Include_WordRep" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "GetBetween" + ${IfNot} ${Errors} + ${WriteDefineConfig} "GetBetween.nsh" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "DisableLanguageCustom" + ${IfNot} ${Errors} + ${WriteDefineConfig} "DisablePAC:LanguageCustom" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "DisableProgramExecSegment" + ${IfNot} ${Errors} + ${WriteDefineConfig} "DisableProgramExecSegment" "" + ${EndIf} + ClearErrors + ${ReadAppInfoConfig} $0 "Dependencies" "TLB_FUNCTION" + ${IfNot} ${Errors} + ${WriteDefineConfig} "TLB_FUNCTION" "" + ${EndIf} + + ${EndIf} + + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\$AppID.ini" + ${ConvertPath} "App\AppInfo\Launcher\$AppID.ini" "App\AppInfo\CompilerWrapper.ini" + RMDir /r "$PACKAGE\App\AppInfo\Launcher" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\$AppShortname\*.*" + CopyFiles /SILENT "$PACKAGE\App\$AppShortname" "$PACKAGE\bin\$AppShortname" + RMDir /r "$PACKAGE\App\$AppShortname" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\$AppShortname64\*.*" + CopyFiles /SILENT "$PACKAGE\App\$AppShortname64" "$PACKAGE\bin\$AppShortname64" + RMDir /r "$PACKAGE\App\$AppShortname64" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\DefaultData\*.*" + ${If} ${FileExists} "$PACKAGE\App\DefaultData\settings\*.*" + Rename "$PACKAGE\App\DefaultData\settings" "$PACKAGE\App\DefaultData\Config" + ${EndIf} + Rename "$PACKAGE\App\DefaultData" "$PACKAGE\App\DefaultSettings" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Data\*.*" + ${If} ${FileExists} "$PACKAGE\Data\settings\*.*" + Rename "$PACKAGE\Data\settings" "$PACKAGE\Data\Config" + ${EndIf} + CopyFiles /SILENT "$PACKAGE\Data" "$PACKAGE\bin\Settings" + RMDir /r "$PACKAGE\Data" + ${EndIf} + + ${StringConvertInFile} "$PACKAGE\bin\Settings\Config\$AppIDSettings.ini" PAL: PAC: + ${StringConvertInFile} "$PACKAGE\bin\Settings\Config\$AppIDSettings.ini" PortableApps.comLauncher PortableAppsCompiler + ${StringConvertInFile} "${CWRAPPER}" %PAL: %PAC: + ${StringConvertInFile} "${CWRAPPER}" PortableApps.comLauncher PortableAppsCompiler + ${StringConvertInFile} "${CWRAPPER}" PortableApps.com PortableApps + + ${IfNot} ${FileExists} "${_}\App\AppInfo\CompilerWrapper.ini" + StrCpy $ERROROCCURED true + ${WriteErrorLog} "${_}\App\AppInfo\CompilerWrapper.ini doesn't exist!" + ${Else} + ClearErrors + ${ReadWrapperConfig} $0 "Launch" "RunAsAdmin" + ${IfNot} ${Errors} + ${If} $0 == "try" + ${OrIf} $0 == "force" + ${OrIf} $0 == "compile-force" + ${WriteDefineConfig} "UAC" "" + ${EndIf} + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Registry" + ${IfNot} ${Errors} + ${WriteDefineConfig} "REGISTRY" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "RegRedirection" + ${IfNot} ${Errors} + ${WriteDefineConfig} "DISABLEFSR" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "RegCopyKeys" + ${IfNot} ${Errors} + ${WriteDefineConfig} "RegCopy" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Redirection" + ${IfNot} ${Errors} + ${WriteDefineConfig} "SYSTEMWIDE_DISABLEREDIR" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "ForceRedirection" + ${IfNot} ${Errors} + ${WriteDefineConfig} "FORCE_SYSTEMWIDE_DISABLEREDIR" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "ExecAsUser" + ${IfNot} ${Errors} + ${WriteDefineConfig} "ExecAsUser" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Services" + ${IfNot} ${Errors} + ${WriteDefineConfig} "SERVICES" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "RegDLLs" + ${IfNot} ${Errors} + ${WriteDefineConfig} "REGISTERDLL" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Tasks" + ${IfNot} ${Errors} + ${WriteDefineConfig} "TaskCleanUp" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Java" + ${IfNot} ${Errors} + ${If} $0 == "find" + ${OrIf} $0 == "require" + ${WriteDefineConfig} "JAVA" "" + ${EndIf} + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "XML" + ${IfNot} ${Errors} + ${WriteDefineConfig} "XML_PLUGIN" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "Ghostscript" + ${IfNot} ${Errors} + ${WriteDefineConfig} "GHOSTSCRIPT" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "FontsFolder" + ${IfNot} ${Errors} + ${WriteDefineConfig} "FONTS_ENABLE" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "FileCleanup" + ${IfNot} ${Errors} + ${WriteDefineConfig} "FileCleanup" "" + ${EndIf} + ClearErrors + ${ReadWrapperConfig} $0 "Activate" "DirectoryCleanup" + ${IfNot} ${Errors} + ${WriteDefineConfig} "DirectoryCleanup" "" + ${EndIf} + + FileClose $DEFINES + + ${If} ${FileExists} "$PACKAGE\App\Readme.txt" + Delete "$PACKAGE\App\Readme.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\help.html" + Delete "$PACKAGE\help.html" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\AppInfo\eula.txt" + Rename "$PACKAGE\App\AppInfo\eula.txt" "$PACKAGE\App\AppInfo\eula.txt.temp" + Rename "$PACKAGE\App\AppInfo\eula.txt.temp" "$PACKAGE\App\AppInfo\EULA.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\DefaultData\*.*" + ${ConvertPath} "App\DefaultData" "App\DefaultSettings" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\*.*" + ${If} ${FileExists} "$PACKAGE\Other\Help\*.*" + RMDir /r "$PACKAGE\Other\Help" + ${EndIf} + ${IfNot} ${FileExists} "$PACKAGE\bin\*.*" + CreateDirectory "$PACKAGE\bin" + ${EndIf} + ${IfNot} ${FileExists} "$PACKAGE\etc\*.*" + CreateDirectory "$PACKAGE\etc" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\PortableApps.comInstallerCustom.nsh" + ${ConvertPath} "Other\Source\PortableApps.comInstallerCustom.nsh" "App\AppInfo\ExtendedInstaller.nsh" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\$AppID.ini" + ${ConvertPath} "Other\Source\$AppID.ini" "etc\$AppID.ini" + Delete "$PACKAGE\Other\Source\$AppID.ini" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\Readme.txt" + ${ConvertPath} "Other\Source\Readme.txt" "etc\README" + Delete "$PACKAGE\Other\Source\Readme.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\notes.txt" + ${ConvertPath} "Other\notes.txt" "etc\NOTES" + Delete "$PACKAGE\Other\notes.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\*.nsi" + ${ConvertPath} "Other\*.nsi" "etc\*.nsi" + Delete "$PACKAGE\Other\*.nsi" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\*.png" + ${ConvertPath} "Other\*.png" "etc\*.png" + Delete "$PACKAGE\Other\*.png" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\LauncherLicense.txt" + Delete "$PACKAGE\Other\Source\LauncherLicense.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\COPYING" + Delete "$PACKAGE\Other\Source\COPYING" + ${EndIf} + ${IfNot} ${FileExists} "$PACKAGE\etc\UNLICENSE" + CopyFiles /SILENT "$EXEDIR\etc\UNLICENSE" "$PACKAGE\etc\UNLICENSE" + ${EndIf} + CopyFiles /SILENT "App\Other\*.*" "$PACKAGE\etc" + RMDir /r "$PACKAGE\Other" + Rename "$PACKAGE\App" "$PACKAGE\AppTemp" + Rename "$PACKAGE\AppTemp" "$PACKAGE\app" + Rename "$PACKAGE\App\AppInfo\appinfo.ini" "$PACKAGE\App\AppInfo\appinfo.ini.temp" + Rename "$PACKAGE\App\AppInfo\appinfo.ini.temp" "$PACKAGE\App\AppInfo\AppInfo.ini" + Rename "$PACKAGE\App\AppInfo\appicon.ico" "$PACKAGE\App\AppInfo\appicon.ico.temp" + Rename "$PACKAGE\App\AppInfo\appicon.ico.temp" "$PACKAGE\App\AppInfo\AppIcon.ico" + Rename "$PACKAGE\App\AppInfo\appicon_16.png" "$PACKAGE\App\AppInfo\appicon_16.png.temp" + Rename "$PACKAGE\App\AppInfo\appicon_16.png.temp" "$PACKAGE\App\AppInfo\AppIcon_16.png" + Rename "$PACKAGE\App\AppInfo\appicon_32.png" "$PACKAGE\App\AppInfo\appicon_32.png.temp" + Rename "$PACKAGE\App\AppInfo\appicon_32.png.temp" "$PACKAGE\App\AppInfo\AppIcon_32.png" + Rename "$PACKAGE\App\AppInfo\appicon_128.png" "$PACKAGE\App\AppInfo\appicon_128.png.temp" + Rename "$PACKAGE\App\AppInfo\appicon_128.png.temp" "$PACKAGE\App\AppInfo\AppIcon_128.png" + ${EndIf} + + StrCpy $2 "" + ; See if we need to enable XML + ReadINIStr $3 "${_}\App\AppInfo\CompilerWrapper.ini" Activate XML + ${If} $3 == true + StrCpy $2 "$2 /DXML_ENABLED" + ${EndIf} + + ; See if we need to use the RequestExecutionLevel admin + ReadINIStr $3 "${_}\App\AppInfo\CompilerWrapper.ini" Launch RunAsAdmin + ${If} $3 == compile-force + StrCpy $2 "$2 /DRUNASADMIN_COMPILEFORCE" + ${EndIf} + + ; See if automatic signing is requested + ReadINIStr $3 "${_}\App\AppInfo\AppInfo.ini" Team CertSigning + ${If} $3 == true + StrCpy $2 "$2 /DCertificate" + ReadINIStr $4 "${_}\App\AppInfo\AppInfo.ini" Team CertExtension + StrCpy $2 "$2 /DCertExtension=$4" + ReadINIStr $5 "${_}\App\AppInfo\AppInfo.ini" Team CertTimestamp + StrCpy $2 "$2 /DCertTimestamp=$5" + ${EndIf} + + ${EndIf} + + ${If} $ERROROCCURED != true + ; Build the thing + ExecDos::exec `"$NSIS" /O"$EXEDIR\bin\PortableAppsCompilerLog.txt" /DPACKAGE="$PACKAGE" /DNamePortable="$Name" /DAppID="$AppID" /DVersion="$1"$2 "$EXEDIR\etc\source\PortableAppsCompiler.nsi"` "" "" + Pop $R1 + ${If} $R1 <> 0 + StrCpy $ERROROCCURED true + ${WriteErrorLog} "MakeNSIS exited with status code $R1" + ${EndIf} + ${EndIf} + + SetDetailsPrint ListOnly + + DetailPrint " " + DetailPrint "Processing complete." + ${If} ${FileExists} $PACKAGE\$AppID.exe + StrCpy $FINISHTITLE "Wrapper Created" + StrCpy $FINISHTEXT "The wrapper has been created. Wrapper location:\r\n$PACKAGE\r\n\r\nWrapper name:\r\n$AppID.exe" + ${Else} + StrCpy $FINISHTITLE "An Error Occurred" + StrCpy $FINISHTEXT "The wrapper was not created. You can view the log file for more information." + StrCpy $ERROROCCURED true + ${EndIf} +SectionEnd +Function ShowFinishPage + ${If} $AUTOMATICCOMPILE == "true" + ${AndIf} $ERROROCCURED != true + Abort + ${Else} + ${If} $ERROROCCURED == true + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Flags" "DISABLED" + !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" "1" + ${EndIf} + ${EndIf} +FunctionEnd +Function RunOnFinish + Exec $PACKAGE\$AppID.exe +FunctionEnd +Function .onGUIEnd + RealProgress::Unload +FunctionEnd diff --git a/Other/Source/CompilerWizardForm.ini b/etc/source/CompilerWizardForm.ini similarity index 90% rename from Other/Source/CompilerWizardForm.ini rename to etc/source/CompilerWizardForm.ini index b8b6bf5..acb2444 100644 --- a/Other/Source/CompilerWizardForm.ini +++ b/etc/source/CompilerWizardForm.ini @@ -1,17 +1,17 @@ -[Settings] -NumFields=2 - -[Field 1] -Type=Label -Left=0 -Top=0 -Right=296 -Bottom=8 -Text=Create Launcher For: - -[Field 2] -Type=DirRequest -Left=0 -Top=12 -Right=297 -Bottom=26 +[Settings] +NumFields=2 + +[Field 1] +Type=Label +Left=0 +Top=0 +Right=296 +Bottom=8 +Text=Create Launcher For: + +[Field 2] +Type=DirRequest +Left=0 +Top=12 +Right=297 +Bottom=26 diff --git a/Other/Source/Contrib/bin/7z.dll b/etc/source/Contrib/bin/7z.dll similarity index 100% rename from Other/Source/Contrib/bin/7z.dll rename to etc/source/Contrib/bin/7z.dll diff --git a/Other/Source/Contrib/bin/7z.exe b/etc/source/Contrib/bin/7z.exe similarity index 100% rename from Other/Source/Contrib/bin/7z.exe rename to etc/source/Contrib/bin/7z.exe diff --git a/Other/Source/Contrib/bin/7z.txt b/etc/source/Contrib/bin/7z.txt similarity index 97% rename from Other/Source/Contrib/bin/7z.txt rename to etc/source/Contrib/bin/7z.txt index 7c66b64..d7d62e6 100644 --- a/Other/Source/Contrib/bin/7z.txt +++ b/etc/source/Contrib/bin/7z.txt @@ -1,160 +1,160 @@ -Switch ao. The "ao" switch allows you to specify whether you want to overwrite old files. Be carefulyou cannot restore an overwritten file normally. This switch takes another argument. - -Switch -aoa: -This switch overwrites all destination files. Use it when the new versions are preferred. - -Switch -aos: -Skip over existing files without overwriting. Use this for files where the earliest version is most important. - -Switch -aou: -Avoid name collisions. New files extracted will have a number appending to their names. You will have to deal with them later. - -Switch -aot: -Rename existing files. This will not rename the new files, just the old ones already there. - -Examples: -7z x test.zip -aoa - -7z: use the 7-zip executable -x: use the extract command -test.zip: extract files from this archive --aoa: overwrite all existing files - -Command Line Syntax - -7z [...] [...] - ::= | | | -::= [