Skip to content
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

Fixes “Not a valid executable” error in installer #221

Merged
merged 3 commits into from
Dec 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -1215,21 +1215,26 @@ begin
*)

Path:=EditorPage.Values[0]+' ';
if not WildcardMatch(Lowercase(Path), '"*.exe" *') then
PathLength:=Pos('.exe ',Lowercase(Path))+3
else begin
PathLength:=Pos('.exe" ',Lowercase(Path))+2;
Path:=Copy(Path,2,PathLength)+Copy(Path,PathLength+3,Length(Path))
end;
if Pos('.exe',Lowercase(Path))=0 then begin
CustomEditorPath:=EditorPage.Values[0];
CustomEditorOptions:='';

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

end else begin
if not WildcardMatch(Lowercase(Path), '"*.exe" *') then
PathLength:=Pos('.exe ',Lowercase(Path))+3
else begin
PathLength:=Pos('.exe" ',Lowercase(Path))+2;
Path:=Copy(Path,2,PathLength)+Copy(Path,PathLength+3,Length(Path))
end;

(*
* If the specified path does not contain '.exe' at the end,
* CustomEditorPath will be formed with the first three letters of Path,
* but that should not be a problem because the next button is enabled
* only when PathIsValidExecutable() returns True.
*)
CustomEditorPath:=Copy(Path,1,PathLength);
CustomEditorOptions:=Copy(Path,PathLength+2,Length(Path)-PathLength-2);
(*
* If the specified path does not contain '.exe' at the end,
* CustomEditorPath will be formed with the first three letters of Path,
* but that should not be a problem because the next button is enabled
* only when PathIsValidExecutable() returns True.
*)
CustomEditorPath:=Copy(Path,1,PathLength);
CustomEditorOptions:=Copy(Path,PathLength+2,Length(Path)-PathLength-2);
end;
EnableNextButtonOnValidExecutablePath(CustomEditorPath);
end;

Expand Down