installer-Windows.iss.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #define MyAppName "@CMAKE_PROJECT_NAME@"
  2. #define MyAppVersion "@CMAKE_PROJECT_VERSION@"
  3. #define MyAppPublisher "@PLUGIN_AUTHOR@"
  4. #define MyAppURL "http://www.mywebsite.com"
  5. [Setup]
  6. ; NOTE: The value of AppId uniquely identifies this application.
  7. ; Do not use the same AppId value in installers for other applications.
  8. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  9. AppId={6D6B5E42-2DF1-4747-9A40-8BEA6AAB433F}
  10. AppName={#MyAppName}
  11. AppVersion={#MyAppVersion}
  12. AppPublisher={#MyAppPublisher}
  13. AppPublisherURL={#MyAppURL}
  14. AppSupportURL={#MyAppURL}
  15. AppUpdatesURL={#MyAppURL}
  16. DefaultDirName={code:GetDirName}
  17. DefaultGroupName={#MyAppName}
  18. OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
  19. Compression=lzma
  20. SolidCompression=yes
  21. [Languages]
  22. Name: "english"; MessagesFile: "compiler:Default.isl"
  23. [Files]
  24. Source: "..\release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  25. Source: "..\LICENSE"; Flags: dontcopy
  26. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  27. [Icons]
  28. Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
  29. Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
  30. [Code]
  31. procedure InitializeWizard();
  32. var
  33. GPLText: AnsiString;
  34. Page: TOutputMsgMemoWizardPage;
  35. begin
  36. ExtractTemporaryFile('LICENSE');
  37. LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
  38. Page := CreateOutputMsgMemoPage(wpWelcome,
  39. 'License Information', 'Please review the license terms before installing {#MyAppName}',
  40. 'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
  41. String(GPLText)
  42. );
  43. end;
  44. // credit where it's due :
  45. // following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
  46. function GetDirName(Value: string): string;
  47. var
  48. InstallPath: string;
  49. begin
  50. // initialize default path, which will be returned when the following registry
  51. // key queries fail due to missing keys or for some different reason
  52. Result := '{pf}\obs-studio';
  53. // query the first registry value; if this succeeds, return the obtained value
  54. if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
  55. Result := InstallPath
  56. end;