commit 635d9d3002e3ec3111467be0bda72962b1db58fc Author: Nguyen Duy Date: Fri Nov 29 17:34:04 2024 +0700 add distro assets diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d18a690 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Nguyen Duy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/drivers/parsec-vdd-0.41.0.0.exe b/drivers/parsec-vdd-0.41.0.0.exe new file mode 100644 index 0000000..324abff Binary files /dev/null and b/drivers/parsec-vdd-0.41.0.0.exe differ diff --git a/drivers/parsec-vdd-0.45.0.0.exe b/drivers/parsec-vdd-0.45.0.0.exe new file mode 100644 index 0000000..9737d6e Binary files /dev/null and b/drivers/parsec-vdd-0.45.0.0.exe differ diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..910e92f Binary files /dev/null and b/icon.ico differ diff --git a/setup.iss b/setup.iss new file mode 100644 index 0000000..9d7c195 --- /dev/null +++ b/setup.iss @@ -0,0 +1,140 @@ + +#define MyAppName "ParsecVDisplay" +#define MyAppPublisher "Nguyen Duy" +#define MyAppURL "https://github.com/nomi-san/parsec-vdd" +#define MyAppExeName "ParsecVDisplay.exe" +#define MyAppCopyright "(c) 2024 Nguyen Duy." + +#define _Major +#define _Minor +#define _Rev +#define _Build +#define MyAppVersion GetVersionComponents("..\bin\ParsecVDisplay.exe", _Major, _Minor, _Rev, _Build), Str(_Major) + "." + Str(_Minor) + "." + Str(_Rev) + +[Setup] +AppId={{D2005B5A-A8C4-4B77-807F-155132973D5D} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +AppVerName={#MyAppName} v{#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +VersionInfoCompany={#MyAppPublisher} +VersionInfoCopyright={#MyAppCopyright} +VersionInfoVersion={#MyAppVersion} +DefaultDirName={commonpf64}\{#MyAppName} +UsePreviousAppDir=yes +DisableProgramGroupPage=yes +LicenseFile=.\LICENSE +PrivilegesRequired=admin +OutputDir=.\out +OutputBaseFilename={#MyAppName}-v{#MyAppVersion}-setup +SetupIconFile=.\icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern +UninstallDisplayName={#MyAppName} +UninstallDisplayIcon={app}\{#MyAppExeName} +ChangesEnvironment=true + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Dirs] +Name: "{app}"; Permissions: everyone-full +Name: "{app}\cli"; Permissions: everyone-full +Name: "{app}\driver"; Permissions: everyone-full + +[Files] +Source: "..\bin\version"; DestDir: "{app}"; Flags: skipifsourcedoesntexist +Source: "..\bin\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "..\bin\{#MyAppExeName}.config"; DestDir: "{app}"; Flags: skipifsourcedoesntexist +Source: "..\bin\vdd.cmd"; DestDir: "{app}\cli"; Flags: ignoreversion +Source: ".\drivers\parsec-vdd-0.41.0.0.exe"; DestDir: "{app}\drivers"; Flags: ignoreversion +Source: ".\drivers\parsec-vdd-0.45.0.0.exe"; DestDir: "{app}\drivers"; Flags: ignoreversion + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" + +[Tasks] +Name: add_startup; Description: "Add program to startup" +Name: add_cli_path; Description: "Add VDD (CLI) to PATH variable" +Name: install_vdd_none; Description: "Do not install"; GroupDescription: "Driver setup"; Flags: exclusive unchecked +Name: install_vdd_0_41; Description: "Parsec VDD v0.41"; GroupDescription: "Driver setup"; Flags: exclusive unchecked +Name: install_vdd_0_45; Description: "Parsec VDD v0.45"; GroupDescription: "Driver setup"; Flags: exclusive + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runascurrentuser; +Filename: "{app}\drivers\parsec-vdd-0.41.0.0.exe"; Parameters: "/S"; Flags: runascurrentuser; Tasks: install_vdd_0_41 +Filename: "{app}\drivers\parsec-vdd-0.45.0.0.exe"; Parameters: "/S"; Flags: runascurrentuser; Tasks: install_vdd_0_45; + +[Registry] +Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppName}"; ValueData: """{app}\{#MyAppExeName}"" -silent"; Flags: uninsdeletevalue; Tasks: add_startup + +[Code] +procedure CurPageChanged(CurPageID: Integer); +begin + if CurPageID = wpSelectTasks then + begin + WizardForm.TasksList.Checked[0] := True; + WizardForm.TasksList.Checked[1] := True; + end; +end; + +const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'; + +procedure EnvAddPath(Path: string); +var + Paths: string; +begin + { Retrieve current path (use empty string if entry not exists) } + if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) + then Paths := ''; + + { Skip if string already found in path } + if Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';') > 0 then exit; + + { App string to the end of the path variable } + Paths := Paths + ';'+ Path +';' + + { Overwrite (or create if missing) path environment variable } + if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) + then Log(Format('The [%s] added to PATH: [%s]', [Path, Paths])) + else Log(Format('Error while adding the [%s] to PATH: [%s]', [Path, Paths])); +end; + +procedure EnvRemovePath(Path: string); +var + Paths: string; + P: Integer; +begin + { Skip if registry entry not exists } + if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) then + exit; + + { Skip if string not found in path } + P := Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';'); + if P = 0 then exit; + + { Update path variable } + Delete(Paths, P - 1, Length(Path) + 1); + + { Overwrite path environment variable } + if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) + then Log(Format('The [%s] removed from PATH: [%s]', [Path, Paths])) + else Log(Format('Error while removing the [%s] from PATH: [%s]', [Path, Paths])); +end; + +procedure CurStepChanged(CurStep: TSetupStep); +begin + if (CurStep = ssPostInstall) and IsTaskSelected('add_cli_path') + then EnvAddPath(ExpandConstant('{app}') + '\cli'); +end; + +procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); +begin + if CurUninstallStep = usPostUninstall + then EnvRemovePath(ExpandConstant('{app}') + '\cli'); +end;