installer-Windows.iss.in 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #define MyAppName "@CMAKE_PROJECT_NAME@"
  2. #define MyAppVersion "@CMAKE_PROJECT_VERSION@"
  3. #define MyAppPublisher "@PLUGIN_AUTHOR@"
  4. #define MyAppURL "@PLUGIN_WEBSITE@"
  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={{@UUID_APP@}
  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. DirExistsWarning=no
  22. [Languages]
  23. Name: "english"; MessagesFile: "compiler:Default.isl"
  24. [Files]
  25. Source: "..\release\Package\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  26. Source: "..\LICENSE"; Flags: dontcopy
  27. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  28. [Icons]
  29. Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
  30. Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
  31. [Code]
  32. procedure InitializeWizard();
  33. var
  34. GPLText: AnsiString;
  35. Page: TOutputMsgMemoWizardPage;
  36. begin
  37. ExtractTemporaryFile('LICENSE');
  38. LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
  39. Page := CreateOutputMsgMemoPage(wpWelcome,
  40. 'License Information', 'Please review the license terms before installing {#MyAppName}',
  41. 'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
  42. String(GPLText)
  43. );
  44. end;
  45. // credit where it's due :
  46. // following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
  47. function GetDirName(Value: string): string;
  48. var
  49. InstallPath: string;
  50. begin
  51. // initialize default path, which will be returned when the following registry
  52. // key queries fail due to missing keys or for some different reason
  53. Result := '{autopf}\obs-studio';
  54. // query the first registry value; if this succeeds, return the obtained value
  55. if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
  56. Result := InstallPath
  57. end;