Skip to content

DeLino/portableapps.comlauncher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction


This is a fork of the official PortableApps.com Launcher. I forked this project because I wanted to incorporate some ideas I had that I believe would better this project in its entirety. So instead of going to PortableApps.com and sharing my ideas (a superfluous attempt was already made; to what seemed like no avail), I feel it would be much more advantageous on my part to just implement these ideas instead.

I have no real expectations that any of these ideas will actually be pulled into the official version of PAL (PortableApps.com Launcher) but if any of them do than kudos.. lol. If anyone is actually reading this and does find some of these concepts to be useful then maybe support my effort in supporting their cause.

I've come to the conclusion that I no longer care to add any support to the official version of PAL. The current developers of the official builds are completely useless in the sense that they treat any progressive ideas as the Devil's work—I'm only kidding, although I do think to be a part of their exclusive community you need a members-only Letterman's Jacket. I'm tired of trying to help their cause. I kept on sharing my ideas with them over and over again only to be dismissed and ignored. It was as if they couldn't wait to deprecate my ideas. So instead of holding my breathe, I'll just take this project to new heights; that far exceeds the official predecessor (which, by the way, hasn't received any real worthwhile development in years).

I should say that what I'm going to be adding to this variant of PAL is what works for me and my environment. All the concepts that you find here should work with any other environment unless explicitly expressed otherwise. So like I say in a recent motto I have recently just adopted, "Port and let portable!" — You see what I did there? Lol. If you don't, no worries; I guess I should just live and let live.

Concepts


Here's a small list of a few ideas that I want to try and implement with this project. These are just things I plan on working on in my spare time and while the ideas listed below are not recognized by PortableApps.com please be aware that using some of the things you find in this variant of PAL can and most likely will be buggy.

  • Support for NSIS3: (DONE)

Well, support for NSISPortable rather which is packaged with the latest release of NSIS. The current official release of PAL is using NSIS v2.46.5-Unicode which is actually packaged with the project. So I would like to completely remove the need for this dependency entirely.

  • Manifest Support: (DONE)

With the release of NSIS3, support for adding an application manifest is done automatically and defaults to supporting Windows 7 and later versions.

  • .NET Handling: (DONE)

I'll just be adding a means for checking a system for the required version of the .NET Framework because John T. Haller explains in great detail how the .NET Framework has no real practical means for portability when it comes to Portable Apps. He ends his article with,

"...applications based on .NET simply can't be considered portable due to the fact that the files they need can't be bundled portably and won't be on a large number of PCs you encounter in the wild."

  • Support Registering Libraries: (DONE)

The official release of PAL has no native support for registering libraries (DLLs), so I will try to add support for registering files. Be aware though that a program developer has complete control over what happens when you call RegSvr32 which is what is used by RegDLL (the native command used by NSIS for registering files). With that being said, my ideas on this topic may be buggy.

  • Language Handling: (In Progress)

The official PAL's language handling is based on the setting of the PortableApps.com Platform language. Not every user of a PAF uses the PortableApps.com Platform so I'm rewritting the language handling to support and be based on the end-users operating system language. As it is written now, if you want language support you need to use the custom.nsh file.
TODO: Fallback on the original method to use the Launcher.ini but still be based on the OS language.

  • Support Services: (Almost Finished)

The support for services is by default disabled in the official builds of PAL. In the source code it states that they might be unstable and the plugin is large in size. I plan on not using a plugin to support services, instead I plan on dealing with this by using the command line with a few functions and macros to try and keep things simple.
TODO: Still need to rewrite the Services.nsh segment to handle services without using custom code or a plugin.

  • Redevelop Generator Wizard: (Brainstorming)

I'm conceptualizing and outlining ideas for a nice GUI which will potentially allow the user to just select certain checkboxes for the [Dependencies] section which is discussed in greater detail further below. This way I can eliminate the need to use all those keys in the AppInfo.ini file. I'd like to point out that my knowledgebase in this area of NSIS is primitive and/or novice at best so I'm certainly open to any helpful input and suggestions in this area.

  • Rename This Project: (Brainstorming)

