daemondevin / pac-man

A better alternative to the PA.c Launcher—PortableApps Compiler & Management
MIT License
27 stars 13 forks source link
launcher paf portable portableapps portableapps-compiler

PortableApps Compiler & Management


Welcome! This project started out as a modified variant of the official PortableApps.com Launcher. The creator of the original version left the project over 5 years ago and since then, all development and updates ceased completely and PAL became stagnant. PortableApps Compiler & Management (or Pac-Man for short), is an alternative solution to creating portable applications that still adhere to the PortableApps.com Format specification.

From the uninitiated software programmer wanting a reliable method for porting their programs portability, to the most loyal and dedicated PAF Developer who would love to finally see full-featured and reliable utility for developing PAFsPac-Man is a much better solution when it comes to creating a portable launcher for the more complex Windows applications. Even if a program seems to thread itself deep within the Windows registry and/or file-system, this utility will most likely have you covered.

While the techniques being implemented by this project are highly advanced, this can be used by beginners who are just starting out with portable programming, getting familiar with the practices of the official PortableApps.com Launcher will greatly improve your ability to understand the features being implemented in the project. Understanding the intricacies behind the advanced capabilities currently being used by this project.

With this branch you will find the coding practices of Chris Morgan, FukenGruven, Azure Zanculmarktum, and myself (daemon.devin). You will also see minor influence from contributors like LegendaryHawk, DoomStorm, and other fellow developers as well. So you can expect to see great things to come out of this experimental build.

Under Construction


The following is a list of things currently being worked on for Pac-Man so you can look forward too in this project. This list is a work in progress so come back later to see if these features have been added.

Working on a nice all-in-one GUI that will enable the developer to quickly create the necessary configuration files for creating and generating a PA.c compliant portable application. After creation, than ask to compile.

Working on combining both the PortableApps.com Launcher with the PortableApps.com Installer. Basically, have a single GUI (including the config creator) which can be used to create and generate a portable application package from compiling the portable launcher to creating the PAF installer.

Other things could follow depending on our availability, interest.. and of course the interest and support from others.

Branches


There are two branches in which you may find in this project. The Master Branch (a.k.a. Stable Edition) and the Dev Branch (a.k.a. Development Edition). In the case for the stable variant (which you're currentlu browsing), you can rest assured you're building launchers with a (near)bug-free utility, but the latter case is meant for the cutting-edge of development. Don't expect the Dev. Branch to work-out-of-the-box as it is constantly under going revisions for testing new ideas and theoratical code. There will be bugs hidden throughout the experimental version.

Features


The following is a list of features that is currently available with PortableApps Compiler. Everything listed here has been tested and is in working order.


Launcher.ini

Environment Variables

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
RegRedirection=true
RegCopyKeys=true
Redirection=true
ForceRedirection=true
ExecAsUser=true
Services=true
RegDLLs=true
Tasks=true
Java=true
JDK=true
XML=true
Ghostscript=true
FontsFolder=true
FileCleanup=true
DirectoryCleanup=true
Key Value
Name The local/portable service name.
Path The path to the portable service executable. Supports environment variables.
Type Specify whether you are dealing with a service, a kernel driver or a file system driver, etc.
Choose from: own, share, interact, kernel, filesys, rec
Start Specify when the service is supposed to start.
Choose from: boot, system, auto, demand, disabled, delayed-auto
Depend List any dependencies here separated by / (forward slash).
IfExists If the service already exists, you can either skip it or replace it with the portable version of the service (the original service will be restored afterwards).
Choose from: skip, replace

Example usage:

[Service1]
Name=SomeServiceName
Path=%PAL:AppDir%\service32.sys
Type=kernel
Start=auto
Depend=
IfExists=replace

[Service2]
Name=AnotherService
Path=%PAL:DataDir%\service64.exe
Type=own
Start=demand
Depend=
IfExists=skip

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=daemon.devin
Contributors=DoomStorm
Creator=FukenGruven
CertSigning=true
CertAlgorithm=SHA512
CertExtension=p12
CertTimestamp=VeriSign

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
UseStdUtils=true
InstallINF=true
RegistryValueWrite=true
FileWriteReplace=true
FileLocking=true
Firewall=true
Junctions=true
ACLRegSupport=true
ACLDirSupport=true
RMEmptyDir=true
LocalLow=true
PublicDoc=true
CompareVersions=true
ConfigFunctions=true
CloseWindow=true
JSONSupport=true
RestartSleep=500
WinMessages=true
LineWrite=true
TrimString=true
CloseProcess=true
Include64=true
IncludeWordRep=true
GetBetween=true

Code-Signing


I have created a small, commandline utility (CompilerSigner.exe, source included) to help with code signing using dual signature hashing algorithm standards (SHA-2 and SHA-1). If you set [Team]CertSigning to equal true along with the other need information, than no further assistance is required on your part as this tool will handle the signing for you but refer further below for how to use this tool on the command line for other things you may wish to sign. I decided to use both because Windows 8 supports SHA256 certificates (SHA-2 hashing algorithm); whereas, Windows 7 may only support SHA1 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. If you've got a certificate you wish to sign your launchers with than read the following for information on how to get started.

CertTimestamp=Value Timestamp Service Algorithms Notes
Sectigo Sectigo Limited up to SHA512 wait 15 seconds between each request.
ACCV ACCV up to SHA512
GlobalSign GMO GlobalSign, Inc. up to SHA512
Symantec Symantec up to SHA512
Starfield Starfield Technologies, LLC. up to SHA512
Entrust Entrust DataCard Corp. up to SHA512
SwissSign SwissSign AG up to SHA512 only 10 requests per day.
IDnomic Atos SE up to SHA512
IZENPE Izenpe SA up to SHA512
CERTUM Asseco Data Systems S.A. up to SHA512
CatCert AOC Consortium up to SHA512
Apple Apple Inc. up to SHA512

CompilerSigner.exe

If you'd like to use CompilerSigner.exe outside the compiling wizard, you can use the following commandline parameters to do so. When you call this tool, be sure to call it from where it's currently located within the Other\Source directory because this tool assumes that the signtool.exe utility is in Contrib\bin\signtool. I'll update it to use a static file from inside the binary but until than, keep the stucture as is otherwise it will not work correctly.

CompilerSigner.exe --switch=value

     --PFX= | Path to the certificate.
    --PASS= | If your certificate requires a password.
     --TSA= | This can be any of the above Time-Stamping Authorities listed in the table above.
    --HASH= | Either SHA1 or SHA2 - NOTE: when using dual signing, be sure to sign using SHA1 first.
     --EXE= | Path to the binary you wish to sign.
    --MODE= | When set to offline, this optional parameter will tell it to not add support for time-stamping.

For example:
    CompilerSigner.exe --PFX=MyCert.p12 --PASS=PASSWORD --TSA=Entrust --HASH=SHA2 --EXE=MyProgram.exe --MODE=

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

Thanks to zodi for developing the GUI (coming soon). Thanks to DoomStorm for all the suggestions and heavily testing for bugs.

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

A special thanks to FukenGruven. His codebase was the skeleton which was used to start this project.


=)