commit 034c165d426b26056ca5890540c677110e84e9c3
parent 7648eea61a61552432bdd0caf2cb702641e3fe8e
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Thu, 6 Sep 2012 22:29:11 -0700
win: Installer options for app shortcuts, fixes #1
Diffstat:
5 files changed, 145 insertions(+), 5 deletions(-)
diff --git a/Makefile.am b/Makefile.am
@@ -14,13 +14,23 @@ EXTRA_DIST = \
dist/osx/Info.plist \
dist/osx/README.md \
dist/osx/Spek.icns \
+ dist/osx/about.png \
dist/osx/bundle.sh \
+ dist/osx/close.png \
+ dist/osx/open.png \
+ dist/osx/save.png \
dist/win/README.md \
+ dist/win/SpekInstallDir.wxs \
+ dist/win/SpekInstallDirDlg.wxs
+ dist/win/about.ico \
dist/win/banner.bmp \
dist/win/bundle.bat \
dist/win/bundle.sh \
+ dist/win/close.ico \
dist/win/dialog.bmp \
dist/win/fix-msi.js \
+ dist/win/open.ico \
+ dist/win/save.ico \
dist/win/spek.ico \
dist/win/spek.rc \
dist/win/spek.wxs \
diff --git a/dist/win/SpekInstallDir.wxs b/dist/win/SpekInstallDir.wxs
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ The use and distribution terms for this software are covered by the
+ Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
+ which can be found in the file CPL.TXT at the root of this distribution.
+ By using this software in any fashion, you are agreeing to be bound by
+ the terms of this license.
+
+ You must not remove this notice, or any other, from this software.
+-->
+<!--
+First-time install dialog sequence:
+ - WixUI_WelcomeDlg
+ - WixUI_LicenseAgreementDlg
+ - WixUI_InstallDirDlg
+ - WixUI_VerifyReadyDlg
+ - WixUI_DiskCostDlg
+
+Maintenance dialog sequence:
+ - WixUI_MaintenanceWelcomeDlg
+ - WixUI_MaintenanceTypeDlg
+ - WixUI_InstallDirDlg
+ - WixUI_VerifyReadyDlg
+
+Patch dialog sequence:
+ - WixUI_WelcomeDlg
+ - WixUI_VerifyReadyDlg
+
+-->
+
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <UI Id="SpekInstallDir">
+ <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" />
+ <Property Id="WixUI_Mode" Value="InstallDir" />
+
+ <DialogRef Id="BrowseDlg" />
+ <DialogRef Id="DiskCostDlg" />
+ <DialogRef Id="ErrorDlg" />
+ <DialogRef Id="FatalError" />
+ <DialogRef Id="FilesInUse" />
+ <DialogRef Id="MsiRMFilesInUse" />
+ <DialogRef Id="PrepareDlg" />
+ <DialogRef Id="ProgressDlg" />
+ <DialogRef Id="ResumeDlg" />
+ <DialogRef Id="UserExit" />
+
+ <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
+ <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
+
+ <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
+
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
+
+ <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
+ <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SpekInstallDirDlg">LicenseAccepted = "1"</Publish>
+
+ <Publish Dialog="SpekInstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
+
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SpekInstallDirDlg" Order="1">NOT Installed</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</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>
+
+ <Property Id="ARPNOMODIFY" Value="1" />
+ </UI>
+
+ <UIRef Id="WixUI_Common" />
+ </Fragment>
+</Wix>
diff --git a/dist/win/SpekInstallDirDlg.wxs b/dist/win/SpekInstallDirDlg.wxs
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ The use and distribution terms for this software are covered by the
+ Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
+ which can be found in the file CPL.TXT at the root of this distribution.
+ By using this software in any fashion, you are agreeing to be bound by
+ the terms of this license.
+
+ You must not remove this notice, or any other, from this software.
+-->
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <UI>
+ <Dialog Id="SpekInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
+ <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
+ <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
+ <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
+ <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
+ </Control>
+
+ <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
+ <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
+ <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
+ <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
+
+ <Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="!(loc.InstallDirDlgFolderLabel)" />
+ <Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
+ <Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
+ <Control Id="StartMenuShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="INSTALLSTARTMENUSHORTCUT" CheckBoxValue="1" Text="Start menu shortcut" />
+ <Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="180" Width="290" Height="17" Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1" Text="Desktop shortcut" />
+ </Dialog>
+ </UI>
+ </Fragment>
+</Wix>
diff --git a/dist/win/bundle.bat b/dist/win/bundle.bat
@@ -11,8 +11,8 @@ move Spek\spek.exe .\
move spek.exe Spek\
rem Make the MSI package
-"%WIX_PATH%"\candle spek.wxs files.wxs
-"%WIX_PATH%"\light -ext WixUIExtension.dll -b Spek spek.wixobj files.wixobj -o spek.msi
+"%WIX_PATH%"\candle SpekInstallDirDlg.wxs SpekInstallDir.wxs spek.wxs files.wxs
+"%WIX_PATH%"\light -b Spek SpekInstallDirDlg.wixobj SpekInstallDir.wixobj spek.wixobj files.wixobj -ext WixUIExtension.dll -o spek.msi
start /wait fix-msi.js spek.msi
rem Clean up
diff --git a/dist/win/spek.wxs.in b/dist/win/spek.wxs.in
@@ -11,8 +11,10 @@
<Property Id="ARPPRODUCTICON" Value="ProgramIcon" />
<Property Id="ARPHELPLINK" Value="http://spek-project.org/" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />
- <UIRef Id="WixUI_InstallDir" />
+ <UIRef Id="SpekInstallDir" />
<UIRef Id="WixUI_ErrorProgressText" />
+ <Property Id="INSTALLSTARTMENUSHORTCUT" Value="1" />
+ <Property Id="INSTALLDESKTOPSHORTCUT" Value="1" />
<WixVariable Id="WixUIBannerBmp" Value="banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="dialog.bmp" />
<Upgrade Id="$(var.UpgradeCode)">
@@ -25,13 +27,14 @@
<CustomAction Id="StartAppOnExit" FileKey="spek.exe" ExeCommand="" Execute="immediate" Impersonate ="yes" Return="asyncNoWait" />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch Spek when setup exits" />
<UI>
- <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
- <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
+ <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="SpekInstallDirDlg" Order="2">1</Publish>
+ <Publish Dialog="SpekInstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
<Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<Icon Id="ProgramIcon" SourceFile="spek.ico"/>
<DirectoryRef Id="ProgramMenuSubfolder">
<Component Id="StartMenuShortcut" Guid="165DF12B-D970-49BC-B07B-880B62ABC308">
+ <Condition>INSTALLSTARTMENUSHORTCUT</Condition>
<Shortcut Id="StartMenuShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]spek.exe" WorkingDirectory="INSTALLLOCATION"/>
<Shortcut Id="UninstallProduct" Name="Uninstall $(var.ProductName)" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]"/>
<RemoveFolder Id="ProgramMenuSubfolder" On="uninstall"/>
@@ -40,6 +43,7 @@
</DirectoryRef>
<DirectoryRef Id="DesktopFolder">
<Component Id="DesktopShortcut" Guid="ACCE1EDB-87E3-4FE5-B2BF-93113E767381">
+ <Condition>INSTALLDESKTOPSHORTCUT</Condition>
<Shortcut Id="DesktopShortcut" Name="$(var.ProductName)" Icon="ProgramIcon" Target="[INSTALLLOCATION]spek.exe" WorkingDirectory="INSTALLLOCATION"/>
<RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\$(var.ProductName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>