You are here

[Fixed] Sumatra PDF 3.3.3 resets preferences when multiple files are opened?

6 posts / 0 new
Last post
daniel_schaaaf
Offline
Last seen: 2 weeks 6 days ago
Joined: 2021-10-07 03:12
[Fixed] Sumatra PDF 3.3.3 resets preferences when multiple files are opened?

When I open multiple documents by marking them in a file explorer and hitting the enter key, Sumatra PDF overwrites the portable settings with a default version of the settings.

This also happens (unsurprisingly) when I execute SumatraPDF64.exe directly, instead of launching SumatraPDFPortable.exe.
I searched for registry entries pointing to \PortableApps\SumatraPDFPortable\App\SumatraPDF\SumatraPDF64.exe, but found none. All file associations point correctly to \PortableApps\SumatraPDFPortable\SumatraPDFPortable.exe.

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

I set SumatraPDF Portable to Single Page as the default and closed it. Then I dragged 3 mobi files onto SumatraPDFPortable.exe and all 3 opened with the settings working correctly. Then I dragged 3 more and another 3 opened and Sumatra settings still were retained. Have you tried properly setting the association as:

"PATHTO\SumatraPDFPortable.exe" "%1" %*

That allows it to open multiple files all at once rather than trying to run the launcher 3 times at the same time, which will likely stomp all over your settings.

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

daniel_schaaaf
Offline
Last seen: 2 weeks 6 days ago
Joined: 2021-10-07 03:12
I tried "PATHTO

I tried "PATHTO\SumatraPDFPortable.exe" "%1" %*, but it didn't help.

Dropping files on SumatraPDFPortable.exe or an open Sumatra PDF window works for me too. I can also open multiple files the way I described without problem, when Sumatra PDF is running already.
The settings are only reset when Sumatra PDF is not running, I mark multiple files in a file explorer (Windows File Explorer or XYplorer), and hit enter.
LibreOffice does not reset its settings when I open files this way.

daniel_schaaaf
Offline
Last seen: 2 weeks 6 days ago
Joined: 2021-10-07 03:12
I found a solution that

I found a solution that should work for everyone, although I seem to be the only one bothered by SumatraPDF's behaviour Smile

SumatraPDF accepts custom folders for its settings and cache as a command line argument. Adding the following line to [Launch] (in \App\AppInfo\Launcher\SumatraPDFPortable.ini) avoids copying the settings file completely:

CommandLineArguments='-appdata "%PAL:DataDir%\settings"'

The full SumatraPDFPortable.ini, with the old file handling removed would be:
[Launch]
ProgramExecutable=sumatrapdf\SumatraPDF.exe
ProgramExecutable64=sumatrapdf\SumatraPDF64.exe
DirectoryMoveOK=yes
SupportsUNC=yes
MinOS=Vista
CommandLineArguments='-appdata "%PAL:DataDir%\settings"'

[Activate]
Ghostscript=find

[Language]
Base=%PortableApps.comLocaleglibc%
DefaultIfNotExists=en

[LanguageStrings]
en_US=en
pt_BR=br
zh_CN=cn
zh_TW=tw
sr_RS=sr-rs
sr=sp-rs

[LanguageFile]
Type=ConfigRead
File=%PAL:DataDir%\settings\SumatraPDF-settings.txt
Entry="UiLanguage = "

[FileWrite1]
Type=ConfigWrite
File=%PAL:DataDir%\settings\SumatraPDF-settings.txt
Entry="UiLanguage = "
Value=%PAL:LanguageCustom%

The only other thing to change would be to copy the directory \Data\sumatrapdfcache to \Data\settings\sumatrapdfcache. I guess this would be done in PortableApps.comInstallerCustom.nsh? i could make the changes and test them, but that would take a few days Smile

Also, why does installer.ini remove \Data\settings\sumatrapdfprefs.txt? Doesn't that delete the old configuration when updating?

John T. Haller
John T. Haller's picture
Offline
Last seen: 3 hours 46 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Fixed in 3.3.3 Rev 3

This is fixed in the new release just posted. I used the -appdata switch. Not sure when that was added but thanks for pointing it out.

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

daniel_schaaaf
Offline
Last seen: 2 weeks 6 days ago
Joined: 2021-10-07 03:12
Wonderful

Wonderful Smile
Thank you for fixing/updating so quickly!

Log in or register to post comments