Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 09-29-2025, 06:52 PM   #1
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,708
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Sigil and calibre Open With

I was noticing that with Sigil 2.6.2 compiled with Qt 6.9.2, Sigil no longer opens with either the Open With plugin or calibre's builtin Open With action. At this time, I tend to suspect that this is due to calibre still using Qt 6.8.2 but will do some more digging into this. The debug output command line works if I copy/paste it to a command prompt or into a batch file.
DNSB is offline   Reply With Quote
Old 09-29-2025, 08:20 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,206
Karma: 60406678
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by DNSB View Post
I was noticing that with Sigil 2.6.2 compiled with Qt 6.9.2, Sigil no longer opens with either the Open With plugin or calibre's builtin Open With action. At this time, I tend to suspect that this is due to calibre still using Qt 6.8.2 but will do some more digging into this. The debug output command line works if I copy/paste it to a command prompt or into a batch file.
Works for me W10 using Open With PI (my default for years).
theducks is offline   Reply With Quote
Advert
Old 09-30-2025, 08:25 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,708
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by theducks View Post
Works for me W10 using Open With PI (my default for years).
Are you using Sigil 2.6.2 with Qt 6.8.2? It works for me if I compile Sigil using Qt 6.8.2. It's when I update Qt to 6.9.2 that either of calibre's Open With options fail. See the attached image.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-09-30 172249.png
Views:	24
Size:	32.5 KB
ID:	218413  
DNSB is offline   Reply With Quote
Old 09-30-2025, 08:34 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,206
Karma: 60406678
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I use the stock download with QT 6.8.2.

