You are here

Periodic update checks or scheduled update checks

3 posts / 0 new
Last post
s74r1
Offline
Last seen: 7 years 3 weeks ago
Joined: 2017-03-04 19:32
Periodic update checks or scheduled update checks

I couldn't find this in the "Bug Report and Feature Tracker" thread, and all the threads about this were dead ends. Apologies in advance if this is the wrong place to post this.

Feature request: Option to periodically check for updates (currently it can only check on platform startup).

Description: Perhaps this is out of scope of the intended use case but it would be very convenient to have the ability to check for updates without having to launch the platform menu manually.
Personally I use PortableApps as a convenient locally installed app manager of sorts. (which also makes migrating to new windows installs or new computers easier). I'd imagine some others probably do too. Sometimes I will go weeks without rebooting or starting the platform menu (shortcuts or file type association to the portable launchers) so it would be nice to have an option to check for updates periodically (like LiberKey does) or an option that can set up a scheduled task (though maybe that part is not so "portable").

Workaround: I scoured the source code a bit and found the (assumably) appropriate command switches to run the updater alone and on-demand from a command window, script, or scheduled task (Unsure if all of the below command switches are needed, I used ones matching my own configuration.)
The only mandatory switches appear to be /CONNECTION=Automatic and /MODE=UPDATE, but I'm unsure if ran standalone whether it reads and applies your configuration from the portableapps platform.

Sauce:
Workaround command for standalone update check:
DriveLetter:\path\to\portableapps\PortableApps\PortableApps.com\PortableAppsUpdater.exe /CONNECTION=Automatic /HIDEPORTABLE=true /STARTUP=true /STARTUPSHOWERRORS=true /BETA=false /ADVANCED=true /OPENSOURCEONLY=false /MODE=UPDATE

Your path to portableapps will be different than mine so you'd need to change your install path and enable or disable any of the additional flags to suit your preferences.

What this does is silently check for updates similarly to how the option "Check for updates... On platform startup" works when launching the platform. If updates are found, the updater window will open prompting you to install updates as usual. If none are found then the updater will silently check and then exit without any windows appearing (unless STARTUP= is set to false).
When using this command, the menu does not start (unless you run the menu manually). Only the updater will run to check and then exit (or remain open waiting for user input if updates are found). The menu only seems to start if you perform a platform update.

Description of above command switches (more in the source code file "PortableApps.comUpdater.nsi"):
/CONNECTION=Automatic: Options: Direct, Proxy, Automatic. Mandatory command switch otherwise it fails to connect. /CONNECTION=Direct connects directly without any proxy detection. /CONNECTION=Automatic performs automatic proxy detection and falls back to /CONNECTION=Direct if none found. /CONNECTION=Proxy seems to require additional switches to specify your proxy details.
/MODE=UPDATEOptions: ADD, ADDALL, UPDATE. Unconfirmed but I suspect the platform uses /MODE=ADD with another command switch to install a specific package. Not sure about /MODE=ADDALL, maybe it installs the entire library of PortableApps? I recommend leaving these options alone, could be very dangerous to use the others.
/HIDEPORTABLE=trueOptions: true, false. Hides the name "Portable" appended to apps. I believe this is just used in the menu itself and not the updater, but it may also display update lists without portable affixed to the names.
/STARTUP=trueOptions: true, false. If set to true it runs the updater silently unless updates are found. The platform uses this on startup so it doesn't spam you with the "All portable apps are up to date" dialogue box. If set to false it will show verbose output; a short progress box as it checks online and then another dialogue box upon completion such as "All portable apps are up to date." just like the platform does when you do a manual update check from the menu.
/STARTUPSHOWERRORS=trueOptions: true,false. Not entirely sure, I guess it just adds additional error output if any errors are encountered.
/BETA=falseOptions: truefalse. Tells updater and/or platform whether or not to install beta apps.
/ADVANCED=trueOptions: true,false. Shows advanced options in menu from what I can tell, but using this command doesn't launch the menu so I don't know what advanced options there may be in the updater compared to non-advanced mode. Probably less information if there is any difference.
/OPENSOURCEONLY=falseOptions:true,false. Restricts apps to open source apps only if set to true, which significantly reduces the number of available apps (but some people prefer FOSS only, matter of preference here).

If using this as a scheduled task, configure it to run as your user and the working directory to
DriveLetter:\path\to\portableapps\PortableApps\PortableApps.com\
(And I'd suggest NOT spamming the update server constantly for update checks, once or twice a day is enough)

DISCLAIMER: The updater was not meant to run standalone like this. This is an unsupported/unintended use of it and likely not tested. However, in my short but limited testing it seemed to work fine but I can't guarantee it won't burn your house down or anything (tested on a few different installs and it updated fine, including platform updates, followed by individual app updates afterwards)
It's important that people realize if you do choose to run the platform in this unintended fashion you do so AT YOUR OWN RISK so backup your portableapps folder and potentially anything else of value, though I doubt it will harm anything outside the portableapps folder if anything ever did go wrong. Also realize that future updates could change the updater's behavior so this may no longer work in the future or would need different command switches (though I hope the dev(s) don't intentionally try and block this type of usage).

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 1 week ago
DeveloperModerator
Joined: 2008-07-24 18:46
Click through updates

One thing to be aware of with this method is that you'll need to click through the various dialogs for each update, rather than having them applied automatically, as that particular feature of the updater depends on the platform running.

s74r1
Offline
Last seen: 7 years 3 weeks ago
Joined: 2017-03-04 19:32
I actually didn't know that

I actually didn't know that feature even existed (to automatically update without user confirmation). Good to know, though I wouldn't use the auto update without the platform's ability to detect open apps (saw it on the sticky thread).

Anyways, now I have little reason to use Liberkey alongside PortableApps since my update issue is solved (or at least mitigated for now) Smile

I hope this isn't against forum rules to post advanced commands, my intention is not malicious of course. The updater had been a mystery to me for a long time and I do understand some of the reasons the dev(s) wouldn't want it ran standalone without the platform, but personally I very rarely use the platform menu (just shortcuts to the APPNAMEportable.exe files). I signed up for the forums today to post this since I've been looking for a solution for awhile, with much googling, forum searching, and even no one on IRC knew of a method to accomplish what I wanted so I wanted to share my results.

mods: feel free to move this to dev section or something if it's too advanced, or PM me if it needs anything edited/removed. I do understand the risks of using the platform in an unsupported/unintended fashion.

I should probably run a complete trace on the startup of the platform to see *exactly* what options are passed to the updater though, but I'm fairly certain my above command is darn close to it.

Log in or register to post comments