Preliminary installer

This commit is contained in:
Cherryleafroad
2023-09-23 14:41:09 -07:00
parent 5b4473a521
commit 35f08b481f
5 changed files with 276 additions and 0 deletions

BIN
installer/files/License.rtf Normal file

Binary file not shown.

BIN
installer/files/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

BIN
installer/files/nefconc.exe Normal file

Binary file not shown.

BIN
installer/files/nefconw.exe Normal file

Binary file not shown.

276
installer/main.wxs Normal file
View File

@@ -0,0 +1,276 @@
<?xml version='1.0' encoding='windows-1252'?>
<!--
Copyright (C) 2017 Christopher R. Field.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
The "cargo wix" subcommand provides a variety of predefined variables available
for customization of this template. The values for each variable are set at
installer creation time. The following variables are available:
TargetTriple = The rustc target triple name.
TargetEnv = The rustc target environment. This is typically either
"msvc" or "gnu" depending on the toolchain downloaded and
installed.
TargetVendor = The rustc target vendor. This is typically "pc", but Rust
does support other vendors, like "uwp".
CargoTargetBinDir = The complete path to the directory containing the
binaries (exes) to include. The default would be
"target\release\". If an explicit rustc target triple is
used, i.e. cross-compiling, then the default path would
be "target\<CARGO_TARGET>\<CARGO_PROFILE>",
where "<CARGO_TARGET>" is replaced with the "CargoTarget"
variable value and "<CARGO_PROFILE>" is replaced with the
value from the "CargoProfile" variable. This can also
be overriden manually with tne "target-bin-dir" flag.
CargoTargetDir = The path to the directory for the build artifacts, i.e.
"target".
CargoProfile = The cargo profile used to build the binaries
(usually "debug" or "release").
Version = The version for the installer. The default is the
"Major.Minor.Fix" semantic versioning number of the Rust
package.
-->
<!--
Please do not remove these pre-processor If-Else blocks. These are used with
the `cargo wix` subcommand to automatically determine the installation
destination for 32-bit versus 64-bit installers. Removal of these lines will
cause installation errors.
-->
<?if $(sys.BUILDARCH) = x64 or $(sys.BUILDARCH) = arm64 ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>
<?if $(var.CargoProfile) = "debug" ?>
<?define CatFile = "delta.cat" ?>
<?elseif $(var.CargoProfile) = "release" ?>
<?define CatFile = "virtualdisplaydriver.cat" ?>
<?endif ?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product
Id='86ddb158-91bf-4820-aba6-82e2037b757a'
Name='Virtual Display Driver'
UpgradeCode='DAE03BB7-B41F-47C6-AB07-C2ABB4215CB8'
Manufacturer='Cherry'
Language='1033'
Codepage='1252'
Version='$(var.Version)'>
<Package Id='*'
Keywords='Installer'
Description='Foo'
Manufacturer='Cherry'
InstallerVersion='450'
Languages='1033'
Compressed='yes'
InstallScope='perMachine'
SummaryCodepage='1252'
InstallPrivileges="elevated"
/>
<MajorUpgrade
Schedule='afterInstallInitialize'
DowngradeErrorMessage='A newer version of [ProductName] is already installed. Setup will now exit.'/>
<Media Id='1' Cabinet='media1.cab' EmbedCab='yes' DiskPrompt='CD-ROM #1'/>
<Property Id='DiskPrompt' Value='installer Installation'/>
<Property Id="MSIUSEREALADMINDETECTION" Value="1" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Component Id="RegistryEntries" Guid="8FBA73F4-EEA4-4602-AC96-E6B7B1FE2CC4">
<RegistryKey
Root="HKLM"
Key="Software\VirtualDisplayDriver"
ForceDeleteOnUninstall="yes"
>
<RegistryValue Type="integer" Name="port" Value="23112" KeyPath="yes"/>
<RegistryValue Type="string" Name="data" Value=""/>
</RegistryKey>
<RegistryKey
Root="HKLM"
Key="SYSTEM\CurrentControlSet\Services\EventLog\System\VirtualDisplayDriver"
ForceDeleteOnUninstall="yes"
>
<RegistryValue Type="integer" Name="TypesSupported" Value="7"/>
<RegistryValue Type="string" Name="EventMessageFile" Value="[ARPINSTALLLOCATION]driver\VirtualDisplayDriver.dll"/>
</RegistryKey>
</Component>
<Directory Id='$(var.PlatformProgramFilesFolder)' Name='PFiles'>
<Directory Id='APPLICATIONFOLDER' Name='VirtualDisplayDriver'>
<!--
Disabling the license sidecar file in the installer is a two step process:
1. Comment out or remove the `Component` tag along with its contents.
2. Comment out or remove the `ComponentRef` tag with the "License" Id
attribute value further down in this file.
-->
<Component Id='License' Guid='*'>
<File Id='LicenseFile'
Name='License.rtf'
DiskId='1'
Source='$(sys.SOURCEFILEDIR)\files\License.rtf'
KeyPath='yes'/>
</Component>
<Directory Id='Bin' Name='bin'>
<Component Id='VirtualDisplayDriverControlExe' Guid='*'>
<File
Id='exe0'
Name='VirtualDisplayDriverControl.exe'
DiskId='1'
Source='$(var.CargoTargetBinDir)\virtual-display-driver-control.exe'
KeyPath='yes'/>
</Component>
</Directory>
<Directory Id='Driver' Name='driver'>
<Component Id='VirtualDisplayDriverInf' Guid='*'>
<File
Id='inf0'
Name='VirtualDisplayDriver.inf'
DiskId='1'
Source='$(var.CargoTargetBinDir)\VirtualDisplayDriver.inf'
KeyPath='yes'/>
</Component>
<Component Id='VirtualDisplayDriverDll' Guid='*'>
<File
Id='dll0'
Name='VirtualDisplayDriver.dll'
DiskId='1'
Source='$(var.CargoTargetBinDir)\VirtualDisplayDriver.dll'
KeyPath='yes'/>
</Component>
<Component Id='VirtualDisplayDriverCat' Guid='*'>
<File
Id='cat0'
Name='$(var.CatFile)'
DiskId='1'
Source='$(var.CargoTargetBinDir)\$(var.CatFile)'
KeyPath='yes'/>
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Binary Id="NEFCONW" SourceFile="$(sys.SOURCEFILEDIR)\files\nefconw.exe"/>
<CustomAction Id='InstallDriverNode'
BinaryKey='NEFCONW'
Execute='deferred'
Impersonate='no'
ExeCommand='--create-device-node --hardware-id Root\VirtualDisplayDriver --class-name Display --class-guid 4d36e968-e325-11ce-bfc1-08002be10318'
Return='check' />
<CustomAction Id='InstallDriver'
BinaryKey='NEFCONW'
Execute='deferred'
Impersonate='no'
ExeCommand='--install-driver --inf-path "[ARPINSTALLLOCATION]driver\VirtualDisplayDriver.inf"'
Return='check' />
<CustomAction Id='UninstallDriver'
BinaryKey='NEFCONW'
Execute='deferred'
Impersonate='no'
ExeCommand='--remove-device-node --hardware-id Root\VirtualDisplayDriver --class-guid 4d36e968-e325-11ce-bfc1-08002be10318'
Return='ignore' />
<InstallExecuteSequence>
<Custom Action='UninstallDriver' After='InstallFiles'>Installed</Custom>
<Custom Action='InstallDriverNode' After='UninstallDriver'>NOT REMOVE="ALL"</Custom>
<Custom Action='InstallDriver' After='InstallDriverNode'>NOT REMOVE="ALL"</Custom>
</InstallExecuteSequence>
<Feature
Id='Core'
Title='Application'
Description='Installs all binaries and the license.'
Level='1'
ConfigurableDirectory='APPLICATIONFOLDER'
InstallDefault='source'
AllowAdvertise='no'
Display='hidden'
Absent='disallow'>
<!--
Comment out or remove the following `ComponentRef` tag to remove
the license sidecar file from the installer.
-->
<ComponentRef Id='License'/>
<ComponentRef Id='VirtualDisplayDriverInf'/>
<ComponentRef Id='VirtualDisplayDriverDll'/>
<ComponentRef Id='VirtualDisplayDriverControlExe'/>
<ComponentRef Id='VirtualDisplayDriverCat'/>
<ComponentRef Id="RegistryEntries"/>
</Feature>
<SetProperty Id='ARPINSTALLLOCATION' Value='[APPLICATIONFOLDER]' After='CostFinalize'/>
<Icon Id='ProductICO' SourceFile='$(sys.SOURCEFILEDIR)\files\icon.ico'/>
<Property Id='ARPPRODUCTICON' Value='ProductICO' />
<Property Id='ARPHELPLINK' Value='https://github.com/MolotovCherry/virtual-display-rs'/>
<UI>
<UIRef Id='WixUI_Minimal'/>
<!--<UIRef Id='WixUI_FeatureTree'/>-->
<!--
Disabling the EULA dialog in the installer is a two step process:
1. Uncomment the following two `Publish` tags
2. Comment out or remove the `<WiXVariable Id='WixUILicenseRtf'...` tag further down
-->
<!--<Publish Dialog='WelcomeDlg' Control='Next' Event='NewDialog' Value='CustomizeDlg' Order='99'>1</Publish>-->
<!--<Publish Dialog='CustomizeDlg' Control='Back' Event='NewDialog' Value='WelcomeDlg' Order='99'>1</Publish>-->
</UI>
<!--
Disabling the EULA dialog in the installer requires commenting out
or removing the following `WixVariable` tag
-->
<WixVariable Id='WixUILicenseRtf' Value='$(sys.SOURCEFILEDIR)\files\License.rtf'/>
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom banner image across
the top of each screen. See the WiX Toolset documentation for details
about customization.
The banner BMP dimensions are 493 x 58 pixels.
-->
<!--<WixVariable Id='WixUIBannerBmp' Value='wix\Banner.bmp'/>-->
<!--
Uncomment the next `WixVariable` tag to customize the installer's
Graphical User Interface (GUI) and add a custom image to the first
dialog, or screen. See the WiX Toolset documentation for details about
customization.
The dialog BMP dimensions are 493 x 312 pixels.
-->
<!--<WixVariable Id='WixUIDialogBmp' Value='wix\Dialog.bmp'/>-->
</Product>
</Wix>