 [Setup]
  AppId={{6D65ED5C-AF9A-4A7E-AB17-8AE9125CA6E9}}
  AppName=EWSDR
  AppVersion=__VERSION__
  DefaultDirName={pf}\EWSDR
  DefaultGroupName=EWSDR
  UninstallDisplayIcon={app}\ewsdr.exe
  Compression=lzma2
  SolidCompression=yes
  OutputDir=__OUTPUT_DIR__
  ArchitecturesAllowed=x64
  ArchitecturesInstallIn64BitMode=x64
  OutputBaseFilename=__OUTPUT_FILENAME__

  [Languages]
  Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

  [Tasks]
  Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

  [Files]
  Source: "__SOURCE_PATH__\__ARCH__\ewsdr.exe"; DestDir: "{app}"; DestName: "ewsdr.exe"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\wdsp.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libfftw3-3.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libfftw3f-3.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libportaudio.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libfec.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libiio.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libserialport-0.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libusb-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libzstd.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libad9361.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\ewsdr_dmr.dll"; DestDir: "{app}"; Flags: ignoreversion
  Source: "__SOURCE_PATH__\__ARCH__\libmbe.dll"; DestDir: "{app}"; Flags: ignoreversion

  [Icons]
  Name: "{group}\EWSDR"; Filename: "{app}\ewsdr.exe"
  Name: "{group}\EWSDR OpenGL"; Filename: "{app}\ewsdr.exe"; Parameters: "--opengl"

  Name: "{commondesktop}\EWSDR"; Filename: "{app}\ewsdr.exe"; Tasks: desktopicon
  Name: "{commondesktop}\EWSDR OpenGL"; Filename: "{app}\ewsdr.exe"; Parameters: "--opengl"; Tasks: desktopicon

  [Run]
  Filename: "{app}\ewsdr.exe"; Description: "{cm:LaunchProgram,EWSDR}"; Flags: nowait showcheckbox

  [code]
  procedure CurPageChanged(CurPageID: Integer);
  var
    ResultCode: Integer;
  begin
    if CurPageID = wpWelcome then
    begin
      Exec('taskkill', '/F /IM ewsdr.exe', '', 0, ewWaitUntilTerminated, ResultCode);
    end;
  end;