I've decided to rename this project to set it a part from the official PA.c Launcher. This rebranding is to help make this project it's own entity. So instead of people looking at the official builds of PAL and thinking, "Wow! How cool is that feature?! I wonder who had the idea to add that?" they can think that about my version and know exactly who added that cool feature instead; me.

  • Redevelop PA.c Installer: (Near Future)

I've been thinking I should probably go ahead and add my two-cents in the PortableApps.com Installer. That project most certainly could use new life as well. However, if and when I do decide to start a new repository for the PA.c Installer, be aware that I'm going to probably change the output extension of the generated installer—which is currently something similar to ApplicationPortable_1.0.2_English.paf.exe to something else like ApplicationPortable_1.0.2_English.mps.exe (.mps.exe - movable program scheme; first thing that came to mind ..Lol.). I might just drop the .paf.exe and just stick with .exe. I don't know; I'll cross that bridge when I get there.

John T. Haller has a history of throwing a tantrum anytime someone else uses his Open Source software to make portables of commercial applications. Rumor has it that he has actually taken someone to court and actually sued him for using his free software. His premise was his trademarked extension (which is a trademark of his parent company, Rare Ideas, LLC) was being used to make commercial applications portable. How can you complain about someone using your free software (especially if its open source). Not only that, but the software automatically outputs the install file with a suffix .paf.exe as an extension anyway? Anyway, the Judge ruled in favor of the plaintiff (John Haller) and the defendant had to cease using his free software or at least not use his trademarked extension. So rather than risk all the work I've put into this project (and any future endeavors) I'll just avoid any asinine attempts on his part to shut me down by rebranding this thing altogether.

  • Etc. Etc. And So On: (On Going Process)

Other things could follow depending on my availability, interest.. and of course the interest and support from others. So with that being said, this little project might not even see the light of day. Lol.

Features


PortableApps.comLauncher.nsi

  • Added code to add a manifest file to the Launcher.exe for better user privileges support. Refer to line 80 for referance.
  • Added support for using new NSISPortable which is the new NSIS3 with Unicode support. Removed NSIS in the App directory.
  • Adding an application manifest is now handled by default since NSIS3. The code has been commented out.
  • Added support for automatic code signing. Refer to the code block on line 709 for referance.
  • Added support to prevent a user from shutting down or at least allow enough time to cleanup before exiting then shutting down.
  • Added support for .NET checking from both 4.0 and below to 4.5 and above. See DotNet.nsh in the segments folder for referance.

Launcher.ini

%PAL: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:

[Environment]
PATH=%PATH%;%PAL:CommonFiles%\AndroidSDK
JAVA_HOME=%PAL:CommonFiles%\Java64

Added new keys to the [Activate] section. They are as follows (a short description of what each key means or does can be found further below):

Note: You should only use the following keys if you need them, otherwise they should be omitted entirely.

[Activate]
Registry=true
Services=true
RegDLLs=true
Ghostscript=true
Java=true
JDK=true
XML=true
  • Registry: Add support for minipulating the Windows Registry.

  • Services: Add support for handling Windows Services.

  • 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:

[RegisterDLL1]
ProgID=MyAppControlPanel
File=%PAL:AppDir%\controller.cpl

[RegisterDLL2]
ProgID=DynamicLibrary
File=%PAL:DataDir%\dynlib.dll
  • Ghostscript: Add Ghostscript support.

  • Java: Add support for the Java Runtime Environment.

  • JDK: Add support for the Java Development Kit.

  • XML: Add XML support.


AppInfo.ini

Added the section [Team] for use with code signing and application specifications. New keys are as follows (a short description of what each key means or does can be found further below):

Note: You should only use the following keys if you need them, otherwise they should be omitted entirely.

