Skip to content

Commit

Permalink
Implement installation path check on Windows (#3642)
Browse files Browse the repository at this point in the history
* 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.

* Ensure the destination location dialog is always shown

This resolves #552

* 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.

* Reorder/group setup items logically
  • Loading branch information
ripcurlx authored Nov 20, 2019
2 parents 95257b1 + 446c802 commit 778e9b2
Showing 1 changed file with 56 additions and 6 deletions.
62 changes: 56 additions & 6 deletions desktop/package/windows/Bisq.iss
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ AppSupportURL=https://bisq.community
VersionInfoVersion={#FileVersion}
VersionInfoDescription=Bisq Setup
VersionInfoCopyright=Copyright (C) {#AppCopyrightYear}
DefaultDirName={localappdata}\Bisq
DefaultDirName={code:GetDefaultDirName}
DefaultGroupName=Bisq
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableWelcomePage=No
DisableDirPage=No
DisableProgramGroupPage=Yes
DisableReadyPage=No
DisableFinishedPage=No
DisableWelcomePage=Yes
DefaultGroupName=Bisq
;Optional License
LicenseFile=
;Windows 7 with Service Pack 1 or above
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;

0 comments on commit 778e9b2

Please sign in to comment.