From 912f2afcd5fc4715df4e12b5cfe6343099b2dd88 Mon Sep 17 00:00:00 2001 From: univrsal Date: Sun, 8 Mar 2020 16:36:47 +0100 Subject: [PATCH] fixed Readme added inno setup file --- package/README.txt | 4 +-- package/installer.iss | 69 +++++++++++++++++++++++++++++++++++++ package/package-windows.ps1 | 15 ++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 package/installer.iss diff --git a/package/README.txt b/package/README.txt index 9424130..8067584 100644 --- a/package/README.txt +++ b/package/README.txt @@ -1,6 +1,6 @@ -tuna v1.4.0 +tuna v@VERSION This program is licensed under the GPL v2.0 See LICENSE.txt -github.com/univrsal/tuna +github.com/univrsal/@PROJECT INSTALLATION diff --git a/package/installer.iss b/package/installer.iss new file mode 100644 index 0000000..8dcb8a3 --- /dev/null +++ b/package/installer.iss @@ -0,0 +1,69 @@ +; Taken from https://raw.githubusercontent.com/Palakis/obs-websocket/4.x-current/installer/installer.iss + +#define MyAppName "@PROJECT" +#define MyAppVersion "@VERSION" +#define MyAppPublisher "univrsal" +#define MyAppURL "http://github.com/unvirsal/@PROJECT" +#define Uninstall "Uninstall " + MyAppName + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{@APPID} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={code:GetDirName} +DefaultGroupName={#MyAppName} +DisableProgramGroupPage=yes +OutputBaseFilename=tuna-@ARCH +Compression=lzma +SolidCompression=yes + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] +Source: "@BUILDDIR\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "..\LICENSE"; Flags: dontcopy +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" +Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{#Uninstall}" + +[Code] +procedure InitializeWizard(); +var + GPLText: AnsiString; + Page: TOutputMsgMemoWizardPage; +begin + ExtractTemporaryFile('LICENSE'); + LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText); + + Page := CreateOutputMsgMemoPage(wpWelcome, + 'License Information', 'Please review the license terms before installing obs-websocket', + 'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.', + String(GPLText) + ); +end; + +// credit where it's due : +// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45 +function GetDirName(Value: string): string; +var + InstallPath: string; +begin + // initialize default path, which will be returned when the following registry + // key queries fail due to missing keys or for some different reason + Result := '{pf}\obs-studio'; + // query the first registry value; if this succeeds, return the obtained value + if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then + Result := InstallPath +end; + diff --git a/package/package-windows.ps1 b/package/package-windows.ps1 index d8c70dd..da5456e 100644 --- a/package/package-windows.ps1 +++ b/package/package-windows.ps1 @@ -10,6 +10,8 @@ $arch_64 = "win64" $msvc = "2017" $qt = "5_10_1" $build = "RelWithDebInfo" +$appid = "A34796B1-6A14-4DC9-A37F-43D23BA9DF17" +$innoc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" $build_location_x32 = $base_dir + "build32\rundir\" + $build + "\obs-plugins\32bit" $qtc_build_location_x32 = $base_dir + "build-obs-studio-Desktop_Qt_" + $qt + "_MSVC" + $msvc + "_32bit-" + $build +"\rundir\" + $build + "\obs-plugins\32bit" @@ -76,12 +78,25 @@ echo("Fetching data") Copy-Item $data_dir/* -Destination $build_dir/plugin/data/obs-plugins/$project/ -Recurse Copy-Item ../LICENSE -Destination $build_dir/LICENSE.txt Copy-Item ./README.txt $build_dir/README.txt + replace $build_dir/README.txt "@VERSION" $version +replace $build_dir/README.txt "@PROJECT" $project echo("Making archive") cd $build_dir sz a -r "../$build_dir.zip" "./*" cd .. +echo("Preparing installer") +Copy-Item ./installer.iss ./installer.tmp.iss +replace ./installer.tmp.iss "@VERSION" $version +replace ./installer.tmp.iss "@PROJECT" $project +replace ./installer.tmp.iss "@APPID" $appid +replace ./installer.tmp.iss "@BUILDDIR" "$build_dir/plugin" +replace ./installer.tmp.iss "@ARCH" $arch +echo("Creating installer") +& $innoc /O./ "./installer.tmp.iss" + echo("Cleaning up") Remove-Item $build_dir/ -Recurse +Remove-item ./installer.tmp.iss \ No newline at end of file