[Team]
Developer=demon.devin
Contributors=DoomStorm
Creator=FukenGruven
CertSigning=true
CertExtension=p12
CertTimestamp=VeriSign
  • Developer: The name of the developer that created the portable application.

  • Contributors: Specify here anyone who has helped with the creation of the portable application.

  • 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 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. Be sure it is similar to something like this: /p "PASSWORD" where PASSWORD is your password.

  • CertExtension: If the key CertSigning is set to true then this should be set to the certificate's file extension without the period (e.g. "pfx" not ".pfx").
  • CertTimestamp: Here you can choose which time-stamping service you would like to use. Refer to the table below for a small list of available services and their available hashing algorithms. I would recommend using a service which uses both signature hashes. Be aware that this key is case-sensitive. If this key is omitted, the compiler will default to using Comodo.
CertTimestamp=Value Timestamp Service Algorithms
Comodo Comodo Group, Inc. SHA-1 & SHA-2
Verisign Verisign, Inc. SHA-1 & SHA-2
GlobalSign GMO GlobalSign, Inc. SHA-1 & SHA-2
DigiCert DigiCert, Inc. SHA-1 & SHA-2
Starfield Starfield Technologies, LLC. SHA-1 & SHA-2
SwissSign SwissSign AG SHA-2

I've added several new keys to the [Dependencies] section. These newly added keys act like on/off switches to allow support for certain plugins and/or macros/functions (a short description of what each key means or does can be found further below):

Note: You should only use the following keys if you need them, otherwise they should be omitted entirely.

[Dependencies]
ElevatedPrivileges=true
UsesJava=true
UsesGhostscript=true
UsesDotNetVersion=4.5
ExecAsUser=true
UseStdUtils=true
InstallINF=true
DisableRedirection=true
ForceDisableRedirection=true
RegistryValueWrite=true
RegistryCopyKeys=true
RegDisableRedirection=true
FontsFolder=true
FileWriteReplace=true
FileCleanup=true
FileLocking=true
Firewall=true
Junctions=true
ACLRegSupport=true
ACLDirSupport=true
TaskCleanup=true
RMEmptyDir=true
LocalLow=true
PublicDoc=true
CompareVersions=true
ConfigFunctions=true
CloseWindow=true
JSONSupport=true
RestartSleep=500
WinMessages=true
LineWrite=true
  • ElevatedPrivileges: For launchers which need to run with elevated privileges.

  • UsesJava: Specifies whether the portable application makes use of Java Portable.

  • UsesGhostscript: Specifies whether the portable application makes use of Ghostscript Portable.

  • 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).

  • ExecAsUser: For applications which need to run as normal user but need the launcher to have elevated privileges. Read this for more information on this concept.

  • UseStdUtils: Include the StdUtils plug-in without ExecAsUser

  • InstallINF: Add support and macros for INF installation. Refer to the Services.nsh file in the Segments directory for reference.

  • DisableRedirection: Enable support for enabling/disabling file system redirection.

  • ForceDisableRedirection: Checks using the variable $Bit to disable/enable file system redirection.

  • RegistryValueWrite: Set this to true to set a sleep value for [RegistryValueWrite] otherwise the function is inaccurate.

  • RegistryCopyKeys: 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:

[RegistryCopyKeys]
1=HKCU\Software\MyProgram\ExtraCareNeededKey
2=HKLM\SOFTWARE\MyProgram\AnotherFragileKey
  • RegDisableRedirection: Enable support for enabling/disabling registry redirection.

  • 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.

Supported Fonts:

  • .fon
  • .fnt
  • .ttf
  • .ttc
  • .fot
  • .otf
  • .mmm
  • .pfb
  • .pfm
  • FileWriteReplace: Enables the Replace functionality in [FileWrite]

  • 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:

[FilesCleanup]
1=%PAL:DataDir%\uselessUpgradeFile.xml
2=%APPDATA%\MyProgram\purposelessCfg.ini
  • FileLocking: Enable this to prevent ejection/unplugging problems for USB devices. Windows Explorer tend to lock application's DLL(s). Note: As of right now, this only enables support for using ${If} ${FileLocked} and/or ${IfNot} ${FileLocked} in the custom.nsh file. ToDo: Handle without the use of custom.nsh. (Got a couple ideas already. Check back soon.)

  • Firewall: Enable Firewall support.

  • Junctions: Enable support for Junctions (SymLinks) functionality.

  • ACLRegSupport: Enable support for AccessControl on registry keys.

  • ACLDirSupport: Enable support for AccessControl on directories.

  • TaskCleanup: Enable the TaskCleanup segment for removing any Windows Tasks that was 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:

