merand
merand

Reputation: 83

Inno Setup: If the specified path does not already exist on the user's system, it will be created automatically:(

If the specified path does not already exist on the user's system, it will be created automatically. But I dont want it to crate automatically. The setup install a notepad++plugin, however if notepad++ is not installed on the user system, it creates a notepad++ file. I want to implement a code which ask user "notepad++ is not installed on your system do you wish to continue?" I am new in innosetup compiler, so I need help about the code part. I found an example on the internet., but that is not the exact code that I want. So please help me..

function NextButtonClick(PageId: Integer): Boolean;
begin
    Result := True;
    if (PageId = wpSelectDir) and not FileExists(ExpandConstant('{app}\yourapp.exe')) then begin
        MsgBox('YourApp does not seem to be installed in that folder.  Please select the correct folder.', mbError, MB_OK);
        Result := False;
        exit;
    end;
end;

Upvotes: 1

Views: 1407

Answers (1)

merand
merand

Reputation: 83

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  if (CurPageID = wpSelectComponents) and IsComponentSelected('notepad_plugin') then
    if not DirExists('/*your directory*/') then
    begin
      MsgBox('Component Selection:' #13#13 'Notepad++ could not be found on your system.', mbInformation, MB_OK);
      Result := False;
    end;
end;      

Upvotes: 1

Related Questions