Pint - command line manager of portable apps (beta)

Submit command line tools that you find here.
Message
Author
Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Pint - command line manager of portable apps (beta)

#1 Post by Bonaparte »

Hi all,
I'd like to present a command-line package manager written specifically for portable apps - Pint.
https://github.com/vensko/pint
https://alternativeto.net/software/pint/

This is the first public announcement, so I'd be grateful for beta testing, questions, and any input.

Pint was created as a lightweight alternative to Chocolatey, though approximately at the 60th commit I also discovered Scoop, which still lacks some features I needed.

Here is what Pint can do:
  • Downloads, unpacks and removes applications.
  • Checks for updates and downloads them if available.
  • Extracts downloads links from websites using Xidel.
  • Supports RSS and PAD files as link sources.
  • Unpacks various types of archives and installers and upgrades apps using predefined rules from the database.
  • Apps can be installed into an arbitrary subdirectory under apps. This allows to keep yaP/PortableApps.com packages up to date.
  • Automatically detects console applications and creates batch redirects for them in the apps directory.
  • Can remember, if a 32-bit or a 64-bit application was installed.
  • Can handle multiple installations of the same application.
  • Detects app versions.
  • Forms a report with all installed applications.
  • Can temporarily suppress updates for selected apps.
  • Can update itself.
  • Provides a way to subscribe to multiple remote databases, even choose not to use the default one.
  • Is able to search across all subscribed databases.
  • Allows to keep a custom user database in a separate file (by default, packages.user.ini).
  • Allows to override paths and settings via environment variables.
Unlike Chocolatey and Scoop, Pint's database does not require constant attention by humans. Pint will automatically detect, download and install an update once it becomes available on a website.
Last edited by Bonaparte on Tue Jan 09, 2018 7:48 pm, edited 4 times in total.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Pint - command line manager of portable apps (beta)

#2 Post by Midas »

I tried to test Pint but didn't get very far (Windows 7 x64 SP1) . The self-update command produced an error:
  • Code: Select all

    Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (404) Not Found."
    At line:938 char:33
    +     $res = (pint-wc).DownloadString <<<< ($env:PINT_SELF_URL)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    [/size]
Probably caused by the fact that the Pint downloadable script is presented in a CMD file, not a BAT...

I proceeded to try to download the stated requirements and got halfway with Xidel and nowhere with 7-zip and innounp.
  • Code: Select all

    Exception calling "NameSpace" with "1" argument(s): "Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))".
    [/size]
Then I decided to try Scoop (http://scoop.sh/) and got nowhere as well. Maybe I'm just thick as a brick.

BTW, I loathe Powershell, can never get anywhere with the thing and I have trouble even starting to understand its errors -- it looks like a CLI for programmers... :x

Specular
Posts: 443
Joined: Sun Feb 16, 2014 10:54 pm

Re: Pint - command line manager of portable apps (beta)

#3 Post by Specular »

This sounds amazing. The fact the it can apparently keep the config files / existing structure in tact while also updating in place sounds so useful.

How does it detect which files to update and which not to, or is that only for PortableApps programs?

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#4 Post by Bonaparte »

Midas wrote:I tried to test Pint but didn't get very far (Windows 7 x64 SP1) . The self-update command produced an error:
That's embarrassing, I should have tested it on a clean system. Fixed the update URL and 7-zip detection, please redownload pint.cmd. Though the NameSpace error is a bit suspicious, may be ZIP support is disabled in your system? It could be done manually.
Last edited by Bonaparte on Mon May 09, 2016 8:11 am, edited 1 time in total.

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#5 Post by Bonaparte »

Specular wrote:This sounds amazing. The fact the it can apparently keep the config files / existing structure in tact while also updating in place sounds so useful.

How does it detect which files to update and which not to, or is that only for PortableApps programs?
Here is the workflow:
First, Pint unpacks an archive to a temporary directory.
Then it tries to detect a root path of the app inside the archive. It would be either the base parameter from the db, or a closest .exe file.
Next, it copies configuration files from the app directory to the temporary directory (either *.ini and *.db files, or what's defined by the keep parameter in the database).
And finally, robocopy moves the contents from the tempdir to the destination with the /XF /XD /PURGE parameters, which will delete obsolete, non-configuration files from the destination and leave certain files and directories behind ($PLUGINSDIR, $TEMP, uninstall.exe etc.)

This process is tricky, indeed. Upgrade of the do-it-yourself apps, like foobar2000 and 1by1, is handled with the only parameter: Pint removes certain files by mask from the destination, and then copies files by the same mask from the archive.

shnbwmn
Posts: 265
Joined: Sat Jul 11, 2015 12:59 am

Re: Pint - command line manager of portable apps (beta)

#6 Post by shnbwmn »

This looks pretty neat (yay for batch files :) ). I'll give it a go and provide you some feedback.

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#7 Post by Bonaparte »

shnbwmn wrote:This looks pretty neat (yay for batch files :) ). I'll give it a go and provide you some feedback.
Pint started as a true-batch script, but after some time it became a burden. Nevertheless, it was fun. :)

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Pint - command line manager of portable apps (beta)

#8 Post by Midas »

The 'self-update' error is gone after re-download. 8)
Bonaparte wrote:Though the NameSpace error is a bit suspicious, may be ZIP support is disabled in your system?
  • That's affirmative, it's in fact disabled through a registry tweak, if I remember correctly -- but wasn't that the point of the 7-zip download? Requirements are still failing to install...

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#9 Post by Bonaparte »

Midas wrote:The 'self-update' error is gone after re-download. 8)
Bonaparte wrote:Though the NameSpace error is a bit suspicious, may be ZIP support is disabled in your system?
  • That's affirmative, it's in fact disabled through a registry tweak, if I remember it correctly -- but wasn't that the point of the 7-zip download? Requirements are still failing to install...
