From 0ea11ebc462460863d07bf08b796357a63d79506 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Tue, 19 Nov 2019 00:29:28 -0800 Subject: [PATCH 1/4] Implement installation path check on Windows Prior to starting the installation, check if the install location contains special characters and if so use a different default install location as well as display a prompt to the user providing additional details. This is in response to #3605, for which a proper solution has yet to be found. --- desktop/package/windows/Bisq.iss | 56 ++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/desktop/package/windows/Bisq.iss b/desktop/package/windows/Bisq.iss index 9b70352d4da..c2d79df5f81 100644 --- a/desktop/package/windows/Bisq.iss +++ b/desktop/package/windows/Bisq.iss @@ -21,7 +21,7 @@ AppSupportURL=https://bisq.community VersionInfoVersion={#FileVersion} VersionInfoDescription=Bisq Setup VersionInfoCopyright=Copyright (C) {#AppCopyrightYear} -DefaultDirName={localappdata}\Bisq +DefaultDirName={code:GetDefaultDirName} DisableStartupPrompt=Yes DisableDirPage=Yes DisableProgramGroupPage=Yes @@ -55,12 +55,16 @@ Name: sp; MessagesFile: "compiler:Languages\Spanish.isl" [CustomMessages] en.AppComments=The decentralized exchange network en.AppIsRunning=Bisq is running, please close it and run setup again. +en.SpecialAppPath=Your default install path appears to have special characters: %1%n%nThis may prevent Bisq from starting. See https://github.com/bisq-network/bisq/issues/3605 for more information.%n%nYou can either cancel this installation and install as a user without special characters in the username, or proceed with this installation using a different install path that does not contain special characters (e.g. %2). de.AppComments=Das dezentrale Austauschnetzwerk de.AppIsRunning=Bisq läuft, bitte schließen Sie es und führen Sie das Setup erneut aus. +de.SpecialAppPath=Ihr Standardinstallationspfad scheint Sonderzeichen zu enthalten: %1%n%nDies kann den Start von Bisq verhindern. Weitere Informationen finden Sie unter https://github.com/bisq-network/bisq/issues/3605.%n%nSie können diese Installation abbrechen und als Benutzer ohne Sonderzeichen im Benutzernamen installieren oder mit dieser Installation fortfahren, indem Sie einen anderen Installationspfad verwenden, der keine Sonderzeichen enthält (z. B. %2). fr.AppComments=Le réseau d'échange décentralisé fr.AppIsRunning=Bisq est en cours d'exécution, fermez-le et exécutez à nouveau le programme d'installation. +fr.SpecialAppPath=Votre chemin d'installation par défaut semble comporter des caractères spéciaux: %1%n%nCela peut empêcher le démarrage de Bisq. Voir https://github.com/bisq-network/bisq/issues/3605 pour plus d'informations.%n%nVous pouvez annuler cette installation et l'installer en tant qu'utilisateur sans caractères spéciaux dans le nom d'utilisateur ou procéder à cette installation en utilisant un chemin d'installation différent ne contenant pas de caractères spéciaux (par exemple, %2). sp.AppComments=La red de intercambio descentralizado sp.AppIsRunning=Bisq se está ejecutando, ciérrelo y vuelva a ejecutar la configuración. +sp.SpecialAppPath=Su ruta de instalación predeterminada parece tener caracteres especiales: %1%n%nEsto puede evitar que Bisq se inicie. Consulte https://github.com/bisq-network/bisq/issues/3605 para obtener más información.%n%nPuede cancelar esta instalación e instalar como usuario sin caracteres especiales en el nombre de usuario, o continuar con esta instalación utilizando una ruta de instalación diferente que no contenga caracteres especiales (por ejemplo, %2). [Files] Source: "Bisq\Bisq.exe"; DestDir: "{app}"; Flags: ignoreversion @@ -186,11 +190,35 @@ begin end; end; +function isPathSpecial(Path : String): Boolean; +var + I : Integer; +begin + Result := not + ((Length(Path) >= 3) and + (Path[1] >= 'A') and (Path[1] <= 'Z') and + (Path[2] = ':') and + (Path[3] = '\')); + if not Result then + begin + for I := 4 to Length(Path) do + begin + case Path[I] of + '0'..'9', 'A'..'Z', 'a'..'z', '\', ' ', '.', '-', '_', '(', ')': + else + begin + Result := True; + Break; + end; + end; + end; + end; +end; + function InitializeSetup(): Boolean; begin Result := True; - if IsAppRunning() then - begin + if IsAppRunning() then begin MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK); Result := False; end; @@ -205,3 +233,25 @@ begin Result := False; end; end; + +procedure CurPageChanged(CurPageID: Integer); +var + DefaultAppPath : String; + AppPath : String; +begin + DefaultAppPath := ExpandConstant('{localappdata}'); + if (CurPageID = wpSelectDir) and isPathSpecial(DefaultAppPath) then + begin + AppPath := ExpandConstant('{code:GetDefaultDirName}'); + MsgBox(FmtMessage(CustomMessage('SpecialAppPath'), [DefaultAppPath, AppPath]), mbInformation, MB_OK); + end; +end; + +function GetDefaultDirName(Param: String): String; +begin + Result := Format('%s\Bisq', [ExpandConstant('{localappdata}')]); + if isPathSpecial(Result) then + begin + Result := Format('%s\Bisq', [ExpandConstant('{%ProgramW6432}')]); + end; +end; From eba7fddc0f9a265ebc8818960d4019a048033961 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 20 Nov 2019 00:45:45 -0800 Subject: [PATCH 2/4] Ensure the destination location dialog is always shown This resolves #552 --- desktop/package/windows/Bisq.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/package/windows/Bisq.iss b/desktop/package/windows/Bisq.iss index c2d79df5f81..9b27480b4f7 100644 --- a/desktop/package/windows/Bisq.iss +++ b/desktop/package/windows/Bisq.iss @@ -23,7 +23,7 @@ VersionInfoDescription=Bisq Setup VersionInfoCopyright=Copyright (C) {#AppCopyrightYear} DefaultDirName={code:GetDefaultDirName} DisableStartupPrompt=Yes -DisableDirPage=Yes +DisableDirPage=No DisableProgramGroupPage=Yes DisableReadyPage=No DisableFinishedPage=No From 33c611c8cc920e9cd403d2a19fe7b7d43a3f08fa Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 20 Nov 2019 00:56:54 -0800 Subject: [PATCH 3/4] Show the Welcome dialog Rather then potentially being greeted with the newly implemented prompt on the destination location dialog if they have special characters in their install path, greet the user with the Welcome dialog when they initially launch the installer. --- desktop/package/windows/Bisq.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/package/windows/Bisq.iss b/desktop/package/windows/Bisq.iss index 9b27480b4f7..d5d6b32a654 100644 --- a/desktop/package/windows/Bisq.iss +++ b/desktop/package/windows/Bisq.iss @@ -27,7 +27,7 @@ DisableDirPage=No DisableProgramGroupPage=Yes DisableReadyPage=No DisableFinishedPage=No -DisableWelcomePage=Yes +DisableWelcomePage=No DefaultGroupName=Bisq ;Optional License LicenseFile= From 446c80291c8a1dff6f236e1b386b2e465556ffde Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Wed, 20 Nov 2019 00:58:55 -0800 Subject: [PATCH 4/4] Reorder/group setup items logically --- desktop/package/windows/Bisq.iss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/package/windows/Bisq.iss b/desktop/package/windows/Bisq.iss index d5d6b32a654..0239addae8e 100644 --- a/desktop/package/windows/Bisq.iss +++ b/desktop/package/windows/Bisq.iss @@ -22,13 +22,13 @@ VersionInfoVersion={#FileVersion} VersionInfoDescription=Bisq Setup VersionInfoCopyright=Copyright (C) {#AppCopyrightYear} DefaultDirName={code:GetDefaultDirName} +DefaultGroupName=Bisq DisableStartupPrompt=Yes +DisableWelcomePage=No DisableDirPage=No DisableProgramGroupPage=Yes DisableReadyPage=No DisableFinishedPage=No -DisableWelcomePage=No -DefaultGroupName=Bisq ;Optional License LicenseFile= ;Windows 7 with Service Pack 1 or above