diff --git a/innosetup/dircheck.pas b/innosetup/dircheck.pas new file mode 100644 index 00000000..7db291b4 --- /dev/null +++ b/innosetup/dircheck.pas @@ -0,0 +1,18 @@ +procedure InitializeWizard(); +var + defaultPath: String; + currentPath: String; +begin + defaultPath := ExpandConstant('{localappdata}\RuneLite'); + { this defaults to the current installed location read from the registry } + currentPath := GetWizardForm.DirEdit.Text; + if defaultPath <> currentPath then begin + if not DirExists(currentPath) then begin + { Already installed to a non-default location which doesn't exist. + It is not possible to make the installer reenable the dir page here, + but we can at least reset the install location. } + Log(Format('Resetting diredit path to %s', [defaultPath])) + GetWizardForm.DirEdit.Text := defaultPath + end + end +end; \ No newline at end of file diff --git a/innosetup/runelite.iss b/innosetup/runelite.iss index c42697a3..1c8e2b8c 100644 --- a/innosetup/runelite.iss +++ b/innosetup/runelite.iss @@ -55,4 +55,5 @@ Type: filesandordirs; Name: "{app}" [Code] #include "upgrade.pas" -#include "usernamecheck.pas" \ No newline at end of file +#include "usernamecheck.pas" +#include "dircheck.pas" \ No newline at end of file diff --git a/innosetup/runelite32.iss b/innosetup/runelite32.iss index b8c64285..aa1c0c45 100644 --- a/innosetup/runelite32.iss +++ b/innosetup/runelite32.iss @@ -55,4 +55,5 @@ Type: filesandordirs; Name: "{app}" [Code] #include "upgrade.pas" -#include "usernamecheck.pas" \ No newline at end of file +#include "usernamecheck.pas" +#include "dircheck.pas" \ No newline at end of file diff --git a/innosetup/runeliteaarch64.iss b/innosetup/runeliteaarch64.iss index 681799f4..725ec5a0 100644 --- a/innosetup/runeliteaarch64.iss +++ b/innosetup/runeliteaarch64.iss @@ -55,4 +55,5 @@ Type: filesandordirs; Name: "{app}" [Code] #include "upgrade.pas" -#include "usernamecheck.pas" \ No newline at end of file +#include "usernamecheck.pas" +#include "dircheck.pas" \ No newline at end of file