diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-19 13:07:20 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-21 08:19:38 +0100 |
commit | 506173a7f42f34821238a63f3f8c7362c9fae9d9 (patch) | |
tree | c58e90d3e04460ff5e3ce9e24a137e3afdca9faa /scp2 | |
parent | 457aba546f43a4117c5c263028e35c8aaf9bc7f6 (diff) |
tdf#112536 related: make soffice.bin a proper console application on Win
Being a GUI application on Windows (with related flag in the executable header
- see https://blogs.msdn.microsoft.com/oldnewthing/20090101-00/?p=19643/), OS
would detect the subsystem before launching the application, and won't attach
the parent console or redirected output handles from it to the application.
Also, different hacks to reattach the GUI application to the console later are
unreliable on different Windows versions, and work improperly (the output goes
to the console after the launch command has already returned, which is wrong
in batch files). This makes it extremily difficult to do CLI operations with
LibreOffice on Windows, with error codes/warnings/messages/output missing or
going to wrong consoles.
Making an executable for CUI subsystem, on the other hand, makes Windows to
allocate a console before starting it when the program is run by itself. This
makes the console window to appear on screen unconditionally, even if it's
hidden later when the program has started. This flashing is undesirable.
But we use a wrapper executable on Windows, called soffice.exe, which is what
actually launched by user, and which runs soffice.bin. This allows us to make
soffice.bin the proper console application, and thus make it capable to behave
properly in CLI scenarios, while avoid the console flashing when run from the
soffice.exe (which would suppress the console creation using DETACHED_PROCESS
creation flag to CreateProcessW).
Also creating a new wrapper for console (soffice.com) allows to use command
lines which omit explicit executable extension (no ".bin"), like this:
"C:\Program Files\LibreOffice\program\soffice" --help
which allows to continue using multiple available help resources unchanged,
since .com extension is tried prior to .exe by Windows' cmd.exe.
Change-Id: I089d0f30f860da6cfc781b4383f6598a08a4d238
Reviewed-on: https://gerrit.libreoffice.org/63572
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'scp2')
-rw-r--r-- | scp2/source/ooo/folderitem_ooo.scp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scp2/source/ooo/folderitem_ooo.scp b/scp2/source/ooo/folderitem_ooo.scp index 3c0423bbb54f..2e67a6a6aea0 100644 --- a/scp2/source/ooo/folderitem_ooo.scp +++ b/scp2/source/ooo/folderitem_ooo.scp @@ -26,8 +26,8 @@ FolderItem gid_Folderitem_LibreOffice #else FolderID = gid_Folder_Staroffice51; #endif - FileID = auto_brand_exe_soffice; - IconFile = auto_brand_exe_soffice; + FileID = auto_brand_exe_soffice_exe; + IconFile = auto_brand_exe_soffice_exe; IconID = 0; WkDir = gid_Brand_Dir_Program; Parameter = ""; @@ -49,8 +49,8 @@ FolderItem gid_Folderitem_Soffice_Desktop #endif ModuleID = gid_Module_Root; FolderID = PREDEFINED_DESKTOP; - FileID = auto_brand_exe_soffice; - IconFile = auto_brand_exe_soffice; + FileID = auto_brand_exe_soffice_exe; + IconFile = auto_brand_exe_soffice_exe; IconID = 0; ComponentIDFile = "gid_Brand_File_Desktophelper_Txt"; WkDir = gid_Brand_Dir_Program; @@ -74,8 +74,8 @@ FolderItem gid_Folderitem_LibreOffice_SafeMode #else FolderID = gid_Folder_Staroffice51; #endif - FileID = auto_brand_exe_soffice; - IconFile = auto_brand_exe_soffice; + FileID = auto_brand_exe_soffice_exe; + IconFile = auto_brand_exe_soffice_exe; IconID = 0; WkDir = gid_Brand_Dir_Program; Parameter = "--safe-mode"; |