Sorry
theducks is offline   Reply With Quote
Old 10-01-2025, 09:52 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,818
Karma: 206879174
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Did a little debugging of this on my own and discovered what's happening, but not exactly why. It's related to my previous thread about about certain versions of the VC++ redist runtime not being sufficient to run Sigil and its included Qt6.9.2 (https://www.mobileread.com/forums/sh...d.php?t=369925).

Calibre distributes MSVCP140.dll with its own installer and that is the version that Sigil is trying to use (and silently failing) when launched from Calibre with its inherent Open With feature. The same command line (provided by calibre-debug) uses the system MSVCP140.dll (which is newer than calibre's) and succeeds when run outside of Calibre. The fault can be seen in the Windows Event Viewer after trying to launch Sigil with Calibre's Open With (note the faulting module path):

Code:
Faulting application name: Sigil.exe, version: 2.6.2.0, time stamp: 0x68cac4a8
Faulting module name: MSVCP140.dll, version: 14.36.32532.0, time stamp: 0x04a30cf0
Exception code: 0xc0000005
Fault offset: 0x0000000000012f58
Faulting process id: 0x37b0
Faulting application start time: 0x01dc32d777d6ff52
Faulting application path: C:\Program Files\Sigil\Sigil.exe
Faulting module path: C:\Program Files\Calibre2\app\bin\MSVCP140.dll
Report Id: 897b5901-dac8-44bc-80fd-e48cad7fcf17
Faulting package full name: 
Faulting package-relative application ID:
This is probably only relevant to a Sigil that is built with very recent versions of Visual Studio's C++ compiler and toolchain (which would include my CI builds). My own Windows Sigil releases are still built with an older version of Visual Studio c++ compiler and toolchain, and probably will be until something forces me to update. I will confirm that my release builds of Sigil aren't going to be affected by this and report back.

Otherwise, this will probably be an issue until Calibre includes a newer MSVCP140.dll that is compatible with exe's built with newer versions of the Visual Studio C++ toolchain (or until Kovid discovers a way to sanitize the Open With process environment in such a way that its own bundled MSVCP140.dll is not used by external programs that Calibre launches). Not that I'm trying to make work for him! I'm just not convinced this will be an issue with official Sigil releases.

Last edited by DiapDealer; 10-01-2025 at 10:05 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 10-01-2025, 10:52 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,818
Karma: 206879174
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Well apparently no. Even when built with my release environment (using version 14.39 of the VS vc++ compiler), the Qt6.9.2 version of Sigil will not launch from Calibre's Open With with its 14.36.32532 version of MSVCP140.dll. So much for that.
DiapDealer is offline   Reply With Quote
Old 10-02-2025, 05:55 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,708
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it may be worth, I tried compiling calibre with the newer msvcp dlls. To speed things up, I took one of my existing Linux VMs and increased it's CPU count, disk size and memory sice. It wasn't as painful as I thought it would be but did take longer than I thought it would to create the Windows installer. I suspect this to have to do with creating new QEMU VMs inside a VMWare Workstation VM. The newly compiled and installed calibre with msvcp 1.44.35207 works with Open With. Since I'm not certain how many new bugs I have created with this, I've reverted to the stock calibre.

Last edited by DNSB; 10-02-2025 at 05:57 PM.
DNSB is offline   Reply With Quote
Old 10-02-2025, 08:05 PM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,818
Karma: 206879174
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I've recompiled Qt6.9.2 with an older version of the VC++ compiler (19.40) and hope to test with a version of Sigil built using it eventually. I fear backward compatibility has been broken somewhere in the Visual Studio tool chain. Even the version of VC++ used to compile Sigil's Qt6.8.2 is newer than the 14.36 version of msvcp140.dll included with Calibre, and it still worked with no problems.

Last edited by DiapDealer; 10-04-2025 at 07:16 PM.
DiapDealer is offline   Reply With Quote
Old 10-04-2025, 12:05 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,569
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is because calibre uses SetDllDirectory so that exes it bundles load their implicitly linked dlls from the calibre dll directory. This is a process global setting and cant really be turned off when launching external programs because its not a thread safe API. Sigil can fix this (not easily) by using a stub launcher for its exe which calls setdlldirectory itself and then loads a dll using LoadLibrary() that contains the actual launcher code (this is what calibre on windows does (see bypy/windows/main.c for an example).

In calibre I could fix this by running a worker process for every launch that resets setdlldirectory and then does the actual launching to get around the thread safety issues, but this is both 1) likely to be fragile 2) add a lot of delay to running external programs as the worker will need to spin up both python and qt to use QDesktopServices.openUrl. Or I could use the existing cleanup on exit worker to do this, which fixes 2 since that worker is launched anyway. 1 remains though.

On the other hand I could just ignore the thread safety issues (calibre already resets env vars when launching which have similar thread safety issues).
kovidgoyal is offline   Reply With Quote
Old 10-04-2025, 12:50 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,569
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There you go: https://github.com/kovidgoyal/calibr...8738af6b5ea566

EDIT: Never mind this isnt the codepath used on windows, I think I will try using ShellExecuteEx instead.

Last edited by kovidgoyal; 10-04-2025 at 01:44 AM.
kovidgoyal is offline   Reply With Quote
Old 10-04-2025, 04:18 PM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,818
Karma: 206879174
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I really appreciate the effort. But please don't make changes to Calibre you're not comfortable with just to accommodate this. I'm still determined to find out why the backward compatibility we've enjoyed for so long with VC++ compiler versions/runtimes seems to have been broken. Or maybe figure out what I've done wrong compiling Qt6.9.2 to make it seem so.
DiapDealer is offline   Reply With Quote
Old 10-04-2025, 10:08 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,569
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This should take care of it, a much simpler solution that delegates actually running the opened program to the windows shell so that should provide completely clean separation of the calibre environmet from that of the launched application.

https://github.com/kovidgoyal/calibr...1a065bfde4f6e0
kovidgoyal is offline   Reply With Quote
Old 10-04-2025, 11:03 PM   #13
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 47,708
Karma: 172313956
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
No joy. I reverted to the downloaded 8.12, updated the source and still gives the same nothing happens. Paint.net still opens but not Sigil. I am running from source so that might be why.

Open With with Sigil 2.6.2 with Qt 6.8.2 still works.

Code:
[3.28] main UI initialized...
[3.28] Hiding splash screen
[3.30] splash screen hidden
[3.30] Started up in 3.30 seconds with 2 books
Open:  C:\Program Files\Sigil\Sigil.exe (file):  C:\Users\<username>\Calibre\Intake\Courtenay Raia\The New Prometheans (950)\The New Prometheans - Courtenay Raia.epub  (args):  
cmd_line: "C:\Program Files\Sigil\Sigil.exe" "C:\Users\<username>\Calibre\Intake\Courtenay Raia\The New Prometheans (950)\The New Prometheans - Courtenay Raia.epub"
Running Open With commandline: '"C:\\Program Files\\Sigil\\Sigil.exe" "%1"'  |==>  C:\Program Files\Sigil\Sigil.exe "C:\Users\<username>\Calibre\Intake\Courtenay Raia\The New Prometheans (950)\The New Prometheans - Courtenay Raia.epub"
Running Open With commandline: '"C:\\Program Files\\paint.net\\paintdotnet.exe" "%1"'  |==>  C:\Program Files\paint.net\paintdotnet.exe "C:\Users\<username>\Calibre\Intake\Courtenay Raia\The New Prometheans (950)\cover.jpg"
[31.20] Shutdown starting...
[31.42] [Backup Configuration Folder]: starting backup process
[33.58] [Backup Configuration Folder]: wrote config backup to C:\Users\<username>\Desktop\Calibre Config Backups\backup-calibre\2025-10-04 at 19-53-49.zip. Size: 84,860,586 bytes.
[33.58] [Backup Configuration Folder]: finished
[35.61] Shutdown complete, quitting...

Last edited by DNSB; 10-04-2025 at 11:23 PM.
DNSB is offline   Reply With Quote
Old 10-04-2025, 11:53 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,569
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm then it's likely to be something else as I dont see how setdlldirectory can persist across ShellExecuteEx
kovidgoyal is offline   Reply With Quote
Old 10-05-2025, 08:54 AM   #15
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,818
Karma: 206879174
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm finding some evidence little by little that suggests that any app component built by Visual Studio 17.10 or newer (that uses mutex) will require a minimum of version 14.40.33810.0 of the. VC++ runtime to run without crashing.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil Error Message: Book File Would Not Open in Sigil fkustaa Sigil 9 04-27-2025 05:11 AM
Calibre cannot open ebook reader, edit books, or re-open once closed baggins41 Calibre 15 04-22-2021 07:54 AM
New message when I open Sigil 0.9.17 dynabook Sigil 23 08-19-2019 08:07 PM
Sigil don't open winky8 Sigil 8 12-11-2013 07:15 PM
"PK": Only text when I open in Sigil an ePub file generated with Calibre Terisa de morgan Sigil 3 12-14-2009 11:24 AM


All times are GMT -4. The time now is 05:20 AM.


MobileRead.com is a privately owned, operated and funded community.