1
votes

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;
1
It depends. When do you want to ask the user about that missing Notepad++ ? - TLama
when user choose notepad++plugin to install on the interface. ( I mean when user clicks next button) - merand
Ok, but when ? You click the Next button several times... You mean the last click before the installation actually starts ? Wouldn't that be too late ? From my user's point of view; I'll be happy to download your extension, I'll start the installer and go through the wizard. Now when I'll be ready to install it, the message that I'm not having the Notepad++ which is the only thing this extension needs will popup. Isn't that wasting of my time ? I have no problem to post you a script which will do that, just try to think about it ;-) - TLama
ok, I dont need the script anymore, I solved the problem Tlama;-)) - merand

1 Answers

1
votes
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;