The setup process [s]currently heavily relies[/s] relied on native ZIP support:
- Xidel is downloaded via a direct link,
- Unpacked with the built-in ZIP library,
- Using Xidel, Pint extracts a download link for 7-zip,
- 7-zip can unpack itself.

I knew about the tweak, I just didn't expect to encounter it so soon :)
.NET framework 4.5+ has another library for that, but as I intend to keep the requirements low, I'm avoiding it for now.
I'll make a workaround, hold on.

UPD: Done.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Pint - command line manager of portable apps (beta)

#10 Post by Midas »

Bonaparte wrote:UPD: Done.
  • Great! Everything nominal, dependencies installed. Ready for the next step... :mrgreen:

    Minor snag: after running 'self-update', got this error:
    • Code: Select all

      'ng' is not recognized as an internal or external command, operable program or batch file.
      [/size]
Bonaparte wrote:.NET framework 4.5+ has another library for that, but as I intend to keep the requirements low, I'm avoiding it for now.
  • I support that 100%. :!:

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Pint - command line manager of portable apps (beta)

#11 Post by Midas »

Going further, a quick way to find the complete list of packages Pint is aware of (without opening 'packages.ini' in a text editor) is by issuing the command
Please note the absence of search parameter.

An additional niggle that makes my life unnecessarily difficult is Pint using ANSI text files with UNIX line terminations -- this is Windows, files should heed the native format, IMHO...

Another thought that immediately sprung to my mind is how extremely useful it would be to achieve some kind of interoperability between Pint and the open SPS format used by SyMenu and SPSBuilder (see http://www.portablefreeware.com/forums/ ... hp?t=21891).

Not only does the SPS format cover a thousand portable programs already (see http://www.portablefreeware.com/forums/ ... hp?t=22879 and http://www.ugmfree.it/SyMenuSuiteSPS.aspx), but SPSBuilder provides for an easy and able GUI editor for the addition of many more.

Pint could do this easily by parsing all SPS files in a folder to build a custom 'packages.user.ini'. Or, better yet, by accepting such files directly for input, extracting required info from them on cue (I'm guessing "Program name", "Packer format", "Download URL" and maybe more, depending on whether 'packages.ini' format is documented further).

Just my 2 centimes. More testing forthcoming. :)

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#12 Post by Bonaparte »

An additional niggle that makes my life unnecessarily difficult is Pint using ANSI text files with UNIX line terminations -- this is Windows, files should heed the native format, IMHO...
Good point. Fixed.
Another thought that immediately sprung to my mind is how extremely useful it would be to achieve some kind of interoperability between Pint and the open SPS format used by SyMenu and SPSBuilder (see viewtopic.php?t=21891).
Thanks for the tip, I didn't know about this program, this database will definitely be useful.
Yes, it's possible to install any archive from an arbitrary URL, I even played a bit with wizard-like clients for some popular websites ( http://i.imgur.com/kAlrT0u.png ).
The main issue here is unattended software upgrade. I try every program and check, what configuration files it uses. I've got some ideas, how to automate it completely (like comparing created timestamp of a directory and modified timestamp of files inside it). If I fail with this, apparently the only way would be a yet another online community-driven software repository.
I'm still adding features to the packages.ini format (just now I enabled using of preudo-extensions .arch and .any). Of course, the documentation will follow.

User avatar
Midas
Posts: 6710
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Pint - command line manager of portable apps (beta)

#13 Post by Midas »

@Bonaparte: When trying to run "pint upgrade", I always get the following error... after that, nothing happens. :?
  • Code: Select all

    Unable to initialize device PRN
    [/size]

freakazoid
Posts: 1212
Joined: Wed Jul 18, 2007 5:45 pm

Re: Pint - command line manager of portable apps (beta)

#14 Post by freakazoid »

Not bad, Bonaparte!

My portable apps are in a subdirectory like d:\apps\. So I added pint.cmd to d:\apps\pint.cmd and have custom-configured Pint's environment variables so all Pint files live in d:\apps\Pint.

I tested a few apps and they seem to work fine!

I've got a few requests:

1. I would like to see a command to remove installer files from the dist directory since that directory can grow quite fast.
2. Can you install the xidel dependency in the .shims directory? xidel is really only useful for Pint.

Also how do you install specific versions of an app? Let's say I want the 32-bit version and not the 64-bit one, how do I tell Pint that? Or is Pint smart enough to determine which version of the app is in the directory.

Looking good so far though.
is it stealth? ;)

Bonaparte
Posts: 21
Joined: Sat May 07, 2016 11:04 am

Re: Pint - command line manager of portable apps (beta)

#15 Post by Bonaparte »

Midas wrote:@Bonaparte: When trying to run "pint upgrade", I always get the following error... after that, nothing happens. :?
  • Code: Select all

    Unable to initialize device PRN
    [/size]
Google says this message is produced by print.exe. Yet there is no a single call and even a string with this word in the script. What about pint outdated, does it work?
freakazoid wrote: 1. I would like to see a command to remove installer files from the dist directory since that directory can grow quite fast.
2. Can you install the xidel dependency in the .shims directory? xidel is really only useful for Pint.

Also how do you install specific versions of an app? Let's say I want the 32-bit version and not the 64-bit one, how do I tell Pint that? Or is Pint smart enough to determine which version of the app is in the directory.
1. Ok, I'll add it.
2. Try this:
pint installto xidel .shims\xidel
then manually remove apps\xidel.
3. Please, read the "Custom install destinations (installto)" part on the Github page. In short:
pint installto app_id app_dir 32
Pint can detect bit count of executables, but in real world this perk appeared to be useless, because many apps contain both types of executables. So I commented that code out and let humans decide.

Post Reply