File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ Section $(inst_qbt_req) ;"qBittorrent (required)"
3535 SetOutPath " $INSTDIR\translations"
3636 ; Put files there
3737 File /r " translations\qt*.qm"
38+ ; Restore output path because it affects `CreateShortCut`. It affects the "Start in" field.
39+ SetOutPath $INSTDIR
3840
3941 ; Write the installation path into the registry
4042 WriteRegStr HKLM " Software\qBittorrent" " InstallLocation" " $INSTDIR"
Original file line number Diff line number Diff line change @@ -118,6 +118,17 @@ int main(int argc, char *argv[])
118118 // Create Application
119119 auto app = std::make_unique<Application>(argc, argv);
120120
121+ #ifdef Q_OS_WIN
122+ // QCoreApplication::applicationDirPath() needs an Application object instantiated first
123+ // Let's hope that there won't be a crash before this line
124+ const char *envName = " _NT_SYMBOL_PATH" ;
125+ const QString envValue = qEnvironmentVariable (envName);
126+ if (envValue.isEmpty ())
127+ qputenv (envName, Application::applicationDirPath ().toLocal8Bit ());
128+ else
129+ qputenv (envName, u" %1;%2" _qs.arg (envValue, Application::applicationDirPath ()).toLocal8Bit ());
130+ #endif
131+
121132 const QBtCommandLineParameters params = app->commandLineArgs ();
122133 if (!params.unknownParameter .isEmpty ())
123134 {
You can’t perform that action at this time.
0 commit comments