diff --git a/App/AppInfo/appinfo.ini b/App/AppInfo/appinfo.ini index e72b9ba..d4ad982 100755 --- a/App/AppInfo/appinfo.ini +++ b/App/AppInfo/appinfo.ini @@ -4,15 +4,15 @@ Version=3.5 [Details] Name=PortableApps Compiler -AppID=PortableAppsComiler -Publisher=demon.devin -Homepage=https://github.com/demondevin/pac-man +AppID=PortableAppsCompiler +Publisher=daemon.devin +Homepage=https://github.com/daemondevin/pac-man Category=Development Description=A better alternative to the PortableApps.com Launcher—PortableApps Compiler & Management Language=English [Team] -Developer=demon.devin +Developer=daemon.devin [License] Shareable=true @@ -21,8 +21,8 @@ Freeware=true CommercialUse=true [Version] -PackageVersion=2.0.1.0 -DisplayVersion=2.0.1 Dev +PackageVersion=2.1.0.0 +DisplayVersion=2.1.0 Dev [Control] Icons=1 diff --git a/PortableAppsCompiler.exe b/PortableAppsCompiler.exe index 80b4781..88d5fce 100644 Binary files a/PortableAppsCompiler.exe and b/PortableAppsCompiler.exe differ diff --git a/README.md b/README.md index ab5840c..9590d3c 100644 --- a/README.md +++ b/README.md @@ -24,17 +24,16 @@ With all that said, enjoy the fresh ideas which are currently being worked out. > | 7-ZipPortable.ini (User Config File) > | > +---app -> | +---AppInfo (Kept for Compatibility with PA.c Menu) +> | +---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) +> | | Installer.ini > | | EULA.txt -> | | ExtendedInstaller.nsh (Formally InstallerCustom.nsh) -> | | ExtendedWrapper.nsh (Formally Custom.nsh) +> | | ExtendWrapper.nsh (Formally Custom.nsh) +> | | Wrapper.ini (Formally Launcher.ini) > | | > | \---DefaultSettings (Formally DefaultData) > | | DEFAULT 7-ZIP SETTINGS HERE @@ -84,7 +83,7 @@ With all that said, enjoy the fresh ideas which are currently being worked out. ##### 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. +- 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 any more and most likely won't be able to pack your portable. However, I haven't tested this out yet. ## Features ---------- @@ -92,7 +91,7 @@ With all that said, enjoy the fresh ideas which are currently being worked out. 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. -- Manipulating Windows Services. +- Minipulating Windows Services. - Dealing with Windows Tasks. - Registering DLL files. - Registry redirection support. @@ -107,7 +106,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 environment variable. +- `%PROGRAMDATA%` has now been added and kept `%ALLUSERSAPPDATA%` for backwards compatibility. Both can be used anywhere you can use an evironment 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 @@ -120,6 +119,7 @@ Added new keys to the `[Activate]` section. They are as follows (a short descrip > Note: You should only use the following keys if you need them, otherwise they should be omitted entirely. ```INI [Activate] +DualMode=7-ZIP Registry=true RegRedirection=true RegCopyKeys=true @@ -138,12 +138,14 @@ FileCleanup=true DirectoryCleanup=true ``` +* __DualMode:__ For a x86_64 hybrid wrapper. If you want to run 32-bit/64-bit side-by-side in _"Dual Mode"_. Just specify a short name (usually the AppID in all caps) in which you may use inside the Wrapper.ini as an environment variable. (e.g. `%7-ZIP%`) + * __Registry:__ Add support for manipulating the Windows Registry. * __RegRedirection:__ Enable support for enabling/disabling registry redirection. * __RegCopyKeys:__ Enable support for copying registry keys to a special hive (`HKCU\Software\PortableApps.com`) before launching the application and restoring the keys after the application exits. See `RegistryCopyKeys.nsh` in the Segments directory. -> To use this feature add the section `[RegistryCopyKeys]` to the `Launcher.ini` file. Each entry should be the path to the registry key to be copied back and forth. Example usage: +> To use this feature add the section `[RegistryCopyKeys]` to the `Wrapper.ini` file. Each entry should be the path to the registry key to be copied back and forth. Example usage: > ```INI > [RegistryCopyKeys] > 1=HKCU\Software\MyProgram\ExtraCareNeededKey @@ -154,10 +156,10 @@ DirectoryCleanup=true * __ForceRedirection:__ Checks using the variable `$Bit` to disable/enable file system redirection. -* __ExecAsUser:__ For applications which need to run as normal user but need the launcher to have elevated privileges. [Read this](http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html) for more information on this concept. +* __ExecAsUser:__ For applications which need to run as normal user but need the wrapper to have elevated privileges. [Read this](http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html) for more information on this concept. * __Services:__ Add support for handling Windows Services. -> To use this feature add the section `[Service1]` (numerical ordering) to the `Launcher.ini` file. Each entry supports six keys which are as follows: +> To use this feature add the section `[Service1]` (numerical ordering) to the `Wrapper.ini` file. Each entry supports six keys which are as follows: | __Key__ | __Value__ | |:-------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | @@ -188,7 +190,7 @@ DirectoryCleanup=true > ``` * __RegDLLs:__ Add support for handling library (DLLs) file registration. -> To use this feature add the section `[RegisterDLL1]` (numerical ordering) to the `Launcher.ini` file. Each entry supports two keys; _ProgID_ (The DLL's ProgID) and _File_ (The path to DLL. Supports environment variables). Example usage: +> To use this feature add the section `[RegisterDLL1]` (numerical ordering) to the `Wrapper.ini` file. Each entry supports two keys; _ProgID_ (The DLL's ProgID) and _File_ (The path to DLL. Supports environment variables). Example usage: > ```INI > [RegisterDLL1] > ProgID=MyAppControlPanel @@ -200,7 +202,7 @@ DirectoryCleanup=true > ``` * __Tasks:__ Enable the TaskCleanup segment for removing any Windows Tasks that were added during runtime. -> To use this feature add the section `[TaskCleanup]` to the `Launcher.ini` file. Each entry should be the Windows Task name to be removed. Example usage: +> To use this feature add the section `[TaskCleanup]` to the `Wrapper.ini` file. Each entry should be the Windows Task name to be removed. Example usage: > ```INI > [TaskCleanup] > 1=MyAppTask1 @@ -215,7 +217,7 @@ DirectoryCleanup=true * __Ghostscript:__ Add Ghostscript support. -* __FontsFolder:__ Allows the portable application to support fonts within the directory `..\Data\Fonts`. Any fonts added in this folder will be added and are available for usage during runtime. Be aware, the more fonts to process the longer it will take for the launcher to load and unload these fonts. +* __FontsFolder:__ Allows the portable application to support fonts within the directory `..\Data\Fonts`. Any fonts added in this folder will be added and are available for usage during runtime. Be aware, the more fonts to process the longer it will take for the wrapper to load and unload these fonts. > Supported Fonts: > - .fon > - .fnt @@ -227,15 +229,15 @@ DirectoryCleanup=true > - .pfb > - .pfm -* __FileCleanup:__ Enable support for adding the section `[FilesCleanup]` in `Launcher.ini`. See `FilesCleanup.nsh` in the Segments directory. -> To use this feature add the section `[FilesCleanup]` to the `Launcher.ini` file. Each entry should be the path to the file that needs deleting. Supports environment variables. Example usage: +* __FileCleanup:__ Enable support for adding the section `[FilesCleanup]` in `Wrapper.ini`. See `FilesCleanup.nsh` in the Segments directory. +> To use this feature add the section `[FilesCleanup]` to the `Wrapper.ini` file. Each entry should be the path to the file that needs deleting. Supports environment variables. Example usage: > ```INI > [FilesCleanup] > 1=%PAC:DataDir%\uselessUpgradeFile.xml > 2=%APPDATA%\MyProgram\purposelessCfg.ini > ``` -* __DirectoryCleanup:__ Enable support for the sections `[DirectoriesCleanupIfEmpty]` and `[DirectoriesCleanupForce]` in `Launcher.ini`. See `DirectoriesCleanup.nsh` in the Segments directory. +* __DirectoryCleanup:__ Enable support for the sections `[DirectoriesCleanupIfEmpty]` and `[DirectoriesCleanupForce]` in `Wrapper.ini`. See `DirectoriesCleanup.nsh` in the Segments directory. ---------- @@ -257,7 +259,7 @@ CertTimestamp=VeriSign * __Creator:__ Specify here the original developer of the PAF if you're updating someone else's work. -* __CertSigning:__ If set to true, the `Launcher.exe` will automatically be signed using dual signature hashing algorithm standards (_SHA256_ and _SHA1_). I decided to use dual signing because Windows 8 supports SHA256 Code Signing Certificates (SHA-2 hashing algorithm); whereas, Windows 7 may only support SHA-1 Code Signing Certificates (SHA-1 hashing algorithm). It should be noted that Windows 10 has stopped accepting SHA-1 certificates and certificate chains for Authenticode-signed binaries (unless a timestamp marked the binary as being signed before 1/1/2016). You can visit this [Microsoft Security Advisory article][MSAdvisory] on the availability of SHA-2 code signing support for Windows 7 and Windows Server 2008 R2 for more information about this topic. +* __CertSigning:__ If set to true, the `Wrapper.exe` will automatically be signed using dual signature hashing algorithm standards (_SHA256_ and _SHA1_). I decided to use dual signing because Windows 8 supports SHA256 Code Signing Certificates (SHA-2 hashing algorithm); whereas, Windows 7 may only support SHA-1 Code Signing Certificates (SHA-1 hashing algorithm). It should be noted that Windows 10 has stopped accepting SHA-1 certificates and certificate chains for Authenticode-signed binaries (unless a timestamp marked the binary as being signed before 1/1/2016). You can visit this [Microsoft Security Advisory article][MSAdvisory] on the availability of SHA-2 code signing support for Windows 7 and Windows Server 2008 R2 for more information about this topic. >__*ATTENTION:*__ As it is written right now, the `PortableApps.comLauncherGenerator.exe` expects the certificate file to be the developer's name (same as the `[Team]Developer` key's value) and located in `..\Other\Source\Contrib\certificates`. > > _NOTE_: If your certificate requires you to use a password, refer to lines 741 and 742 and input your password on column 62. @@ -313,7 +315,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` through `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` thru `4.7` (*e.g.* `UsesDotNetVersion=1.1` or `UsesDotNetVersion=4.6.2`). * __UseStdUtils:__ Include the _StdUtils_ plug-in without `ExecAsUser` diff --git a/etc/help.html b/etc/help.html new file mode 100644 index 0000000..6a64c65 --- /dev/null +++ b/etc/help.html @@ -0,0 +1 @@ +

