You are here

why does SumatraPDF 2.2.1 have two .exe files running_why two executables in program folder?

14 posts / 0 new
Last post
christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
why does SumatraPDF 2.2.1 have two .exe files running_why two executables in program folder?

Downloaded SumatraPDFportable_2.2.1.paf.exe from here & ran the extractor / "installer." It creates 2 executable files for Sumatra - in different sub folders.

One in top folder is SumatraPDFportable.exe.
The other in sub folder "\SumatraPDFPortable\App\sumatrapdf\" is named SumatraPDF.exe. Why two .exe files?

Also, when start Sumatra, both of these.exe files (exact names above) are shown in task mgr. Why two files?
Thanks.

Darkbee
Darkbee's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-04-14 09:41
Perfectly Normal

The SumatraPDFportable.exe file is a container that makes SumatraPDF.exe portable. It takes care of any registry entries/temporary files and such. You MUST run Sumatra using SumatraPDFportable.exe and it will take care of the rest. The behavior you describe is perfectly normal for all PortableApps packaged apps.

christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
Thanks. OK, I get now that

Thanks. OK, I get now that the paf.exe "installer" created the SumatraPDFportable.exe.

The SumatraPDFportable.exe file is a container that makes SumatraPDF.exe portable. It takes care of any registry entries/temporary files and such.

True, I don't understand the entire process now being used, but if the AppNameportable.exe file is "a container," why does it need to be running as an executable? It must be / do * more * than typical container files (that never show as running processes). Container files don't execute anything.

All portable apps using paf.exe installers from PortableApps.com, will have this additional "AppNameportable.exe" running? I'm guessing using the extra file is an easier way to make apps portable vs. re writing them, so they don't write to registry, don't write to user acct files, etc.

It is a bit odd that the sumatraPDFportable.exe file uses the same RAM as Sumatra, itself (before opening any PDFs)~ 3 MB - w/in a few KB. By its design, Sumatra must write more reg entries, user files, etc., than some other apps - or the portable versions.

Ken Herbert
Ken Herbert's picture
Online
Last seen: 37 min 46 sec ago
DeveloperModerator
Joined: 2010-05-25 18:19
Think of it less as a

Think of it less as a container and more as a parent process.

When you run XPortable.exe it sets up what the app needs - whether this be registry entries, files, command line options, environment variables or whatever else it may need.

XPortable.exe then runs X.exe and (in most cases) sits idly waiting for X.exe to close.

Once X.exe has closed it then reverses the changes it made originally, so the PC is left as close to unchanged by the app as is possible, and in the process keeping your settings with the app.

In rare cases you will see apps where XPortable.exe will run, X.exe will run and then XPortable.exe will close - these apps do not require any changes to be undone when X.exe closes.

christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
Thanks. Are you saying the

Thanks. Are you saying the portable apps (from here, that now use AppNameportable.exe file (Xportable.exe), are actually writing temporary entries to registry & other places. Or are these all written within the Xportable.exe file (functioning as a container)?

It sounds like the former, if it has to "reverse changes." I thought one reason for portables was not to make registry changes.

If it's actually writing to the registry, it may reverse them as long as the system doesn't crash or lose power. Then what? If changes ARE made to the registry, many things could go wrong to prevent completely reversing them.

This sounds like a completely different approach than most portables (if I understand).

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 28 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Depends

It varies based on the app. When an app provides the ability to direct it to store data in a specific location, it is stored on the flash drive directly. That's the case with Sumatra PDF. The SumatraPDFPortable.exe launcher moves the data back and forth between the App and Data directory and portablizes the most recently used files list. Otherwise, the data would be in the App directory and lost on upgrades. Plus it would be more difficult to backup (all portable apps here store their data only in AppNamePortable\Data and the PortableApps.com Platform has a built-in backup utility that lets you backup the data from all your apps in about 3 clicks).

Some other apps use the registry like 7-Zip. In that case, 7-ZipPortable.exe moves the user data into the registry on launch and out of it on exit, backing up and restoring any existing local data while its running. Modern Windows PCs crashing these days is an exceedingly rare occurrence unless there is an underlying hardware problem. But, yes, there is the possibility data could be left behind if the PC crashed and you didn't then run the portable app again so it can finish closing (cleaning up and restoring). Bigger issues than that can happen if a buggy PC crashes of course (corrupted hard drive, corrupted flash drive, etc). There is the possibility of using a 3rd party utility to intercept the registry calls of 7-Zip and package it into a virtualized container, but these are hit and miss and all would have licensing issues since they are closed source and 7-Zip is GPLed which would not permit doing this and redistributing.

Note that if there were a way to have 7-Zip write to an INI file or similar without rewriting and recompiling 7-Zip, we'd do it. There is not, though. It's a relative minority of apps that store their data in the registry and have no other option.

This is the generally accepted approach for handling portable software. This is the world's most popular portable software site. I distributed the first portable app with Portable Firefox as a ZIP with a batch file launcher back in 2004.

Sometimes, the impossible can become possible, if you're awesome!

Ken Herbert
Ken Herbert's picture
Online
Last seen: 37 min 46 sec ago
DeveloperModerator
Joined: 2010-05-25 18:19
Depends on the base application

If the base app requires the registry we write to the registry.

Within the definition of "portable" when talking about software there are really two ways of doing so.

The first is called virtualization in which the application runs in a sandbox that stops changes being made to Windows. Automated virtualization technologies like Cameyo and ThinApp are quite hit-and-miss as to whether an application will actually work or not (plus most apps packaged by them are illegally done so).

The second way is what we do. We allow (and assist) the changes made to the system that are necessary for the app to run, and undo them when the app closes. This system is compatible with more apps as we manually determine the changes needed. It is a rare app that can't be made portable with this system (although we currently don't support anything that installs services)