[TaskCleanup]
1=MyAppTask1
2=Another Task w/ Spaces
  • RMEmptyDir: Enable the function RMEmptyDir. See the Core.nsh segment on line 1192 for reference.

  • LocalLow: Enable the function GetLocalAppDataLow. See the Core.nsh segment on line 1351 for reference.

  • PublicDoc: Enable the function GetPublicDoc. See the Core.nsh segment on line 1427 for reference.

  • CompareVersions: Enable the function Compare. See the Core.nsh segment on line 141 for reference.

  • ConfigFunctions: Enable ConfigWrite(s) and ConfigRead(s) functions. See the Core.nsh segment on line 236 for reference.

  • CloseWindow: Enable Close function. See the Core.nsh segment on line 1288 for reference.

  • JSONSupport: Include the nsJSON plugin allowing nsJSON::Get, nsJSON::Set, and nsJSON::Serialize for use within custom.nsh.

  • RestartSleep: Set this to a numerical value (in milliseconds) to set a sleep value for applications that need to restart (i.e. Notepad++ after installing new plugins).

  • WinMessages: Include the WinMessages.nsh file.

  • LineWrite: Include the LineWrite.nsh file.

Documentation


I've begin a small website dedicated to documenting anything I've deemed invaluable in my findings while I've devoted my time to PAFing. You should know that the content you find there is (or will be over time) a collection of help files and guides mostly focused on the making of PAFs. In some circles it's considered the most complete guide to making PAFs with PAL. So I encourage any novice PAFers to give it a visit; you can read up on a wide range of related topics from Registry best-practices to making your own self-signed certificates to sign your PAFs with.

I've started this because the documentation which is supplied with PAL by PortableApps.com doesn't have, in my humble opinion, any solid information on the power and complexities it's framework has. So I've taken it upon myself to start working on jotting down this unofficial, but my official, guide to making a PAF with PAL. As time has gone by the website has taken on new meaning which now helps developers to better understand the inner workings of the PAL I'm working on here. Not only that but it also goes into great detail in explaining how certain applications and their components are used on a system; which will help you better understand what you're using in this project and why.

Because I am only just one man who has to live outside of my computer, the documentation project (like this project) will take sometime to finish (if ever) so please forgive me on it's incompleteness. This will also serve as a reference/cheat-sheet for those (I know I'll need it, which is partly why I've started it) who need a quick reminder on certain functions and macros for use within the custom.nsh file. As an added bonus, all (not yet but most) of the source code I've used here is outlined and better explained/documented there as well. For instance, visit this page for a short guide on registering DLLs and all the macros I used to create the RegisterDLL.nsh segment. You can visit this page for an exhaustive tutorial on dealing with Windows Services; plus it explains what each macro is and does within the Services.nsh segment and how to use them in action.

Visit the Docs: The PAF Docs

Contributors


This forked project has been started by demon.devin and hopefully maintained on a regular basis. However, if you would like to be a part of this then please do not hesitate on getting involved! I'm always open to new ideas and a willingness for the betterment of all things code. =)

A special thanks is expressed for DoomStorm for all the suggestions and heavily testing for bugs.

Thank you to the following people; Dave Green, HandyPAF, all those on the Discord Workbench and anyone else who makes use of this version to port and let portable!

I should convey that some of the code I've added here was written by FukenGruven. Without his code-base, most of this version of PA.c Launcher would not be possible. So a round of applause is in order for FukenGruven! Thank you FukenGruven.


=)

About

The PortableApps.com Launcher

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • NSIS 93.6%
  • CSS 1.5%
  • Python 1.3%
  • HTML 1.0%
  • C++ 0.9%
  • Batchfile 0.7%
  • Other 1.0%