0

Is there a constant / installer variable / function available to find the destination location during upgrade ? I checked How do you find the user-selected install path in Inno Setup? but both WizardDirValue() as well as ExpandConstant('{app}') throw an exception when used during upgrade. I understand that the Inno Setup: App Path key under uninstall registry key can be read to find the location during upgrade. Wanted to understand if there is any alternative ? Trying to use WizardForm.DirEdit.Text also throws exception

Anand
  • 473
  • 3
  • 14
  • It's not true that `WizardDirValue` or `app` constant throw an exception during upgrade. They may throw an exception in specific situations. You have to show us how exactly are you using them. – Martin Prikryl Aug 12 '17 at 16:23

1 Answers1

1

In event function UpdateReadyMemo constant app is accessible.

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
    s: String;
begin
    s := ExpandConstant('{app}');
    MsgBox(s, mbInformation, MB_OK);
    Result := MemoComponentsInfo
end;

UpdateReadyMemo is automatically called just before ready to install dialog. Its return value will be shown in this dialog.

  • Aah.... I tried `ExpandConstant('{app}')` before psoting the question but did not realize that I was also accessing another control from the wpSelectDir page during upgrade in the code and that it was also problematic when the page was skipped for the upgrade case. – Anand Aug 14 '17 at 07:07
  • There is no problem using `{app}` if `wpSelectDir` is skipped, but you can still only do so strictly after `wpSelectDir` would have been shown or in its `NextButtonClick` (which is also still called even if skipped). – Miral Aug 21 '17 at 07:10