There are potential issues if the computer crashes but the Launcher is set up to handle this so all you need to do is run the app again after the crash and it will perform the cleanup as needed.

christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
Thanks for the detailed

Thanks for the detailed replies.

There are potential issues if the computer crashes but the Launcher is set up to handle this so all you need to do is run the app again after the crash and it will perform the cleanup as needed.

Good to know. IF... the launcher actually can go in, say after a power outage, & completely clean up any "half done stuff," by re running & then closing the app, that's great. However, most would probably prefer portables not write any reg entries. And it sounds like most don't.

For ones that do, Xportable.exe could possibly get corrupted, requiring d/l a fresh copy of the app (if in unlikely event, it caused registry issues).

The file getting corrupted may be fairly rare, but file corruption isn't as rare as Windows completely crashing. Therein lies part of the reason why users don't want some apps writing reg entries. I understand how much faster it is to use this system & make more portable apps available.

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 28 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Protection

All the AppNamePortable.exe launchers have built-in protection against modification. If they change due to file/disk corruption or infection with a virus, they will refuse to run and alert you that they have been modified.

Sometimes, the impossible can become possible, if you're awesome!

christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
Thanks. VERY interesting.

Thanks. VERY interesting. That's pretty specific - where did you get that info & is it available to the public?

Ken Herbert
Ken Herbert's picture
Online
Last seen: 37 min 46 sec ago
DeveloperModerator
Joined: 2010-05-25 18:19
John is the man behind

John is the man behind PortableApps.com - so he knows exactly what the Launcher, Installer, Platform and other components do.

There is no documentation on the Launcher's modification protection, but all PortableApps.com components are open source so the code is there for anyone to check out if they so wish.

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 28 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
CRC Check

The PortableApps.com Launcher and PortableApps.com Installer are built using NSIS, a scripting language. A standard feature is the ability to do a CRCCheck on startup to ensure the EXE has not changed since it was compiled (other than allowing for a digital signature, which we also add to ensure legitimate files). It's available to the public via NSIS which is open source as well as our launcher and installer files which are also open source.

This helps ensure that the PortableApps.com Launcher has not been affected by a virus/malware or corrupted drive bits. And it helps ensure that the PortableApps.com Installers have not been infected by virus/malware on route to you, have downloaded completely and are not otherwise altered by a third party (though this is best checked with the digital signature of our company Rare Ideas, LLC).

Sometimes, the impossible can become possible, if you're awesome!

christina_a
Offline
Last seen: 9 years 2 months ago
Joined: 2012-09-08 17:43
Thanks for detailed replies.

Thanks for detailed replies. I'm sure more than just me are interested in these details. I'll have to take your word on the coding - not knowledgeable enough to evaluate the code completely.

Sounds like a much better plan than apps that try to run w/ 1 or > files clearly corrupted; screwing things up or giving cryptic msgs. Maybe leaving registry in a state where can't reinstall the app w/o finding / deleting reg entries.

NSIS - I love that show.

Darkbee
Darkbee's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2008-04-14 09:41
Aaaannnd... that's a wrap!

NSIS - I love that show.

Biggrin

Log in or register to post comments