mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-29 11:01:23 +00:00
templates/windows/installer: Enable split binary and data installation
This is not something InnoSetup is designed for, but hey, it does work!
This commit is contained in:
parent
63540faf3d
commit
12c9fe51fb
1 changed files with 31 additions and 18 deletions
|
@ -73,7 +73,8 @@ LZMAAlgorithm=1
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "@ISS_FILES_DIR@/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "@ISS_FILES_DIR@/data/obs-plugins/@PROJECT_NAME@/*"; DestDir: "{code:GetOutputDataDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
|
Source: "@ISS_FILES_DIR@/obs-plugins/@D_PLATFORM_BITS@bit/*"; DestDir: "{code:GetOutputBinaryDir}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "@PROJECT_SOURCE_DIR@/templates/windows/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
|
Source: "@PROJECT_SOURCE_DIR@/templates/windows/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||||
|
|
||||||
|
@ -92,6 +93,8 @@ procedure InitializeWizard; forward;
|
||||||
function ShouldSkipPage(PageID: Integer): Boolean; forward;
|
function ShouldSkipPage(PageID: Integer): Boolean; forward;
|
||||||
function PrepareToInstall(var NeedsRestart: Boolean): String; forward;
|
function PrepareToInstall(var NeedsRestart: Boolean): String; forward;
|
||||||
function GetDefaultDirectory(Value: String): String; forward;
|
function GetDefaultDirectory(Value: String): String; forward;
|
||||||
|
function GetOutputBinaryDir(Value: String): String; forward;
|
||||||
|
function GetOutputDataDir(Value: String): String; forward;
|
||||||
|
|
||||||
// Which installation mode is selected?
|
// Which installation mode is selected?
|
||||||
function IsPortablePagePortableChoiceChecked(): Boolean; forward;
|
function IsPortablePagePortableChoiceChecked(): Boolean; forward;
|
||||||
|
@ -140,28 +143,38 @@ end;
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
function GetDefaultDirectory(Value: String): String;
|
function GetDefaultDirectory(Value: String): String;
|
||||||
var
|
var
|
||||||
sInstallPath: String;
|
sPath: String;
|
||||||
begin
|
begin
|
||||||
// 1. Use the path we were given on call.
|
// Otherwise, try and figure out where the previous installation of the same type went to.
|
||||||
sInstallPath := Value;
|
if (RegQueryStringValue(HKA64, FindRegistryKey(), 'InstallLocation', sPath)) then begin
|
||||||
|
Result := sPath;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
// 2. If that was empty, try and find it ourselves from the registry.
|
// Install to OBS Studio by default.
|
||||||
if (sInstallPath = '') then
|
if (RegQueryStringValue(HKLM64, 'SOFTWARE\OBS Studio', '', sPath)) then begin
|
||||||
RegQueryStringValue(HKA64, FindRegistryKey(), 'InstallLocation', sInstallPath);
|
Result := sPath;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
// 2. If empty, try and find the "Local Machine" installation of OBS Studio.
|
exit;
|
||||||
if (sInstallPath = '') then
|
end;
|
||||||
RegQueryStringValue(HKLM64, 'SOFTWARE\OBS Studio', '', sInstallPath);
|
|
||||||
|
|
||||||
// 3. If empty, try and find the "Current User" installation of OBS Studio.
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
if (sInstallPath = '') then
|
function GetOutputBinaryDir(Value: String): String;
|
||||||
RegQueryStringValue(HKCU64, 'SOFTWARE\OBS Studio', '', sInstallPath);
|
var
|
||||||
|
sPath: String;
|
||||||
|
begin
|
||||||
|
sPath := ExpandConstant('{app}\obs-plugins\@D_PLATFORM_BITS@bit\');
|
||||||
|
Result := sPath;
|
||||||
|
end;
|
||||||
|
|
||||||
// 6. If empty, just use the default path.
|
function GetOutputDataDir(Value: String): String;
|
||||||
if (sInstallPath = '') then
|
var
|
||||||
sInstallPath := ExpandConstant('{commonpf}\obs-studio');
|
sPath: String;
|
||||||
|
begin
|
||||||
Result := sInstallPath
|
sPath := ExpandConstant('{app}\data\obs-plugins\@PROJECT_NAME@\');
|
||||||
|
Result := sPath;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
Loading…
Reference in a new issue