-
Notifications
You must be signed in to change notification settings - Fork 50
NXDRIVE-3133: End the running Drive task before attempting to install #6281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,29 +38,19 @@ WizardStyle=modern | |||||||||||||
| Compression=lzma | ||||||||||||||
| SolidCompression=yes | ||||||||||||||
|
|
||||||||||||||
| ; Controls which files Setup will check for being in use before upgrading | ||||||||||||||
| CloseApplicationsFilter=*.* | ||||||||||||||
| ; Disable the "close applications" prompt. The PrepareToInstall function | ||||||||||||||
| ; already handles killing ndrive.exe before installation proceeds. | ||||||||||||||
| CloseApplications=no | ||||||||||||||
|
|
||||||||||||||
| ; Minimum Windows version required (Windows 8) | ||||||||||||||
| MinVersion=6.2.9200 | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| [InstallDelete] | ||||||||||||||
| ; This is required to handle upgrades from 5.4.0 (PyInstaller 5.0) which had different | ||||||||||||||
| ; Qt DLL structure. Without this, orphaned 32-bit DLLs from 5.4.0 can cause | ||||||||||||||
| ; "DLL load failed while importing QtCore: %1 is not a valid Win32 application" errors. | ||||||||||||||
| Type: filesandordirs; Name: "{app}\PyQt5" | ||||||||||||||
| Type: files; Name: "{app}\Qt*.dll" | ||||||||||||||
| Type: files; Name: "{app}\qt*.dll" | ||||||||||||||
| Type: files; Name: "{app}\python*.dll" | ||||||||||||||
| Type: files; Name: "{app}\vcruntime*.dll" | ||||||||||||||
| Type: files; Name: "{app}\msvcp*.dll" | ||||||||||||||
| Type: files; Name: "{app}\api-ms-*.dll" | ||||||||||||||
| Type: files; Name: "{app}\ucrtbase.dll" | ||||||||||||||
| Type: files; Name: "{app}\libcrypto*.dll" | ||||||||||||||
| Type: files; Name: "{app}\libssl*.dll" | ||||||||||||||
| Type: files; Name: "{app}\libffi*.dll" | ||||||||||||||
| Type: files; Name: "{app}\sqlite3.dll" | ||||||||||||||
| ; Delete everything inside the installation directory before installing new files. | ||||||||||||||
| ; This ensures no orphaned files from previous versions cause conflicts (e.g., | ||||||||||||||
| ; "DLL load failed while importing QtCore" errors due to stale DLLs). | ||||||||||||||
| Type: filesandordirs; Name: "{app}\*" | ||||||||||||||
sourcery-ai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| [UninstallDelete] | ||||||||||||||
|
|
@@ -131,3 +121,31 @@ begin | |||||||||||||
| if (Length(url) > 0) and (Length(username) > 0) then | ||||||||||||||
| Result := True; | ||||||||||||||
| end; | ||||||||||||||
|
|
||||||||||||||
| function IsProcessRunning(const ProcessName: String): Boolean; | ||||||||||||||
| // Check if a process is currently running using tasklist. | ||||||||||||||
| var | ||||||||||||||
| ResultCode: Integer; | ||||||||||||||
| begin | ||||||||||||||
| Exec('cmd', '/C tasklist /FI "IMAGENAME eq ' + ProcessName + '" | find /I "' + ProcessName + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); | ||||||||||||||
| Result := (ResultCode = 0); | ||||||||||||||
| end; | ||||||||||||||
|
|
||||||||||||||
| function PrepareToInstall(var NeedsRestart: Boolean): String; | ||||||||||||||
| // Kill ndrive.exe if it is running before proceeding with the installation. | ||||||||||||||
| // If automatic kill fails, ask user to manually kill Nuxeo Drive | ||||||||||||||
| var | ||||||||||||||
| ResultCode: Integer; | ||||||||||||||
| begin | ||||||||||||||
| Result := ''; | ||||||||||||||
|
|
||||||||||||||
| if not IsProcessRunning('{#MyAppExeName}') then | ||||||||||||||
| Exit; // Force-kill the process | ||||||||||||||
|
|
||||||||||||||
| Exec('taskkill', '/F /IM {#MyAppExeName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); | ||||||||||||||
|
Comment on lines
+143
to
+145
|
||||||||||||||
| Exit; // Force-kill the process | |
| Exec('taskkill', '/F /IM {#MyAppExeName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); | |
| Exit; // Process is not running; nothing to do | |
| Exec('taskkill', '/F /IM {#MyAppExeName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); // Force-kill the process |
Uh oh!
There was an error while loading. Please reload this page.