Skip to content

Commit

Permalink
installer: change the ui and installation processes
Browse files Browse the repository at this point in the history
- gives user the ability to change the install folder

Change-Id: Ib3c129778a5cd483f34d403d59c2865aa8ff49eb
  • Loading branch information
Ming Rui Zhang authored and atraczyk committed May 31, 2019
1 parent e276577 commit c551f1d
Show file tree
Hide file tree
Showing 9 changed files with 1,033 additions and 753 deletions.
6 changes: 6 additions & 0 deletions JamiInstaller/BuildinChang.wxl
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="AdvancedWelcomeEulaDlgDescriptionPerMachine">By installing this software you agree to the terms in the license agreement</String>
<UI Dialog="ExitDialog" Control="OptionalCheckBox" Width="10" Height="10" X="135" Y="110" />
<UI Dialog="ExitDialog" Control="OptionalText" X="150" Y="110" />
</WixLocalization>
84 changes: 42 additions & 42 deletions JamiInstaller/Components.wxs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions JamiInstaller/JamiInstaller.wax
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-16"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DeployedProjects />
<DirectoryMappings />
<FileMappings />
<DeploySymbols>false</DeploySymbols>
<DeployLocalizations>true</DeployLocalizations>
<DeployExternalLocalizations>false</DeployExternalLocalizations>
</Configuration>
5 changes: 5 additions & 0 deletions JamiInstaller/JamiInstaller.wixproj
Expand Up @@ -42,6 +42,8 @@
</ItemGroup>
<ItemGroup>
<Content Include="Config.wxi" />
<Content Include="JamiInstaller.wax" />
<Content Include="jamites.bmp" />
<Content Include="main-banner.bmp" />
<Content Include="top-banner.bmp" />
</ItemGroup>
Expand All @@ -55,6 +57,9 @@
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="BuildinChang.wxl" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
Expand Down
89 changes: 56 additions & 33 deletions JamiInstaller/Product.wxs
Expand Up @@ -7,6 +7,7 @@
<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />

<!--Icon File should be in release folder(not wix project), otherwise cannot be read-->
<Icon Id="icon.ico" SourceFile="$(var.ReleaseDir)\jami.ico" />
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="ARPNOMODIFY" Value="1" />
Expand All @@ -20,17 +21,33 @@
<MergeRef Id="VCRedist" />
</Feature>

<!--Find User Defined Installition Registry If User changes the Default Registry-->
<Property Id="APPLICATIONFOLDER" Secure="yes">
<RegistrySearch Id="FindInstallLocation"
Root="HKLM"
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[WIX_UPGRADE_DETECTED]"
Name="InstallLocation"
Type="raw"
Win64="yes" />
</Property>

<!--SetDirectory of APPLICATIONFOLDER -->
<SetDirectory
Id="APPLICATIONFOLDER"
Value="[ProgramFiles64Folder][ApplicationFolderName]">APPLICATIONFOLDER=""</SetDirectory>
<SetProperty Id="ARPINSTALLLOCATION" Value="[APPLICATIONFOLDER]" After="CostFinalize" />

<UIRef Id="CustomUI" />
<WixVariable Id="WixUIInfoIcon" Value="icon.ico"/>
<WixVariable Id="WixUIBannerBmp" Value="top-banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="main-banner.bmp" />
<WixVariable Id="WixUISupportPerUser" Value="0" />
</Product>

<Fragment Id="DirectoryStructure">
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="ManufacturerFolder" Name="$(var.Manufacturer)">
<Directory Id="INSTALLFOLDER" Name="$(var.Name)" />
</Directory>
<Directory Id="APPLICATIONFOLDER" Name="$(var.Name)" />
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
<Directory Id="ProgramMenuFolder">
Expand All @@ -46,6 +63,7 @@
Target="[#fileMain.exe]" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="DesktopFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software/$(var.Name)" Name="desktop" Type="integer" Value="1" KeyPath="yes" />
<!--<Condition>ADDDESKTOPSHORTCUT=1</Condition>-->
</Component>
</DirectoryRef>

Expand All @@ -55,46 +73,51 @@
Target="[#fileMain.exe]" WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="StartMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software/$(var.Name)" Name="startmenu" Type="integer" Value="1" KeyPath="yes" />
<!--<Condition>ADDDESKTOPSHORTCUT=1</Condition>-->
</Component>
</DirectoryRef>
</Fragment>

<Fragment Id="UI">
<UI Id="CustomUI">
<UIRef Id="WixUI_Common" />
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="WelcomeDlg" />
<DialogRef Id="WelcomeLicenseNoCheckDlg" />

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1</Publish>

<InstallUISequence>
<Show Dialog="WelcomeDlg" Before="WelcomeLicenseNoCheckDlg">Installed AND PATCH</Show>
<Show Dialog="WelcomeLicenseNoCheckDlg" Before="ProgressDlg">NOT Installed</Show>
</InstallUISequence>
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />

<!--ApplicationFolderName required by WixUI_Advanced -->
<Property Id="ApplicationFolderName" Value="$(var.Manufacturer)\$(var.Name)" />
<UIRef Id="WixUI_Advanced" />

<!--Remove User Exit Dialog-->
<Publish Dialog="AdvancedWelcomeEulaDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish>
<Publish Dialog="InstallDirDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish>
<Publish Dialog="FeaturesDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish>
<Publish Dialog="MaintenanceWelcomeDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Cancel" Property="AbortInstall" Value="1">1</Publish>

<!--Launch Programme If Checkbos is clicked-->
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>

<InstallUISequence>
<Show Dialog="UserExit" OnExit="cancel">NOT AbortInstall = 1</Show>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallUISequence>
</UI>
<InstallExecuteSequence>
<Custom Action="LaunchApplication_nonUI" After="InstallFinalize"> WIXNONUILAUNCH </Custom>
<Custom Action="Overwrite_WixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />
</InstallExecuteSequence>

<!--Lisence check box text, Lanch check box text (auto check)-->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Launch $(var.Name)" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.Name)" />
<!--CheckBox Default Set to One-->
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="LicenseAccepted" Value="1"/>

<Property Id="WixShellExecTarget" Value="[#fileMain.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<CustomAction Id="LaunchApplication_nonUI" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes"/>
<CustomAction Id="Overwrite_WixSetDefaultPerMachineFolder" Property="WixPerMachineFolder" Value="[ProgramFiles64Folder][ApplicationFolderName]" Execute="immediate" />
<!--License File-->
<WixVariable Id="WixUILicenseRtf" Value="$(var.ReleaseDir)\License.rtf"/>
</Fragment>

Expand Down
Binary file added JamiInstaller/jamites.bmp
Binary file not shown.
Binary file modified JamiInstaller/main-banner.bmp
Binary file not shown.

0 comments on commit c551f1d

Please sign in to comment.