mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Windows installer: Optionally add calibre install dir to PATH. Default is to add it, to be consistent with per 0.6.17 releases
This commit is contained in:
parent
33cf79c6f4
commit
942b0e74c1
@ -105,15 +105,19 @@ wchar_t* get_app_dirw() {
|
|||||||
|
|
||||||
|
|
||||||
void load_python_dll() {
|
void load_python_dll() {
|
||||||
char *app_dir;
|
char *app_dir, *fc_dir, *fc_file, *dll_dir, *qt_plugin_dir;
|
||||||
char *dll_dir, *qt_plugin_dir;
|
|
||||||
size_t l;
|
size_t l;
|
||||||
|
|
||||||
app_dir = get_app_dir();
|
app_dir = get_app_dir();
|
||||||
l = strlen(app_dir)+20;
|
l = strlen(app_dir)+20;
|
||||||
dll_dir = (char*) calloc(l, sizeof(char));
|
dll_dir = (char*) calloc(l, sizeof(char));
|
||||||
|
fc_dir = (char*) calloc(l, sizeof(char));
|
||||||
|
fc_file = (char*) calloc(l, sizeof(char));
|
||||||
qt_plugin_dir = (char*) calloc(l, sizeof(char));
|
qt_plugin_dir = (char*) calloc(l, sizeof(char));
|
||||||
if (!dll_dir || !qt_plugin_dir) ExitProcess(_show_error(L"Out of memory", L"", 1));
|
if (!dll_dir || !qt_plugin_dir || !fc_dir) ExitProcess(_show_error(L"Out of memory", L"", 1));
|
||||||
_snprintf_s(dll_dir, l, _TRUNCATE, "%sDLLs", app_dir);
|
_snprintf_s(dll_dir, l, _TRUNCATE, "%sDLLs", app_dir);
|
||||||
|
_snprintf_s(fc_dir, l, _TRUNCATE, "%sfontconfig", app_dir);
|
||||||
|
_snprintf_s(fc_file, l, _TRUNCATE, "%s\\fonts.conf", fc_dir);
|
||||||
_snprintf_s(qt_plugin_dir, l, _TRUNCATE, "%sqt_plugins", app_dir);
|
_snprintf_s(qt_plugin_dir, l, _TRUNCATE, "%sqt_plugins", app_dir);
|
||||||
free(app_dir);
|
free(app_dir);
|
||||||
|
|
||||||
@ -121,6 +125,8 @@ void load_python_dll() {
|
|||||||
_putenv_s("MAGICK_CONFIGURE_PATH", dll_dir);
|
_putenv_s("MAGICK_CONFIGURE_PATH", dll_dir);
|
||||||
_putenv_s("MAGICK_CODER_MODULE_PATH", dll_dir);
|
_putenv_s("MAGICK_CODER_MODULE_PATH", dll_dir);
|
||||||
_putenv_s("MAGICK_FILTER_MODULE_PATH", dll_dir);
|
_putenv_s("MAGICK_FILTER_MODULE_PATH", dll_dir);
|
||||||
|
_putenv_s("FC_CONFIG_DIR", fc_dir);
|
||||||
|
_putenv_s("FC_CONFIG_FILE", fc_file);
|
||||||
_putenv_s("QT_PLUGIN_PATH", qt_plugin_dir);
|
_putenv_s("QT_PLUGIN_PATH", qt_plugin_dir);
|
||||||
|
|
||||||
if (!SetDllDirectoryA(dll_dir)) ExitProcess(show_last_error(L"Failed to set DLL directory."));
|
if (!SetDllDirectoryA(dll_dir)) ExitProcess(show_last_error(L"Failed to set DLL directory."));
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
|
|
||||||
<DirectoryRef Id="APPLICATIONFOLDER">
|
<DirectoryRef Id="APPLICATIONFOLDER">
|
||||||
{app_components}
|
{app_components}
|
||||||
|
<Component Id="AddToPath" Guid="*">
|
||||||
|
<Environment Id='UpdatePath' Name='PATH' Action='set' System='yes' Part='last' Value='[APPLICATIONFOLDER]' />
|
||||||
|
<RegistryValue Root="HKCU" Key="Software\Microsoft\{app}" Name="system_path_updated" Type="integer" Value="1" KeyPath="yes"/>
|
||||||
|
</Component>
|
||||||
</DirectoryRef>
|
</DirectoryRef>
|
||||||
|
|
||||||
<DirectoryRef Id="ApplicationProgramsFolder">
|
<DirectoryRef Id="ApplicationProgramsFolder">
|
||||||
@ -84,6 +88,11 @@
|
|||||||
Description="Shortcut to {app} on your desktop">
|
Description="Shortcut to {app} on your desktop">
|
||||||
<ComponentRef Id="DesktopShortcut"/>
|
<ComponentRef Id="DesktopShortcut"/>
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
|
<Feature Id="FAddToPath" Title="Add install directory to path" Level="1"
|
||||||
|
Description="Add installation directory to PATH. Makes using command line tools easier">
|
||||||
|
<ComponentRef Id="AddToPath"/>
|
||||||
|
</Feature>
|
||||||
</Feature>
|
</Feature>
|
||||||
|
|
||||||
<!-- Add icon to entry in Add/Remove programs -->
|
<!-- Add icon to entry in Add/Remove programs -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user