seafile/msi/seafile.wxs

209 lines
9.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include Includes.wxi?>
<?include ext.wxi?>
<Product Id="$(var.ProductGuid)"
Name='!(loc.AppName) $(var.CurrentSeafileVersion)'
Language='1033'
Version='$(var.CurrentSeafileVersion)'
Manufacturer='!(loc.Manufacturer)'
UpgradeCode="$(var.CurrentUpdateGuid)" >
<!-- We set InstallScope to perMachine to install for all users -->
<Package Description='!(loc.PackageDescription)' Comments='!(loc.PackageComments)'
Manufacturer='!(loc.Manufacturer)'
InstallerVersion='200'
InstallPrivileges='elevated' InstallScope='perMachine'
Compressed='yes' />
<!-- http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/configure_arp_appearance.html -->
<Icon Id="icon.ico" SourceFile="seafile.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<!-- Don't allow downgrade. -->
<MajorUpgrade DowngradeErrorMessage='!(loc.DowngradeErrorMessage)' />
<Property Id="SUPPRESS_LAUNCH_SEAFILE_AFTER_INSTALL_FINISH">
<RegistrySearch Id="SuppressLaunchSeafileHKCU"
Root="HKCU"
Key="SOFTWARE\!(loc.AppName)"
Name="PreconfigureSuppressLaunchAfterInstall"
Type="raw"
/>
<RegistrySearch Id="SuppressLaunchSeafileHKCU64"
Root="HKCU"
Key="SOFTWARE\!(loc.AppName)"
Name="PreconfigureSuppressLaunchAfterInstall"
Type="raw"
Win64="yes"
/>
<RegistrySearch Id="SuppressLaunchSeafileHKLM"
Root="HKLM"
Key="SOFTWARE\!(loc.AppName)"
Name="PreconfigureSuppressLaunchAfterInstall"
Type="raw"
/>
<RegistrySearch Id="SuppressLaunchSeafileHKLM64"
Root="HKLM"
Key="SOFTWARE\!(loc.AppName)"
Name="PreconfigureSuppressLaunchAfterInstall"
Type="raw"
Win64="yes"
/>
</Property>
<Media Id='1' Cabinet='seafile.cab' EmbedCab='yes' />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="DesktopFolder" Name="DesktopFolder" />
<Directory Id="ProgramMenuFolder">
<Directory Id="SeafileStartMenuFolder" Name='!(loc.AppName)' />
</Directory>
<Directory Id='CommonAppDataFolder' Name='AllUsersHome'>
<Directory Id='SeafileExtDir' Name='$(var.ExtName)'>
<Component Id="seafile_ext" Guid="$(var.GuidOfShellExtComponent)">
<CreateFolder>
<!-- Set the permission of the SeafileExt folder. So,
together with the MoveExtDll/MoveExtDll64 custom
action, we can rename seafile shell ext dll to
avoid "file in use" dialog. -->
<util:PermissionEx User="Users" GenericAll="yes" />
</CreateFolder>
<RemoveFolder Id="SeafileExtDir" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"
Name="shellext" Type="integer" Value="1" KeyPath='yes' />
<!--<File Id="seafile_ext.dll" Name="seafile_ext.dll" Source="custom\seafile_ext.dll" />-->
<File Id="seafile_ext64.dll" Name="seafile_ext64.dll" Source="custom\seafile_ext64.dll" />
</Component>
</Directory>
</Directory>
<Directory Id='ProgramFiles64Folder' Name='PFiles'>
<Directory Id='INSTALLDIR' Name='!(loc.AppName)'>
<Directory Id='bin_Dir' Name='bin'>
<Component Id='comp_custom' Guid="$(var.GuidOfCustomComponent)">
<RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Action="createAndRemoveOnUninstall">
<RegistryValue Name="CustomComponent" Value="1" Type="integer" KeyPath='yes' />
</RegistryKey>
<File Id="seafdir.ico" Name="seafdir.ico" Source="seafdir.ico" />
<!-- seafile shortcut on desktop -->
<Shortcut Id="ApplicationDesktopShortCut" Directory="DesktopFolder"
Name='!(loc.AppName)' Target="[#seafileapplet.exe]"
Hotkey="0" IconIndex="0" Show="normal"
WorkingDirectory="bin_Dir" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
<Property Id="SEAFILE_AUTO_START">1</Property>
<!-- Auto-start via Registry -->
<DirectoryRef Id="INSTALLDIR">
<Component Id="SeafileAutoStart" Guid="$(var.GuidOfAutoStartComponent)">
<RegistryKey Root="HKCU"
Key="Software\Microsoft\Windows\CurrentVersion\Run"
Action="create">
<RegistryValue Name='!(loc.AppName)' Value="[#seafileapplet.exe]" Type="string" KeyPath="yes" />
</RegistryKey>
<Condition>SEAFILE_AUTO_START</Condition>
</Component>
</DirectoryRef>
<DirectoryRef Id="SeafileStartMenuFolder" >
<Component Id="Seafile_StartMenuShortCut" Guid="$(var.GuidOfStartMenuShortCutComponent)" >
<RemoveFolder Id="SeafileStartMenuFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]"
Name="installed" Type="integer" Value="1" KeyPath='yes' />
<!-- shortcut to 'start seafile' -->
<Shortcut Id="ApplicationStartMenuShortCut" Directory="SeafileStartMenuFolder"
Name="!(loc.StartSeafile)" Target="[#seafileapplet.exe]"
Hotkey="0" IconIndex="0" Show="normal"
WorkingDirectory="bin_Dir" />
<!-- shortcut to 'Uninstall' -->
<Shortcut Id="UninstallProduct" Name="!(loc.UninstallSeafile)"
Target="[SystemFolder]msiexec.exe" IconIndex="0"
Arguments="/x [ProductCode]" Description="!(loc.UninstallSeafile)" />
</Component>
</DirectoryRef>
<!-- <Binary Id='seafile_custom_dll32' SourceFile='custom\seafile_custom32.dll' /> -->
<Binary Id='seafile_custom_dll64' SourceFile='custom\seafile_custom64.dll' />
<!-- <CustomAction Id="MoveExtDll" BinaryKey="seafile_custom_dll32" DllEntry="RemoveExtDll" Execute="immediate" /> -->
<CustomAction Id="MoveExtDll64" BinaryKey="seafile_custom_dll64" DllEntry="RemoveExtDll" Execute="immediate" />
<CustomAction Id="RemoveSeafileUserData" FileKey="seafileapplet.exe" ExeCommand="--remove-user-data"
Execute="immediate" Impersonate="yes" Return="ignore" />
<CustomAction Id="StopSeafile" FileKey="seafileapplet.exe" ExeCommand="--stop"
Execute="immediate" Impersonate="yes" Return="ignore" />
<InstallExecuteSequence>
<!-- Move away seafile shell extension so we don't need to kill explorer during upgrade or uninstall. -->
<!--
<Custom Action="MoveExtDll" Before="InstallValidate">
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND (NOT VersionNT64)
</Custom>
-->
<Custom Action="MoveExtDll64" Before="InstallValidate">
((REMOVE="ALL") OR UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED) AND VersionNT64
</Custom>
<Custom Action="StopSeafile" Before="InstallValidate">
UPGRADINGPRODUCTCODE OR WIX_UPGRADE_DETECTED
</Custom>
<!-- Remove User data, as well as seafile QSettings in registry -->
<Custom Action="RemoveSeafileUserData" Before="InstallValidate">
(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")
</Custom>
</InstallExecuteSequence>
<!-- UI related -->
<Property Id='WIXUI_INSTALLDIR' Value="INSTALLDIR" />
<UI>
<UIRef Id='WixUI_InstallDir_NoLicense' />
<UIRef Id='WixUI_ErrorProgressText' />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication">
<!-- Launch Seafile after setup. -->
(NOT Installed) AND (NOT SUPPRESS_LAUNCH_SEAFILE_AFTER_INSTALL_FINISH)
</Publish>
</UI>
<Property Id="WixShellExecTarget" Value="[#seafileapplet.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<Feature Id='Main' Level='1'>
<ComponentRef Id='Seafile_StartMenuShortCut' />
<ComponentRef Id="SeafileAutoStart" />
<ComponentRef Id='comp_custom' />
<!-- defined in fragment.wxs -->
<ComponentGroupRef Id='group_bin' />
<!-- defined in shell.wxs -->
<ComponentRef Id='comp_shell' />
<ComponentRef Id='comp_shell64' />
<ComponentRef Id='seafile_ext' />
</Feature>
<Property Id="CHECKBOX_DEL_SEAFILE_DATA" Secure="yes" />
<WixVariable Id="WixUIBannerBmp" Value="seafile-top-banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="seafile-background.bmp" />
</Product>
</Wix>