Dummy help file.

\ No newline at end of file diff --git a/etc/source/Debug.nsh b/etc/source/Debug.nsh index 4b2bf0e..e89d0dd 100644 --- a/etc/source/Debug.nsh +++ b/etc/source/Debug.nsh @@ -118,4 +118,4 @@ !macroend !define DebugMsg "!insertmacro DebugMsg" ; }}} -!include /NONFATAL "${PACKAGE}\app\AppInfo\ExtendedDebug.nsh" +!include /NONFATAL "${PACKAGE}\app\AppInfo\Debug.nsh" diff --git a/etc/source/Languages.nsh b/etc/source/Languages.nsh index 581ec95..35bf148 100644 --- a/etc/source/Languages.nsh +++ b/etc/source/Languages.nsh @@ -22,31 +22,70 @@ !appendfile "${LangAutoDetectFile}" "${Case} ${LANG_${_LANG}}$\n" !macroend !define IncludeLang "!insertmacro IncludeLang" - ${IncludeLang} ARABIC + ${IncludeLang} AFRIKAANS + ${IncludeLang} AZERBAIJANI + ${IncludeLang} BELARUSIAN + ${IncludeLang} BULGARIAN ${IncludeLang} CATALAN ${IncludeLang} CZECH - ${IncludeLang} DUTCH + ${IncludeLang} WELSH + ${IncludeLang} DANISH + ${IncludeLang} GERMAN + ${IncludeLang} GREEK ${IncludeLang} ENGLISH + ${IncludeLang} ESPERANTO + ${IncludeLang} SPANISH + ${IncludeLang} ESTONIAN + ${IncludeLang} BASQUE ${IncludeLang} FARSI ${IncludeLang} FINNISH ${IncludeLang} FRENCH - ${IncludeLang} GERMAN - ${IncludeLang} GREEK + ${IncludeLang} IRISH + ${IncludeLang} GALICIAN + ${IncludeLang} GUJARATI + ${IncludeLang} HEBREW + ${IncludeLang} HINDI + ${IncludeLang} CROATIAN ${IncludeLang} HUNGARIAN + ${IncludeLang} ARMENIAN + ${IncludeLang} INDONESIAN + ${IncludeLang} ICELANDIC ${IncludeLang} ITALIAN ${IncludeLang} JAPANESE + ${IncludeLang} GEORGIAN ${IncludeLang} KOREAN + ${IncludeLang} LITHUANIAN + ${IncludeLang} KURDISH + ${IncludeLang} LATVIAN + ${IncludeLang} MACEDONIAN + ${IncludeLang} MONGOLIAN + ${IncludeLang} MARATHI + ${IncludeLang} MALAY + ${IncludeLang} NORWEGIAN + ${IncludeLang} NEPALI + ${IncludeLang} DUTCH + ${IncludeLang} NORWEGIANNYNORSK + ${IncludeLang} PUNJABI ${IncludeLang} POLISH ${IncludeLang} PORTUGUESE ${IncludeLang} PORTUGUESEBR + ${IncludeLang} ROMANIAN ${IncludeLang} RUSSIAN - ${IncludeLang} SIMPCHINESE + ${IncludeLang} SINHALESE + ${IncludeLang} SLOVAK ${IncludeLang} SLOVENIAN - ${IncludeLang} SPANISH + ${IncludeLang} ALBANIAN + ${IncludeLang} SERBIAN + ${IncludeLang} SERBIANLATIN ${IncludeLang} SWEDISH - ${IncludeLang} TRADCHINESE + ${IncludeLang} TAMIL + ${IncludeLang} THAI ${IncludeLang} TURKISH + ${IncludeLang} UKRAINIAN + ${IncludeLang} VALENCIAN ${IncludeLang} VIETNAMESE + ${IncludeLang} SIMPCHINESE + ${IncludeLang} TRADCHINESE !macro LanguageCases !include "${LangAutoDetectFile}" !delfile "${LangAutoDetectFile}" diff --git a/etc/source/PortableAppsCompiler.nsi b/etc/source/PortableAppsCompiler.nsi index e878106..417ba27 100644 --- a/etc/source/PortableAppsCompiler.nsi +++ b/etc/source/PortableAppsCompiler.nsi @@ -49,7 +49,7 @@ ${!ECHO} "${NEWLINE}Reading/Writing Package Definitions...${NEWLINE}${NEWLINE}" !define CONF `${BIN}\Settings\Config` !define DEFSET `$EXEDIR\app\DefaultSettings` !define DEFCONF `${DEFSET}\Config` -!define WRAPPER `${APPINFO}\CompilerWrapper.ini` +!define WRAPPER `${APPINFO}\Wrapper.ini` !define WRAPPER2 `$PLUGINSDIR\wrapper.ini` !define RUNTIME `${BIN}\PortableAppsCompilerRuntimeData-${APPNAME}.ini` !define RUNTIME2 `$PLUGINSDIR\runtimedata.ini` @@ -223,6 +223,7 @@ ${!ECHO} "${NEWLINE}Loading language strings...${NEWLINE}${NEWLINE}" ;= ################ ${!ECHO} "${NEWLINE}Initialising variables and macros...${NEWLINE}${NEWLINE}" Var Bit +Var App Var Admin Var AppID Var BaseName @@ -330,11 +331,8 @@ VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion Portable ${Finalize::Sign} `${SHA256}` !endif -!verbose 4 - ;= FUNCTIONS ;= ################ -;=# Check 64-bit Function IsWOW64 !macro _WOW64 _RETURN Push ${_RETURN} @@ -347,9 +345,8 @@ Function IsWOW64 System::Call `${WOW}` Exch $0 FunctionEnd -;=# Prevent Shutdown !include nsDialogs.nsh -!define /ifndef WS_POPUP 0x80000000 +!define /ifndef WS_POPUP 0x80000000 !define CreateWinEx1 `USER32::CreateWindowEx(i0,t"STATIC",t"$(^Name)",` !define CreateWinEx2 `i${WS_CHILD}|${WS_POPUP},i0,i0,i0,i0,pr1,i0,i0,i0)p.r1` !define BlockReason1 `USER32::ShutdownBlockReasonCreate(pr1,w` @@ -361,26 +358,27 @@ Function CreateShutdownBlockReason ${EndIf} System::Call `${BlockReason1}${BlockReason2}` FunctionEnd -;=# Fonts Folder !ifdef FONTS_ENABLED - Function CreateFontsFolder - IfFileExists "${PACKAGE}\App\DefaultSettings\Fonts" +2 - CreateDirectory /SILENT "${PACKAGE}\App\DefaultSettings\Fonts" - IfFileExists "${PACKAGE}\App\DefaultSettings\Fonts\.Portable.Fonts.txt" +11 - !tempfile FONTFILE - !appendfile "${FONTFILE}" "Font(s) added here will be loaded on launch and accessible during runtime.$\n$\n" - !appendfile "${FONTFILE}" "NOTE:$\n" - !appendfile "${FONTFILE}" "$\tThe wrapper will have to load and unload any fonts in this directory.$\n" - !appendfile "${FONTFILE}" "$\tThe more fonts you have will mean a longer work load for the wrapper.$\n$\n" - !appendfile "${FONTFILE}" "Fonts Supported:$\n" - !appendfile "${FONTFILE}" " • .fon$\n • .fnt$\n • .ttf$\n • .ttc$\n • .fot$\n • .otf$\n • .mmm$\n • .pfb$\n • .pfm$\n" - !system 'copy /Y /A "${FONTFILE}" "${PACKAGE}\App\DefaultSettings\Fonts\.Portable.Fonts.txt" /A' - !delfile "${FONTFILE}" - !undef FONTFILE - FunctionEnd +Function CreateFontsFolder + IfFileExists "${PACKAGE}\App\DefaultSettings\Fonts" +2 + CreateDirectory /SILENT "${PACKAGE}\App\DefaultSettings\Fonts" + IfFileExists "${PACKAGE}\App\DefaultSettings\Fonts\.Portable.Fonts.txt" +11 + !tempfile FONTFILE + !appendfile "${FONTFILE}" "Font(s) added here will be loaded on launch and accessible during runtime.$\n$\n" + !appendfile "${FONTFILE}" "NOTE:$\n" + !appendfile "${FONTFILE}" "$\tThe wrapper will have to load and unload any fonts in this directory.$\n" + !appendfile "${FONTFILE}" "$\tThe more fonts you have will mean a longer work load for the wrapper.$\n$\n" + !appendfile "${FONTFILE}" "Fonts Supported:$\n" + !appendfile "${FONTFILE}" " • .fon$\n • .fnt$\n • .ttf$\n • .ttc$\n • .fot$\n • .otf$\n • .mmm$\n • .pfb$\n • .pfm$\n" + !system 'copy /Y /A "${FONTFILE}" "${PACKAGE}\App\DefaultSettings\Fonts\.Portable.Fonts.txt" /A' + !delfile "${FONTFILE}" + !undef FONTFILE +FunctionEnd !endif + +!verbose 4 + Function .onInit - Call CreateShutdownBlockReason Push $0 !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR !ifndef SYSTEMWIDE_DISABLEREDIR @@ -398,15 +396,22 @@ Function .onInit StrCpy $Bit 64 Goto +2 StrCpy $Bit 32 - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + !ifdef HYBRID + StrCmpS $Bit 32 +6 + IfFileExists `${EXE64}` 0 +5 + SetRegView 64 + StrCpy $App ${APP64} + System::Call `${SET64}` + Goto +3 + StrCpy $App ${APP} + System::Call `${SET32}` + !else if /FileExists "${EXE64}" + SetRegView 64 + StrCpy $App ${APP64} + !else + StrCpy $App ${APP} + !endif + ${DISABLE_REDIRECTION} ${RunSegment} Core ${RunSegment} Custom ${RunSegment} Temp @@ -415,30 +420,11 @@ Function .onInit !ifdef UAC ${RunSegment} RunAsAdmin !endif - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} Pop $0 FunctionEnd Function Init - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif - !ifdef FONTS_ENABLED - Call CreateFontsFolder - !endif + ${DISABLE_REDIRECTION} ${If} ${PrimaryInstance} ${RunSegment} Language ${RunSegment} Environment @@ -468,26 +454,13 @@ Function Init ${If} ${PrimaryInstance} ${RunSegment} Settings ${EndIf} - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif + !ifdef FONTS_ENABLED + Call CreateFontsFolder !endif + ${ENABLE_REDIRECTION} FunctionEnd Function Pre - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${If} ${PrimaryInstance} !ifdef SERVICES ${RunSegment} Services @@ -505,26 +478,10 @@ Function Pre ;${RunSegment} LastRunEnvironment ${RunSegment} Environment ${RunSegment} ExecString - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PrePrimary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${If} ${PrimaryInstance} !ifdef FileCleanup ${RunSegment} FilesCleanup @@ -553,7 +510,6 @@ Function PrePrimary !endif ${EndIf} !ifdef REGISTRY - ;=== this belongs here after Registering DLLs. ${RunSegment} RegistryValueWrite !endif ${If} ${PrimaryInstance} @@ -567,48 +523,15 @@ Function PrePrimary ${RunSegment} Fonts !endif ${EndIf} - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PreSecondary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${RunSegment} Custom - ;${RunSegment} * - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PreExec - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${RunSegment} Custom ${If} ${PrimaryInstance} !ifdef REGISTERDLL @@ -618,71 +541,22 @@ Function PreExec ${RunSegment} RefreshShellIcons ${RunSegment} WorkingDirectory ${RunSegment} RunBeforeAfter - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PreExecPrimary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${RunSegment} Custom ${RunSegment} Core ;${RunSegment} LastRunEnvironment - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PreExecSecondary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${RunSegment} Custom - ;${RunSegment} * - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function Execute - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} !ifmacrodef OverrideExecuteFunction !insertmacro OverrideExecuteFunction !else @@ -764,15 +638,7 @@ Function Execute ${EndIf} ${EndIf} !endif - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PostExecPrimary ${RunSegment} Custom @@ -785,15 +651,7 @@ Function PostExec ${RunSegment} Custom FunctionEnd Function PostPrimary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} ${If} ${PrimaryInstance} !ifdef REGISTERDLL ${RunSegment} RegisterDLL @@ -829,74 +687,24 @@ Function PostPrimary ${RunSegment} RunLocally ${RunSegment} Temp ${RunSegment} Custom - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function PostSecondary - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif - ;${RunSegment} * + ${DISABLE_REDIRECTION} ${RunSegment} Custom - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function Post - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif + ${DISABLE_REDIRECTION} !ifdef GHOSTSCRIPT ${RunSegment} Ghostscript !endif ${RunSegment} RefreshShellIcons ${RunSegment} Custom - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd Function Unload - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif - ;${RunSegment} XML + ${DISABLE_REDIRECTION} ${If} ${PrimaryInstance} !ifdef REGISTERDLL ${RunSegment} RegisterDLL @@ -916,15 +724,7 @@ Function Unload ${EndIf} ${RunSegment} Core ${RunSegment} Custom - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} FunctionEnd !define CallPS `!insertmacro CallPS` !macro CallPS _func _rev @@ -940,16 +740,9 @@ FunctionEnd Call ${_func} !endif !macroend -Section - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${DISABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${DISABLEREDIR}` - !endif - !endif +Section + Call CreateShutdownBlockReason + ${DISABLE_REDIRECTION} Call Init System::Call 'Kernel32::OpenMutex(i1048576, b0, t"${PAC}${APPNAME}-${APPNAME}::Starting") i.R0 ?e' System::Call 'Kernel32::CloseHandle(iR0)' @@ -989,15 +782,7 @@ Section ${CallPS} Post - ${EndIf} Call Unload - !ifdef SYSTEMWIDE_DISABLEREDIR - !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR - IntCmp $Bit 64 0 +2 +2 - System::Call `${ENABLEREDIR}` - !else - StrCmpS $APP ${APP64} 0 +2 - System::Call `${ENABLEREDIR}` - !endif - !endif + ${ENABLE_REDIRECTION} SectionEnd Function .onInstFailed Call Unload diff --git a/etc/source/PortableAppsCompilerDefines.nsh b/etc/source/PortableAppsCompilerDefines.nsh index 5955f4d..71a0b62 100644 --- a/etc/source/PortableAppsCompilerDefines.nsh +++ b/etc/source/PortableAppsCompilerDefines.nsh @@ -7,23 +7,38 @@ ; https://github.com/demondevin/pac-man ; ; PortableAppsCompilerDefines.nsh -; This file was automatically generated by the PortableApps Compiler and should not be edited! +; This file was generated automatically by the PortableApps Compiler. +; It's also created as well as deleted for each new creation process. ; -!define PORTABLEAPPNAME `Komodo IDE Portable` -!define FULLNAME `Komodo IDE` -!define APPNAME `KomodoIDEPortable` -!define APP `KomodoIDE` -!define APPDIR `$EXEDIR\bin\${APP}` -!define APP64 `KomodoIDE64` -!define APPDIR64 `$EXEDIR\bin\${APP64}` -!define PACKAGE_VERSION `11.0.1.0` -!define DEVELOPER `daemon.devin` -!define PUBLISHER `ActiveState Software Inc.` -!define OUTFILE `KomodoIDEPortable.exe` -!define NTFS -!define ConFunc -!define JSON -!define Sleep `500` +!define PORTABLEAPPNAME `7-Zip Portable` +!define FULLNAME `7-Zip` +!define APPNAME `7-ZipPortable` +!define PACKAGE_VERSION `16.4.0.0` +!define APP `7-Zip` +!define APPDIR `$EXEDIR\bin\${APP}` +!define 32 `7-Zip\7zFM.exe` +!define EXE32 `$EXEDIR\bin\${32}` +!define SET32 `Kernel32::SetEnvironmentVariable(t '7-ZIP', t '7-Zip')` +!define APP64 `7-Zip64` +!define APPDIR64 `$EXEDIR\bin\${APP64}` +!define 64 `7-Zip64\7zFM.exe` +!define EXE64 `$EXEDIR\bin\${64}` +!define SET64 `Kernel32::SetEnvironmentVariable(t '7-ZIP', t '7-Zip64')` +!define DEVELOPER `daemon.devin` +!define PUBLISHER `Igor Pavlov` +!define OUTFILE `7-ZipPortable.exe` +!define REPLACE +!define IsFileLocked +!ifndef CloseWindow + !define CloseWindow +!endif +!define Include_WinMessages +!define TrimString +!define CloseProc +!define 64.nsh +!define UAC +!define HYBRID !define REGISTRY -!define XML_PLUGIN -!define FONTS_ENABLE +!define SYSTEMWIDE_DISABLEREDIR +!define ExecAsUser +!define REGISTERDLL diff --git a/etc/source/PortableAppsCompilerMacros.nsh b/etc/source/PortableAppsCompilerMacros.nsh index b32db4a..dc88b40 100644 --- a/etc/source/PortableAppsCompilerMacros.nsh +++ b/etc/source/PortableAppsCompilerMacros.nsh @@ -101,3 +101,27 @@ !macro _DeleteSettings _KEY DeleteINIStr "${CONFIGINI}" "${APPNAME}Settings" "${_KEY}" !macroend +!define DISABLE_REDIRECTION "!insertmacro _DISABLE_REDIRECTION" +!macro _DISABLE_REDIRECTION + !ifdef SYSTEMWIDE_DISABLEREDIR + !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR + IntCmp $Bit 64 0 +2 +2 + System::Call `${DISABLEREDIR}` + !else + StrCmpS $APP ${APP64} 0 +2 + System::Call `${DISABLEREDIR}` + !endif + !endif +!macroend +!define ENABLE_REDIRECTION "!insertmacro _ENABLE_REDIRECTION" +!macro _ENABLE_REDIRECTION + !ifdef SYSTEMWIDE_DISABLEREDIR + !ifdef FORCE_SYSTEMWIDE_DISABLEREDIR + IntCmp $Bit 64 0 +2 +2 + System::Call `${ENABLEREDIR}` + !else + StrCmpS $APP ${APP64} 0 +2 + System::Call `${ENABLEREDIR}` + !endif + !endif +!macroend diff --git a/etc/source/Segments.nsh b/etc/source/Segments.nsh index 9839ece..b427c6f 100644 --- a/etc/source/Segments.nsh +++ b/etc/source/Segments.nsh @@ -121,4 +121,4 @@ !define OverrideExecute "!macro OverrideExecuteFunction" -!include /nonfatal "${PACKAGE}\app\AppInfo\ExtendedWrapper.nsh" +!include /nonfatal "${PACKAGE}\app\AppInfo\ExtendWrapper.nsh" diff --git a/etc/source/Segments/DirectX.nsh b/etc/source/Segments/DirectX.nsh new file mode 100644 index 0000000..9de671e --- /dev/null +++ b/etc/source/Segments/DirectX.nsh @@ -0,0 +1,125 @@ +;=# +; +; PORTABLEAPPS COMPILER +; Developed by daemon.devin +; +; For support visit the GitHub project: +; https://github.com/daemondevin/pac-man +; +; DirectX.nsh +; Checks for a local copy of a DirectX DLL and if not found, registers the DLLs in the portable CommonFiles folder. +; + +; ${FindRegDirectXRuntimes} "DLL" +!define FindRegDirectXRuntimes `!insertmacro _FindRegDirectXRuntimes` +!macro _FindRegDirectXRuntimes _DLL + StrCmpS $Bit 64 0 +6 + ${DISABLEREDIR} + IfFileExists "$SYSDIR\${_DLL}" +3 0 + IfFileExists "$PortableAppsCommonFiles\DirectX64\bin\${_DLL}" 0 +7 + ExecDos::Exec /TOSTACK /DISABLEFSR `"${REGSVR}" /s "$PortableAppsCommonFiles\DirectX64\bin\${_DLL}"` "" "" + ${ENABLEREDIR} + IfFileExists "$SYSDIR\${_DLL}" +3 0 + IfFileExists "$PortableAppsCommonFiles\DirectX\bin\${_DLL}" 0 +4 + ExecDos::Exec /TOSTACK `"${REGSVR}" /s "$PortableAppsCommonFiles\DirectX\bin\${_DLL}"` "" "" + Goto +5 + ${ENABLEREDIR} + MessageBox MB_ICONSTOP|MB_TOPMOST "The ${_DLL} runtime DLL was not found locally or portably!$\r$\n$\r$\nPlease install the DirectX Runtimes Portable plugin to play ${APPNAME}. Aborting!$\r$\n$\r$\nBoth x86/x64 DirectX plugins can be found at:$\r$\nhttp://softables.tk/depository/plugins" + Call Unload + Quit +!macroend +; ${UnRegDirectXRuntimes} "DLL" +!define UnRegDirectXRuntimes `!insertmacro _UnRegDirectXRuntimes` +!macro _UnRegDirectXRuntimes _DLL + ${IfThen} $Bit == 64 ${|} ${DISABLEREDIR} ${|} + ${IfNot} ${FileExists} "$SYSDIR\${_DLL}" + ${If} $Bit == 64 + ExecDos::Exec /TOSTACK /DISABLEFSR `"${REGSVR}" /s /u "$PortableAppsCommonFiles\DirectX64\bin\${_DLL}"` "" "" + ${Else} + ExecDos::Exec /TOSTACK `"${REGSVR}" /s /u "$PortableAppsCommonFiles\DirectX64\bin\${_DLL}"` "" "" + ${EndIf} + ${EndIf} + ${IfThen} $Bit == 64 ${|} ${ENABLEREDIR} ${|} +!macroend + +${SegmentFile} +${SegmentInit} + ; ${If} ${FileExists} "$PortableAppsDirectory\CommonFiles\DirectX64\bin\*.*" + ; FindFirst $0 $1 "$PortableAppsDirectory\CommonFiles\DirectX64\bin\*.dll" + ; ${ElseIf} ${FileExists} "$PortableAppsDirectory\CommonFiles\DirectX\bin\*.*" + ; FindFirst $0 $1 "$PortableAppsDirectory\CommonFiles\DirectX\bin\*.dll" + ; ${EndIf} + ; ${DoUntil} $1 == "" + ; ${FindRegDirectXRuntimes} "$1" + ; FindNext $0 $1 + ; ${Loop} + ; FindClose $0 + + ${FindRegDirectXRuntimes} "xactengine2_0.dll" + ${FindRegDirectXRuntimes} "xactengine2_1.dll" + ${FindRegDirectXRuntimes} "xactengine2_2.dll" + ${FindRegDirectXRuntimes} "xactengine2_3.dll" + ${FindRegDirectXRuntimes} "xactengine2_4.dll" + ${FindRegDirectXRuntimes} "xactengine2_5.dll" + ${FindRegDirectXRuntimes} "xactengine2_6.dll" + ${FindRegDirectXRuntimes} "xactengine2_7.dll" + ${FindRegDirectXRuntimes} "xactengine2_8.dll" + ${FindRegDirectXRuntimes} "xactengine2_9.dll" + ${FindRegDirectXRuntimes} "xactengine2_10.dll" + ${FindRegDirectXRuntimes} "xactengine3_0.dll" + ${FindRegDirectXRuntimes} "xactengine3_1.dll" + ${FindRegDirectXRuntimes} "xactengine3_2.dll" + ${FindRegDirectXRuntimes} "xactengine3_3.dll" + ${FindRegDirectXRuntimes} "xactengine3_4.dll" + ${FindRegDirectXRuntimes} "xactengine3_5.dll" + ${FindRegDirectXRuntimes} "xactengine3_6.dll" + ${FindRegDirectXRuntimes} "xactengine3_7.dll" + ${FindRegDirectXRuntimes} "XAudio2_0.dll" + ${FindRegDirectXRuntimes} "XAudio2_1.dll" + ${FindRegDirectXRuntimes} "XAudio2_2.dll" + ${FindRegDirectXRuntimes} "XAudio2_3.dll" + ${FindRegDirectXRuntimes} "XAudio2_4.dll" + ${FindRegDirectXRuntimes} "XAudio2_5.dll" + ${FindRegDirectXRuntimes} "XAudio2_6.dll" + ${FindRegDirectXRuntimes} "XAudio2_7.dll" +!macroend +${SegmentUnload} + ; ${If} ${FileExists} "$PortableAppsDirectory\CommonFiles\DirectX64\bin\*.*" + ; FindFirst $0 $1 "$PortableAppsDirectory\CommonFiles\DirectX64\bin\*.dll" + ; ${ElseIf} ${FileExists} "$PortableAppsDirectory\CommonFiles\DirectX\bin\*.*" + ; FindFirst $0 $1 "$PortableAppsDirectory\CommonFiles\DirectX\bin\*.dll" + ; ${EndIf} + ; ${DoUntil} $1 == "" + ; ${UnRegDirectXRuntimes} "$1" + ; FindNext $0 $1 + ; ${Loop} + ; FindClose $0 + + ${UnRegDirectXRuntimes} "xactengine2_0.dll" + ${UnRegDirectXRuntimes} "xactengine2_1.dll" + ${UnRegDirectXRuntimes} "xactengine2_2.dll" + ${UnRegDirectXRuntimes} "xactengine2_3.dll" + ${UnRegDirectXRuntimes} "xactengine2_4.dll" + ${UnRegDirectXRuntimes} "xactengine2_5.dll" + ${UnRegDirectXRuntimes} "xactengine2_6.dll" + ${UnRegDirectXRuntimes} "xactengine2_7.dll" + ${UnRegDirectXRuntimes} "xactengine2_8.dll" + ${UnRegDirectXRuntimes} "xactengine2_9.dll" + ${UnRegDirectXRuntimes} "xactengine2_10.dll" + ${UnRegDirectXRuntimes} "xactengine3_0.dll" + ${UnRegDirectXRuntimes} "xactengine3_1.dll" + ${UnRegDirectXRuntimes} "xactengine3_2.dll" + ${UnRegDirectXRuntimes} "xactengine3_3.dll" + ${UnRegDirectXRuntimes} "xactengine3_4.dll" + ${UnRegDirectXRuntimes} "xactengine3_5.dll" + ${UnRegDirectXRuntimes} "xactengine3_6.dll" + ${UnRegDirectXRuntimes} "xactengine3_7.dll" + ${UnRegDirectXRuntimes} "XAudio2_0.dll" + ${UnRegDirectXRuntimes} "XAudio2_1.dll" + ${UnRegDirectXRuntimes} "XAudio2_2.dll" + ${UnRegDirectXRuntimes} "XAudio2_3.dll" + ${UnRegDirectXRuntimes} "XAudio2_4.dll" + ${UnRegDirectXRuntimes} "XAudio2_5.dll" + ${UnRegDirectXRuntimes} "XAudio2_6.dll" + ${UnRegDirectXRuntimes} "XAudio2_7.dll" +!macroend diff --git a/etc/source/Version.nsh b/etc/source/Version.nsh index 1e36e13..b89d373 100644 --- a/etc/source/Version.nsh +++ b/etc/source/Version.nsh @@ -10,5 +10,5 @@ ; This file defines the version of PortableApps Compiler. ; -!define PACVER "2.0.1.0" -!define PACUSERVER "2.0.1" +!define PACVER "2.1.0.0" +!define PACUSERVER "2.1.0" diff --git a/etc/source/CompilerWizard.nsi b/etc/source/WrapperCompiler.nsi similarity index 50% rename from etc/source/CompilerWizard.nsi rename to etc/source/WrapperCompiler.nsi index da5adf0..af22e5f 100644 --- a/etc/source/CompilerWizard.nsi +++ b/etc/source/WrapperCompiler.nsi @@ -6,7 +6,7 @@ ; For support visit the GitHub project: ; https://github.com/demondevin/pac-man ; -; CompilerWizard.nsi +; WrapperCompiler.nsi ; Version 1.1 ; @@ -22,20 +22,24 @@ RequestExecutionLevel user ;= ################ !include RequireLatestNSIS.nsh +;= PAC VERSION +;= ################ +!include Version.nsh + ;= PAC DETAILS ;= ################ Name "PortableApps Compiler" OutFile ..\..\PortableAppsCompiler.exe Icon ..\..\app\AppInfo\appicon.ico Caption "PortableApps Compiler" -VIProductVersion 3.0.0.0 +VIProductVersion ${PACVER} 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 FileVersion ${PACVER} +VIAddVersionKey ProductVersion ${PACVER} VIAddVersionKey InternalName "PortableApps Compiler" VIAddVersionKey OriginalFilename PortableAppsCompiler.exe @@ -52,14 +56,15 @@ SetDatablockOptimize On !include FileFunc.nsh !include LogicLib.nsh !include MUI.nsh -;!include StrRep.nsh +!include nsDialogs.nsh !include NewTextReplace.nsh !AddPluginDir Plugins !include ReplaceInFileWithTextReplace.nsh +!include ForEachPath.nsh ;= ICON & STYLE ;= ################ -!define MUI_ICON "..\..\App\AppInfo\appicon.ico" +!define MUI_ICON "..\..\App\AppInfo\AppIcon.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_RIGHT !define MUI_HEADERIMAGE_BITMAP header.bmp @@ -77,11 +82,16 @@ Var PACKAGE Var SKIPWELCOMEPAGE Var AUTOMATICCOMPILE Var DEFINES +Var FGBUILD Var ERROROCCURED -Var AppShortname -Var AppFullname Var AppID +Var AppPName +Var AppFullname +Var AppShortname +Var AppVersion Var Name +Var Hybrid +Var CONVERT ;= PAGES ;= ################ @@ -99,7 +109,7 @@ Page instfiles !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 "$EXEDIR\bin\WrapperCompilerLog.txt" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME_TEXT "Review Log" !insertmacro MUI_PAGE_FINISH @@ -107,10 +117,29 @@ Page instfiles ;= 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}" +!define DBUG "Debug.nsh" +!define APPINFOINI "AppInfo.ini" +!define WRAPPERINI "Wrapper.ini" +!define INSTALLINI "Installer.ini" +!define EXTEND "ExtendWrapper.nsh" +!define EXTINS "ExtendInstaller.nsh" +!define APPINFOPATH "$PACKAGE\App\AppInfo\${APPINFOINI}" +!define WRAPPERPATH "$PACKAGE\App\AppInfo\${WRAPPERINI}" +!define EXTENDPATH "$PACKAGE\App\AppInfo\${EXTEND}" +!define EXTINSPATH "$PACKAGE\App\AppInfo\${EXTINS}" +!define DEFINEINC "$EXEDIR\etc\Source\PortableAppsCompilerDefines.nsh" +!define DEFHEADER "${DEFHEADER1}${DEFHEADER2}${DEFHEADER3}${DEFHEADER4}${DEFHEADER5}" +!define DEFHEADER1 ";=# ${NEWLINE}; ${NEWLINE}; PORTABLEAPPS COMPILER${NEWLINE}; Developed by daemon.devin" +!define DEFHEADER2 "${NEWLINE}; ${NEWLINE}; For support visit the GitHub project:${NEWLINE}; " +!define DEFHEADER3 "https://github.com/demondevin/pac-man${NEWLINE}; ${NEWLINE}; PortableAppsCompilerDefines.nsh${NEWLINE}; " +!define DEFHEADER4 "This file was generated automatically by the PortableApps Compiler.${NEWLINE}; " +!define DEFHEADER5 "It's also created as well as deleted for each new creation process.${NEWLINE}; ${NEWLINE}" +!define EXTHEADER "${NEWLINE}${EXTHEADER1}${EXTHEADER2}${EXTHEADER3}${EXTHEADER4}" +!define EXTHEADER1 ";= WRAPPER${NEWLINE};= ################${NEWLINE}; " +!define EXTHEADER2 "This portable application was compiled with${NEWLINE}; " +!define EXTHEADER3 "PortableApps Compiler: Development Edition:${NEWLINE}; " +!define EXTHEADER4 "https://github.com/daemondevin/pac-man/tree/dev${NEWLINE}; ${NEWLINE}" +!define PAInstaller "${EXTINS} -> PortableApps.comInstallerCustom.nsh${NEWLINE}I haven't built an installer compiler yet.${NEWLINE}${NEWLINE}Creating a dummy help.html file so you can still package this build with PA.c Installer" ;= MACROS ;= ################ @@ -120,15 +149,20 @@ Page instfiles !macroend !define ReadWrapperConfig `!insertmacro _ReadWrapperConfig` !macro _ReadWrapperConfig _VALUE _SECTION _KEY - ReadINIStr ${_VALUE} `${_}\App\AppInfo\CompilerWrapper.ini` `${_SECTION}` `${_KEY}` + ReadINIStr ${_VALUE} `${_}\App\AppInfo\${WRAPPERINI}` `${_SECTION}` `${_KEY}` !macroend !define WriteDefineConfig "!insertmacro _WriteDefineConfig" -!macro _WriteDefineConfig _DEFINE _VALUE +!macro _WriteDefineConfig _DEFINE _VALUE _TAB !if ! "${_VALUE}" == "" - FileWrite $DEFINES "!define ${_DEFINE} `${_VALUE}`${NEWLINE}" + DetailPrint "Defining ${_DEFINE}" + SetDetailsPrint none + FileWrite $DEFINES "!define ${_DEFINE}${_TAB}`${_VALUE}`${NEWLINE}" !else + DetailPrint "Defining ${_DEFINE} -> ${_VALUE}" + SetDetailsPrint none FileWrite $DEFINES "!define ${_DEFINE}${NEWLINE}" !endif + SetDetailsPrint lastused !macroend !define AddConditionIfNot "!insertmacro _AddConditionIfNot" !macro _AddConditionIfNot _DEFINE @@ -136,7 +170,7 @@ Page instfiles !macroend !define WriteErrorLog "!insertmacro _WriteErrorLog" !macro _WriteErrorLog _ERROR - FileOpen $9 "$EXEDIR\bin\PortableAppsCompilerLog.txt" a + FileOpen $9 "$EXEDIR\bin\WrapperCompilerLog.txt" a FileSeek $9 0 END FileWrite $9 `ERROR: ${_ERROR}` FileWriteByte $9 "13" @@ -147,7 +181,7 @@ Page instfiles !define ConvertPath "!insertmacro _ConvertPath" !macro _ConvertPath _SOURCE _TARGET ${If} ${FileExists} "$PACKAGE\${_SOURCE}" - DetailPrint "${_SOURCE} -> ${_TARGET}" + DetailPrint "Moving ${_SOURCE} -> ${_TARGET}" SetDetailsPrint none Rename "$PACKAGE\${_SOURCE}" "$PACKAGE\${_TARGET}" SetDetailsPrint lastused @@ -158,13 +192,27 @@ Page instfiles 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 +!define PromptUserInput "!insertmacro _PromptUserInput" +!macro _PromptUserInput _BOXTITLE _FILE _SECTION _KEY _PROMPT _DEFAULTVALUE _VALUE _REQUIRED + ReadINIStr ${_VALUE} "${_FILE}" "${_SECTION}" "${_KEY}" + ${If} ${_VALUE} == "" + StrCpy $9 "${_DEFAULTVALUE}" + DialogsW::InputBox 0 "${_BOXTITLE}" "${_PROMPT}" "OK" "Cancel" 8 9 + ${If} $8 == 1 + StrCpy ${_VALUE} $9 + WriteINIStr "${_FILE}" "${_SECTION}" "${_KEY}" $9 + !if ${_REQUIRED} == required + ${Else} + ${WriteErrorLog} "[${_SECTION}]:${_KEY} is missing from ${_FILE}." + !endif + ${EndIf} + ${EndIf} !macroend ;= LANGUAGES @@ -173,15 +221,182 @@ Page instfiles ;= FUNCTIONS ;= ################ +Function LineReadInFile + !define LineReadInFile `!insertmacro _LineReadInFile` + !macro _LineReadInFile _FILE _NUMBER _RESULT + Push `${_FILE}` + Push `${_NUMBER}` + Call LineReadInFile + Pop ${_RESULT} + !macroend + + Exch $1 + Exch + Exch $0 + Exch + Push $2 + Push $3 + Push $4 + ClearErrors + + IfFileExists $0 0 error + IntOp $1 $1 + 0 + IntCmp $1 0 error 0 plus + StrCpy $4 0 + FileOpen $2 $0 r + IfErrors error + FileRead $2 $3 + IfErrors +3 + IntOp $4 $4 + 1 + Goto -3 + FileClose $2 + IntOp $1 $4 + $1 + IntOp $1 $1 + 1 + IntCmp $1 0 error error + + plus: + FileOpen $2 $0 r + IfErrors error + StrCpy $3 0 + IntOp $3 $3 + 1 + FileRead $2 $0 + IfErrors +4 + StrCmp $3 $1 0 -3 + FileClose $2 + goto end + FileClose $2 + + error: + SetErrors + StrCpy $0 '' + + end: + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch $0 +FunctionEnd +Function AddToLineInFile + !define AddToLineInFile `!insertmacro _AddToLineInFile` + !macro _AddToLineInFile _FILE _NUMBER _STRING + Push `${_STRING}` + Push `${_NUMBER}` + Push `${_FILE}` + Call AddToLineInFile + !macroend + + Exch $0 + Exch + Exch $1 + Exch 2 + Exch $2 + Exch 2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + + GetTempFileName $7 + FileOpen $4 $0 r + FileOpen $5 $7 w + StrCpy $3 0 + + Loop: + ClearErrors + FileRead $4 $6 + IfErrors Exit + IntOp $3 $3 + 1 + StrCmp $3 $1 0 +3 + FileWrite $5 "$2$\r$\n$6" + FileWrite $5 "$2$\r$\n" + Goto Loop + FileWrite $5 $6 + Goto Loop + Exit: + + FileClose $5 + FileClose $4 + + SetDetailsPrint none + Delete $0 + Rename $7 $0 + SetDetailsPrint both + + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd +Function ReplaceLineInFile + !define ReplaceLineInFile `!insertmacro _ReplaceLineInFile` + !macro _ReplaceLineInFile _FILE _NUMBER _STRING + Push `${_STRING}` + Push `${_NUMBER}` + Push `${_FILE}` + Call ReplaceLineInFile + !macroend + + Exch $0 + Exch + Exch $1 + Exch 2 + Exch $2 + Exch 2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + + GetTempFileName $7 + FileOpen $4 $0 r + FileOpen $5 $7 w + StrCpy $3 0 + + Loop: + ClearErrors + FileRead $4 $6 + IfErrors Exit + IntOp $3 $3 + 1 + StrCmp $3 $1 0 +3 + FileWrite $5 "$2$\r$\n" + Goto Loop + FileWrite $5 $6 + Goto Loop + Exit: + + FileClose $5 + FileClose $4 + + SetDetailsPrint none + Delete $0 + Rename $7 $0 + SetDetailsPrint both + + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd Function .onInit - !insertmacro MUI_INSTALLOPTIONS_EXTRACT "CompilerWizardForm.ini" + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "WrapperCompilerForm.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 + ReadINIStr $SKIPWELCOMEPAGE $EXEDIR\bin\settings.ini WrapperCompiler SkipWelcomePage + ReadINIStr $0 $EXEDIR\bin\settings.ini WrapperCompiler Drive + ReadINIStr $PACKAGE $EXEDIR\bin\settings.ini WrapperCompiler Package ; Update drive letter; doesn't matter if $0 == "" StrLen $1 $0 StrCpy $2 $PACKAGE $1 @@ -191,10 +406,10 @@ Function .onInit ${EndIf} ;StrCpy $NSIS "$EXEDIR\App\NSIS\makensis.exe" - ReadINIStr $NSIS $EXEDIR\bin\settings.ini CompilerWizard makensis + ReadINIStr $NSIS $EXEDIR\bin\settings.ini WrapperCompiler makensis ${If} $NSIS == "" StrCpy $NSIS ..\NSISPortable\App\NSIS\makensis.exe - WriteINIStr $EXEDIR\bin\settings.ini CompilerWizard makensis $NSIS + WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler makensis $NSIS ${EndIf} ${GetParameters} $R0 @@ -210,7 +425,7 @@ Function .onInit PreFillForm: ;=== Pre-Fill Path with Directory - WriteINIStr $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" "$PACKAGE" + WriteINIStr $PLUGINSDIR\WrapperCompilerForm.ini "Field 2" "State" "$PACKAGE" FunctionEnd Function ShowWelcomeWindow @@ -222,21 +437,21 @@ 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" + InstallOptions::InitDialog /NOUNLOAD "$PLUGINSDIR\WrapperCompilerForm.ini" Pop $0 InstallOptions::Show FunctionEnd Function LeaveOptionsWindow - ReadINIStr $PACKAGE $PLUGINSDIR\CompilerWizardForm.ini "Field 2" "State" + ReadINIStr $PACKAGE $PLUGINSDIR\WrapperCompilerForm.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 + WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler Drive $0 + WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler Package $PACKAGE FunctionEnd Function ConvertLanguageEnvironmentVariables @@ -257,13 +472,14 @@ Function ConvertLanguageEnvironmentVariables ${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 + ${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 + ${ReplaceInFileUTF16LE} $9 PAL:LanguageCustom PAC:LanguageCustom ${Else} ; Convert old PAL to PAC ${ReplaceInFile} $9 PortableApps.comLanguageCode PAC:LanguageCode @@ -274,13 +490,14 @@ Function ConvertLanguageEnvironmentVariables ${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 + ${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 + ${ReplaceInFile} $9 PAL:LanguageCustom PAC:LanguageCustom ${EndIf} SetDetailsPrint lastused FunctionEnd @@ -326,6 +543,7 @@ Function ConvertDefines ${ReplaceInFileUTF16LE} $9 PAL:LocaleWinName PAC:LanguageNSIS ${ReplaceInFileUTF16LE} $9 PAL:LocaleName PAC:LanguageName ${ReplaceInFileUTF16LE} $9 PAL:LocaleID PAC:LanguageLCID + ${ReplaceInFileUTF16LE} $9 PAL:LanguageCustom PAC:LanguageCustom ${Else} ${ReplaceInFile} $9 PortableApps.comLanguageCode PortableAppsLanguageCode ${ReplaceInFile} $9 PortableApps.comLocaleCode2 PortableAppsLocaleCode2 @@ -358,6 +576,7 @@ Function ConvertDefines ${ReplaceInFile} $9 PAL:LocaleWinName PAC:LanguageNSIS ${ReplaceInFile} $9 PAL:LocaleName PAC:LanguageName ${ReplaceInFile} $9 PAL:LocaleID PAC:LanguageLCID + ${ReplaceInFile} $9 PAL:LanguageCustom PAC:LanguageCustom ${EndIf} SetDetailsPrint lastused FunctionEnd @@ -366,7 +585,7 @@ 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" + 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, [WrapperCompiler]:makensis" Abort ${EndIf} @@ -378,371 +597,542 @@ Section Main 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" + RealProgress::GradualProgress /NOUNLOAD 1 20 90 "Process complete." + + ${IfNot} ${FileExists} "${APPINFOPATH}" + StrCpy $ERROROCCURED true + ${WriteErrorLog} "${APPINFOPATH} doesn't exist!" + ${Else} + ${PromptUserInput} \ + "Package Name" \ + "${APPINFOPATH}" \ + "Details" \ + "Name" \ + "What's this package's name? (e.g. Discord Portable):" \ + "App Portable" \ + $Name \ + required + ${PromptUserInput} \ + "Package AppID" \ + "${APPINFOPATH}" \ + "Details" \ + "AppID" \ + "Enter the package's name with no spaces (e.g. DiscordPortable):" \ + "AppPortable" \ + $AppID \ + required + ${PromptUserInput} \ + "Package Version" \ + "${APPINFOPATH}" \ + "Version" \ + "PackageVersion" \ + "Enter the package's version (e.g. 1.2.3.4):" \ + "1.2.3.4" \ + $AppVersion \ + required + + StrCpy $1 $Name "" -8 + ${If} $1 == "Portable" + StrCpy $AppPName $Name + ${Else} + StrCpy $AppPName "$Name Portable" + ${EndIf} + StrCpy $1 $Name "" -8 + ${If} $1 == "Portable" + StrCpy $AppFullname $Name -9 + ${Else} + StrCpy $AppFullname "$Name" + ${EndIf} + StrCpy $1 $AppID "" -8 + ${If} $1 == "Portable" + StrCpy $AppShortname $AppID -8 + ${Else} + StrCpy $AppShortname $AppID + ${EndIf} + + ;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} - ; 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} + ; Check for old PAF builds and convert them to the new format... + DetailPrint "Checking for old PAF build to convert to the new format..." + DetailPrint " " + + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\*.*" + StrCpy $CONVERT true + ${EndIf} + + SetDetailsPrint none + ${IfNot} ${FileExists} "$PACKAGE\bin\*.*" + CreateDirectory "$PACKAGE\bin" + ${EndIf} + ${IfNot} ${FileExists} "$PACKAGE\etc\*.*" + CreateDirectory "$PACKAGE\etc" + ${EndIf} + SetDetailsPrint lastused + + ${If} $CONVERT == true + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\Custom.nsh" + ${ConvertPath} "App\AppInfo\Launcher\Custom.nsh" "App\AppInfo\${EXTEND}" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\Debug.nsh" + ${ConvertPath} "App\AppInfo\Launcher\Debug.nsh" "App\AppInfo\${DBUG}" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\AppInfo\instsller.ini" + ${ConvertPath} "App\AppInfo\installer.ini" "App\AppInfo\${INSTALLINI}" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\$AppID.ini" + ${ConvertPath} "App\AppInfo\Launcher\$AppID.ini" "App\AppInfo\${WRAPPERINI}" + ${If} ${FileExists} "$PACKAGE\App\AppInfo\Launcher\Source\*.*" + StrCpy $FGBUILD true + DetailPrint "Found a PAF built by FukenGruven!" + DetailPrint "Preserving his old source files..." + DetailPrint "Moving App\AppInfo\Launcher\Source -> etc\FGSource" + SetDetailsPrint none + CopyFiles /SILENT "$PACKAGE\App\AppInfo\Launcher\Source" "$PACKAGE\etc\FGSource" + RMDir /r "$PACKAGE\App\AppInfo\Launcher\Source" + ${EndIf} + RMDir /r "$PACKAGE\App\AppInfo\Launcher" + SetDetailsPrint lastused + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\$AppShortname\*.*" + DetailPrint "Moving the 32-bit application files..." + DetailPrint "Moving App\$AppShortname -> bin\$AppShortname" + SetDetailsPrint none + CopyFiles /SILENT "$PACKAGE\App\$AppShortname" "$PACKAGE\bin\$AppShortname" + RMDir /r "$PACKAGE\App\$AppShortname" + SetDetailsPrint lastused + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\$AppShortname64\*.*" + DetailPrint "Moving the 64-bit application files..." + DetailPrint "Moving App\$AppShortname64 -> bin\$AppShortname64" + SetDetailsPrint none + CopyFiles /SILENT "$PACKAGE\App\$AppShortname64" "$PACKAGE\bin\$AppShortname64" + RMDir /r "$PACKAGE\App\$AppShortname64" + SetDetailsPrint lastused + ${EndIf} + ${If} ${FileExists} "$PACKAGE\App\DefaultData\*.*" + ${If} ${FileExists} "$PACKAGE\App\DefaultData\settings\*.*" + ${ConvertPath} "App\DefaultData\settings" "App\DefaultData\Config" + ${EndIf} + ${ConvertPath} "App\DefaultData" "App\DefaultSettings" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Data\*.*" + ${If} ${FileExists} "$PACKAGE\Data\settings\*.*" + ${ConvertPath} "Data\settings" "Data\Config" + ${EndIf} + DetailPrint "Moving Data -> bin\Settings" + SetDetailsPrint none + CopyFiles /SILENT "$PACKAGE\Data" "$PACKAGE\bin\Settings" + RMDir /r "$PACKAGE\Data" + SetDetailsPrint lastused + ${EndIf} + SetDetailsPrint none + ${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\Other\Source\LauncherLicense.txt" + Delete "$PACKAGE\Other\Source\LauncherLicense.txt" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\COPYING" + Delete "$PACKAGE\Other\Source\COPYING" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\*.*" + ${If} ${FileExists} "$PACKAGE\Other\Help\*.*" + RMDir /r "$PACKAGE\Other\Help" + ${EndIf} + SetDetailsPrint lastused + ${If} ${FileExists} "$PACKAGE\Other\Source\Readme.txt" + ${ConvertPath} "Other\Source\Readme.txt" "etc\README" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\notes.txt" + ${ConvertPath} "Other\notes.txt" "etc\NOTES" + ${EndIf} + ${If} ${FileExists} "$PACKAGE\Other\Source\$AppID.ini" + ${ConvertPath} "Other\Source\$AppID.ini" "etc\$AppID.ini" + ${EndIf} + ${ForEachFile} $5 $6 "$PACKAGE\Other\Source\*.*" + Rename "$5\$6" "etc\$6" + ${NextFile} + ${ForEachFile} $5 $6 "$PACKAGE\Other\*.*" + Rename "$5\$6" "etc\$6" + ${NextFile} + ${If} ${FileExists} "$PACKAGE\Other\Source\PortableApps.comInstallerCustom.nsh" + ${ConvertPath} "Other\Source\PortableApps.comInstallerCustom.nsh" "App\AppInfo\${EXTINS}" + ${EndIf} + SetDetailsPrint none + ${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" + ClearErrors + ${If} ${FileExists} "$PACKAGE\App\AppInfo\${EXTINS}" + MessageBox MB_ICONEXCLAMATION|MB_TOPMOST "${PAInstaller}" + DetailPrint "Converting ${EXTINS} -> PortableApps.comInstallerCustom.nsh" + ${IfNot} ${FileExists} "$PACKAGE\Other\Source\*.*" + CreateDirectory "$PACKAGE\Other\Source" + ${EndIf} + Rename "$PACKAGE\App\AppInfo\${EXTINS}" "$PACKAGE\Other\Source\PortableApps.comInstallerCustom.nsh" + CopyFiles /SILENT "$EXEDIR\etc\*.html" "$PACKAGE" + ${EndIf} + ; ReadINIStr $0 $EXEDIR\bin\settings.ini WrapperCompiler notified + ; ${If} ${Errors} + ; ${AndIf} $0 != true + ; ReadINIStr $1 $EXEDIR\bin\settings.ini WrapperCompiler help + ; ${If} $1 != false + ; MessageBox MB_ICONEXCLAMATION|MB_TOPMOST "The Help.html was deleted but creating a dummy one now.$\r$\n$\r$\nThis is so you can use the PA.c Installer to package this build." + ; CopyFiles /SILENT "$EXEDIR\etc\*.html" "$PACKAGE" + ; WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler notified true + ; ${EndIf} + ; MessageBox MB_ICONQUESTION|MB_YESNO|MB_TOPMOST "Keep creating the dummy help.html file for future builds?" /SD IDYES IDNO _DUMMY_NO + ; WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler help true + ; Goto _DUMMY_END + ; _DUMMY_NO: + ; WriteINIStr $EXEDIR\bin\settings.ini WrapperCompiler help false + ; Delete "$PACKAGE\help.html" + ; MessageBox MB_ICONEXCLAMATION|MB_TOPMOST "Okay. Deleting current help.html file...$\r$\n$\r$\nFuture builds won't have it either!" + ; _DUMMY_END: + ; MessageBox MB_ICONEXCLAMATION|MB_TOPMOST "That was the last time you will see that message." ; ${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} + SetDetailsPrint lastused + + ; Check for old PAF builds and convert them to the new format... + DetailPrint "Process complete." + DetailPrint " " + DetailPrint "Converting all old variables to the new variables..." + DetailPrint "For Example: %PAL:AppDir% -> %PAC:AppDir%" + DetailPrint " " + SetDetailsPrint none + ${StringConvertInFile} "$PACKAGE\bin\Settings\Config\$AppIDSettings.ini" "PAL:" "PAC:" + ${StringConvertInFile} "$PACKAGE\bin\Settings\Config\$AppIDSettings.ini" "PortableApps.comLauncher" "PortableAppsCompiler" + ${StringConvertInFile} "${WRAPPERPATH}" "%PAL:" "%PAC:" + ${StringConvertInFile} "${WRAPPERPATH}" "PortableApps.comLauncher" "PortableAppsCompiler" + ${StringConvertInFile} "${WRAPPERPATH}" "PortableApps.com" "PortableApps" + + Push "${WRAPPERPATH}" + Call ConvertLanguageEnvironmentVariables + Push "${EXTENDPATH}" + Call ConvertDefines + SetDetailsPrint lastused + DetailPrint "Process complete." + DetailPrint " " + ${Else} + DetailPrint "No conversion needed." + DetailPrint " " ${EndIf} + + SetDetailsPrint none + ${If} ${FileExists} "${EXTENDPATH}" + ${LineReadInFile} "${EXTENDPATH}" "2" $R0 + ${If} $R0 != ";= WRAPPER$\r$\n" + FileOpen $0 "${EXTENDPATH}" r + FileOpen $1 "${EXTENDPATH}.temp" w - ; 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 " " + FileWrite $1 "${EXTHEADER}" + FileWriteByte $1 "13" + FileWriteByte $1 "10" + _EXT_LOOP: + ClearErrors + FileReadByte $0 $2 + IfErrors _EXT_DONE + FileWriteByte $1 $2 + Goto _EXT_LOOP + _EXT_DONE: + FileClose $0 + FileClose $1 + + Delete "${EXTENDPATH}" + Rename "${EXTENDPATH}.temp" "${EXTENDPATH}" + ${ElseIf} $R0 == ";= LAUNCHER$\r$\n" + ${ReplaceLineInFile} "${EXTENDPATH}" "2" ";= WRAPPER" + ${ReplaceLineInFile} "${EXTENDPATH}" "4" "; This portable application was compiled with" + ${ReplaceLineInFile} "${EXTENDPATH}" "5" "; PortableApps Compiler: Development Edition:" + ${LineReadInFile} "${EXTENDPATH}" "6" $R0 + ${If} $R0 == "$\r$\n" + ${AddToLineInFile} "${EXTENDPATH}" "6" "$\r$\n" + ${EndIf} + ${ReplaceLineInFile} "${EXTENDPATH}" "6" "; https://github.com/daemondevin/pac-man/tree/dev" + ${LineReadInFile} "${EXTENDPATH}" "7" $R0 + ${If} $R0 == "$\r$\n" + ${AddToLineInFile} "${EXTENDPATH}" "7" "$\r$\n" + ${EndIf} + ${ReplaceLineInFile} "${EXTENDPATH}" "7" "; " + ${EndIf} + ${EndIf} + SetDetailsPrint lastused - DetailPrint "Compiling portable wrapper..." + DetailPrint "Compiling the portable wrapper..." + DetailPrint " " SetDetailsPrint none - Delete "$EXEDIR\bin\PortableAppsCompilerLog.txt" + Delete "$EXEDIR\bin\WrapperCompilerLog.txt" - Delete "${DEFINES}" + Delete "${DEFINEINC}" !ifdef CustomIconAndName !define _ $PACKAGE !else !define _ $EXEDIR !endif + SetDetailsPrint lastused - Delete "${DEFINES}" - - ; Read/write the needed defines to PortableAppsCompilerDefines.nsh - FileOpen $DEFINES "${DEFINES}" a - FileSeek $DEFINES 0 END - FileWrite $DEFINES `${DEFSTART}` + ; Read/write the needed defines to PortableAppsCompilerDefines.nsh + DetailPrint "Writing the wrapper's configuration settings..." + DetailPrint " " + FileOpen $DEFINES "${DEFINEINC}" w + FileWrite $DEFINES "${DEFHEADER}" + FileWriteByte $9 "13" + FileWriteByte $9 "10" ${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" + ${WriteDefineConfig} "PORTABLEAPPNAME" "$AppPName" "$\t" + ${WriteDefineConfig} "FULLNAME" "$AppFullname" "$\t$\t" + ${WriteDefineConfig} "APPNAME" "$AppID" "$\t$\t$\t" + ${WriteDefineConfig} "PACKAGE_VERSION" "$AppVersion" "$\t" - ${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" + ClearErrors + ${ReadWrapperConfig} $Hybrid "Activate" "DualMode" + ${IfNot} ${Errors} + ${AndIf} $Hybrid != "" + ${WriteDefineConfig} "APP" "$AppShortname" "$\t$\t$\t$\t" + ${WriteDefineConfig} "APPDIR" "$$EXEDIR\bin\$${APP}" "$\t$\t$\t" + ${ReadWrapperConfig} $0 "Launch" "ProgramExecutable" + ${IfNot} ${Errors} + ${WriteDefineConfig} "32" "$0" "$\t$\t$\t$\t" + ${WriteDefineConfig} "EXE32" "$$EXEDIR\bin\$${32}" "$\t$\t$\t" + ${WriteDefineConfig} "SET32" "Kernel32::SetEnvironmentVariable(t'$Hybrid',t'$AppShortname')" "$\t$\t$\t" + ${EndIf} + ${WriteDefineConfig} "APP64" "$AppShortname64" "$\t$\t$\t" + ${WriteDefineConfig} "APPDIR64" "$$EXEDIR\bin\$${APP64}" "$\t$\t" + ClearErrors + ${ReadWrapperConfig} $0 "Launch" "ProgramExecutable64" + ${IfNot} ${Errors} + ${WriteDefineConfig} "64" "$0" "$\t$\t$\t$\t" + ${WriteDefineConfig} "EXE64" "$$EXEDIR\bin\$${64}" "$\t$\t$\t" + ${WriteDefineConfig} "SET64" "Kernel32::SetEnvironmentVariable(t'$Hybrid',t'$AppShortname64')" "$\t$\t$\t" + ${EndIf} ${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?" + ${ReadWrapperConfig} $0 "Launch" "ProgramExecutable64" + ${IfNot} ${Errors} + ${WriteDefineConfig} "APP64" "$AppShortname64" "$\t$\t$\t$\t" + ${WriteDefineConfig} "APPDIR64" "$$EXEDIR\bin\$${APP64}" "$\t$\t$\t" + ${Else} + ${WriteDefineConfig} "APP" "$AppShortname" "$\t$\t$\t$\t" + ${WriteDefineConfig} "APPDIR" "$$EXEDIR\bin\$${APP}" "$\t$\t$\t" ${EndIf} ${EndIf} - ClearErrors - ${ReadAppInfoConfig} $0 "Team" "Developer" + ${PromptUserInput} \ + "Developer" \ + "${_}\App\AppInfo\AppInfo.ini" \ + "Team" \ + "Developer" \ + "Who's making this package? (e.g. daemon.devin):" \ + "PortableAppsCompiler" \ + $0 \ + optional ${If} $0 == "demon.devin" StrCpy $0 "daemon.devin" + WriteINIStr "${_}\App\AppInfo\AppInfo.ini" "Team" "Developer" "$0" ${EndIf} - ${WriteDefineConfig} "DEVELOPER" "$0" + ${WriteDefineConfig} "DEVELOPER" "$0" "$\t$\t" ClearErrors ${ReadAppInfoConfig} $0 "Team" "Contributors" ${IfNot} ${Errors} - ${WriteDefineConfig} "CONTRIBUTORS" "$0" + ${WriteDefineConfig} "CONTRIBUTORS" "$0" "$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Details" "Publisher" ${IfNot} ${Errors} - ${WriteDefineConfig} "PUBLISHER" "$0" + ${WriteDefineConfig} "PUBLISHER" "$0" "$\t$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Details" "Trademarks" ${IfNot} ${Errors} - ${WriteDefineConfig} "TRADEMARK" "$0" + ${WriteDefineConfig} "TRADEMARK" "$0" "$\t$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Control" "Start" ${IfNot} ${Errors} - ${WriteDefineConfig} "OUTFILE" "$0" + ${WriteDefineConfig} "OUTFILE" "$0" "$\t$\t$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "UsesDotNetVersion" ${IfNot} ${Errors} ${If} $0 != false - ${WriteDefineConfig} "DOTNET" "" + ${WriteDefineConfig} "DOTNET" "" "" ${EndIf} ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "UseStdUtils" ${IfNot} ${Errors} - ${WriteDefineConfig} "UseStdUtils" "" + ${WriteDefineConfig} "UseStdUtils" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "INF_Install" ${IfNot} ${Errors} - ${WriteDefineConfig} "INF_Install" "" + ${WriteDefineConfig} "INF_Install" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "RegistryValueWrite" ${IfNot} ${Errors} - ${WriteDefineConfig} "RegSleep" "50" + ${WriteDefineConfig} "RegSleep" "50" "$\t$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "FileWriteReplace" ${IfNot} ${Errors} - ${WriteDefineConfig} "REPLACE" "" + ${WriteDefineConfig} "REPLACE" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "CloseWindow" ${IfNot} ${Errors} - ${WriteDefineConfig} "CloseWindow" "" + ${WriteDefineConfig} "CloseWindow" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "FileLocking" ${IfNot} ${Errors} - ${WriteDefineConfig} "IsFileLocked" "" + ${WriteDefineConfig} "IsFileLocked" "" "" ${AddConditionIfNot} "CloseWindow" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "Firewall" ${IfNot} ${Errors} - ${WriteDefineConfig} "FIREWALL" "" + ${WriteDefineConfig} "FIREWALL" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "Junctions" ${IfNot} ${Errors} - ${WriteDefineConfig} "NTFS" "" + ${WriteDefineConfig} "NTFS" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "ACLRegSupport" ${IfNot} ${Errors} - ${WriteDefineConfig} "ACL" "" + ${WriteDefineConfig} "ACL" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "ACLDirSupport" ${IfNot} ${Errors} - ${WriteDefineConfig} "ACL_DIR" "" + ${WriteDefineConfig} "ACL_DIR" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "RMEmptyDir" ${IfNot} ${Errors} - ${WriteDefineConfig} "RMEMPTYDIRECTORIES" "" + ${WriteDefineConfig} "RMEMPTYDIRECTORIES" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "LocalLow" ${IfNot} ${Errors} - ${WriteDefineConfig} "LocalLow" "" + ${WriteDefineConfig} "LocalLow" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "PublicDoc" ${IfNot} ${Errors} - ${WriteDefineConfig} "PublicDoc" "" + ${WriteDefineConfig} "PublicDoc" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "CompareVersions" ${IfNot} ${Errors} - ${WriteDefineConfig} "CompareVersions" "" + ${WriteDefineConfig} "CompareVersions" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "ConfigFunctions" ${IfNot} ${Errors} - ${WriteDefineConfig} "ConFunc" "" + ${WriteDefineConfig} "ConFunc" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "JSONSupport" ${IfNot} ${Errors} - ${WriteDefineConfig} "JSON" "" + ${WriteDefineConfig} "JSON" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "RestartSleep" ${IfNot} ${Errors} - ${WriteDefineConfig} "Sleep" "$0" + ${WriteDefineConfig} "Sleep" "$0" "$\t$\t$\t" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "WinMessages" ${IfNot} ${Errors} - ${WriteDefineConfig} "Include_WinMessages" "" + ${WriteDefineConfig} "Include_WinMessages" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "LineWrite" ${IfNot} ${Errors} - ${WriteDefineConfig} "Include_LineWrite" "" + ${WriteDefineConfig} "Include_LineWrite" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "TrimString" ${IfNot} ${Errors} - ${WriteDefineConfig} "TrimString" "" + ${WriteDefineConfig} "TrimString" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "CloseProcess" ${IfNot} ${Errors} - ${WriteDefineConfig} "CloseProc" "" + ${WriteDefineConfig} "CloseProc" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "Include64" ${IfNot} ${Errors} - ${WriteDefineConfig} "64.nsh" "" + ${WriteDefineConfig} "64.nsh" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "IncludeWordRep" ${IfNot} ${Errors} - ${WriteDefineConfig} "Include_WordRep" "" + ${WriteDefineConfig} "Include_WordRep" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "GetBetween" ${IfNot} ${Errors} - ${WriteDefineConfig} "GetBetween.nsh" "" + ${WriteDefineConfig} "GetBetween.nsh" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "DisableLanguageCustom" ${IfNot} ${Errors} - ${WriteDefineConfig} "DisablePAC:LanguageCustom" "" + ${WriteDefineConfig} "DisablePAC:LanguageCustom" "" "" ${EndIf} ClearErrors ${ReadAppInfoConfig} $0 "Dependencies" "DisableProgramExecSegment" ${IfNot} ${Errors} - ${WriteDefineConfig} "DisableProgramExecSegment" "" + ${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" + ${WriteDefineConfig} "TLB_FUNCTION" "" "" ${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" + ${IfNot} ${FileExists} "${_}\App\AppInfo\${WRAPPERINI}" StrCpy $ERROROCCURED true - ${WriteErrorLog} "${_}\App\AppInfo\CompilerWrapper.ini doesn't exist!" + ${WriteErrorLog} "${_}\App\AppInfo\${WRAPPERINI} doesn't exist!" ${Else} ClearErrors ${ReadWrapperConfig} $0 "Launch" "RunAsAdmin" @@ -750,170 +1140,104 @@ Section Main ${If} $0 == "try" ${OrIf} $0 == "force" ${OrIf} $0 == "compile-force" - ${WriteDefineConfig} "UAC" "" + ${WriteDefineConfig} "UAC" "" "" ${EndIf} ${EndIf} ClearErrors + ${ReadWrapperConfig} $0 "Activate" "DualMode" + ${IfNot} ${Errors} + ${WriteDefineConfig} "HYBRID" "" "" + ${EndIf} + ClearErrors ${ReadWrapperConfig} $0 "Activate" "Registry" ${IfNot} ${Errors} - ${WriteDefineConfig} "REGISTRY" "" + ${WriteDefineConfig} "REGISTRY" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "RegRedirection" ${IfNot} ${Errors} - ${WriteDefineConfig} "DISABLEFSR" "" + ${WriteDefineConfig} "DISABLEFSR" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "RegCopyKeys" ${IfNot} ${Errors} - ${WriteDefineConfig} "RegCopy" "" + ${WriteDefineConfig} "RegCopy" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "Redirection" ${IfNot} ${Errors} - ${WriteDefineConfig} "SYSTEMWIDE_DISABLEREDIR" "" + ${WriteDefineConfig} "SYSTEMWIDE_DISABLEREDIR" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "ForceRedirection" ${IfNot} ${Errors} - ${WriteDefineConfig} "FORCE_SYSTEMWIDE_DISABLEREDIR" "" + ${WriteDefineConfig} "FORCE_SYSTEMWIDE_DISABLEREDIR" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "ExecAsUser" ${IfNot} ${Errors} - ${WriteDefineConfig} "ExecAsUser" "" + ${WriteDefineConfig} "ExecAsUser" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "Services" ${IfNot} ${Errors} - ${WriteDefineConfig} "SERVICES" "" + ${WriteDefineConfig} "SERVICES" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "RegDLLs" ${IfNot} ${Errors} - ${WriteDefineConfig} "REGISTERDLL" "" + ${WriteDefineConfig} "REGISTERDLL" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "Tasks" ${IfNot} ${Errors} - ${WriteDefineConfig} "TaskCleanUp" "" + ${WriteDefineConfig} "TaskCleanUp" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "Java" ${IfNot} ${Errors} ${If} $0 == "find" ${OrIf} $0 == "require" - ${WriteDefineConfig} "JAVA" "" + ${WriteDefineConfig} "JAVA" "" "" ${EndIf} ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "XML" ${IfNot} ${Errors} - ${WriteDefineConfig} "XML_PLUGIN" "" + ${WriteDefineConfig} "XML_PLUGIN" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "Ghostscript" ${IfNot} ${Errors} - ${WriteDefineConfig} "GHOSTSCRIPT" "" + ${WriteDefineConfig} "GHOSTSCRIPT" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "FontsFolder" ${IfNot} ${Errors} - ${WriteDefineConfig} "FONTS_ENABLE" "" + ${WriteDefineConfig} "FONTS_ENABLE" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "FileCleanup" ${IfNot} ${Errors} - ${WriteDefineConfig} "FileCleanup" "" + ${WriteDefineConfig} "FileCleanup" "" "" ${EndIf} ClearErrors ${ReadWrapperConfig} $0 "Activate" "DirectoryCleanup" ${IfNot} ${Errors} - ${WriteDefineConfig} "DirectoryCleanup" "" + ${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 + ReadINIStr $3 "${_}\App\AppInfo\${WRAPPERINI}" 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 + ReadINIStr $3 "${_}\App\AppInfo\${WRAPPERINI}" Launch RunAsAdmin ${If} $3 == compile-force StrCpy $2 "$2 /DRUNASADMIN_COMPILEFORCE" ${EndIf} @@ -922,17 +1246,32 @@ Section Main 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" + ${PromptUserInput} \ + "Code Signing" \ + "${_}\App\AppInfo\AppInfo.ini" \ + "Team" \ + "CertExtension" \ + "What's the extension of you're certificate? (e.g. pfx):" \ + "p12" \ + $5 \ + optional + StrCpy $2 "$2 /DCertExtension=$5" + ${PromptUserInput} \ + "Code Signing" \ + "${_}\App\AppInfo\AppInfo.ini" \ + "Team" \ + "CertTimestamp" \ + "What time-stamp service to use? (e.g. GlobalSign):" \ + "Comodo" \ + $6 \ + optional + StrCpy $2 "$2 /DCertTimestamp=$6" ${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"` "" "" + ExecDos::exec `"$NSIS" /O"$EXEDIR\bin\WrapperCompilerLog.txt" /DPACKAGE="$PACKAGE" /DNamePortable="$Name" /DAppID="$AppID" /DVersion="${PACVER}"$2 "$EXEDIR\etc\source\PortableAppsCompiler.nsi"` "" "" Pop $R1 ${If} $R1 <> 0 StrCpy $ERROROCCURED true @@ -943,7 +1282,7 @@ Section Main SetDetailsPrint ListOnly DetailPrint " " - DetailPrint "Processing complete." + DetailPrint "Process 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" diff --git a/etc/source/CompilerWizardForm.ini b/etc/source/WrapperCompilerForm.ini similarity index 84% rename from etc/source/CompilerWizardForm.ini rename to etc/source/WrapperCompilerForm.ini index acb2444..4558024 100644 --- a/etc/source/CompilerWizardForm.ini +++ b/etc/source/WrapperCompilerForm.ini @@ -7,7 +7,7 @@ Left=0 Top=0 Right=296 Bottom=8 -Text=Create Launcher For: +Text=Create Wrapper For: [Field 2] Type=DirRequest diff --git a/etc/source/daemon.devin.p12 b/etc/source/daemon.devin.p12 deleted file mode 100644 index 7ceb128..0000000 Binary files a/etc/source/daemon.devin.p12 and /dev/null differ