-
Notifications
You must be signed in to change notification settings - Fork 1
/
Syncthing.wxs.template
149 lines (135 loc) · 8.44 KB
/
Syncthing.wxs.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="utf-8"?>
<!-- When increasing ProductVersion, change the ProductCode as well -->
<?define Property_ProductVersion = "BATCH_PRODUCTVERSION" ?>
<?define Property_ProductCode = "*" ?>
<!-- Never change the UpgradeCode -->
<?define Property_UpgradeCode = "0DDAC7F1-2657-4E46-9EBB-46F41825138C" ?>
<?define Property_ProductName = "Syncthing" ?>
<?define Property_ProductComment = "Open Source Continuous File Synchronization" ?>
<?define Property_ProductManufacturer = "The Syncthing Authors" ?>
<?define Property_ServiceName = "Syncthing" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="$(var.Property_ProductCode)" Name="$(var.Property_ProductName)" Language="1033" Version="$(var.Property_ProductVersion)" Manufacturer="$(var.Property_ProductManufacturer)" UpgradeCode="$(var.Property_UpgradeCode)">
<Package Description="$(var.Property_ProductName)" Comments="$(var.Property_ProductComment)" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" />
<Upgrade Id="$(var.Property_UpgradeCode)">
<UpgradeVersion
Minimum="1.0.0" IncludeMinimum="yes"
Maximum="99.0.0" IncludeMaximum="no"
OnlyDetect="no"
Property="PREVIOUSFOUND" />
</Upgrade>
<CustomAction Id="CA_BlockOlderVersionInstall" Error="Cannot install over a more recent version" />
<CustomAction Id="CA_ErrWrongWindowsVersion" Error="This operating system is unsupported." />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="CDrive" Name="CDrive">
<Directory Id="ServerSyncthingDir" Name="Syncthing">
<!-- <Directory Id="ServerSyncthingAppdataDir" Name="appdata" /> -->
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="$(var.Property_ProductName)" />
</Directory>
</Directory>
<SetDirectory Id="CDrive" Value="C:\Server" />
<Property Id='ARPPRODUCTICON' Value='ApplicationIcon' />
<!-- SERVICE_ACCOUNT options: LOCALSERVICE, NETWORKSERVICE, SYSTEM -->
<Property Id='SERVICE_ACCOUNT' Value='LOCALSERVICE' />
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="*">
<Shortcut Directory="ApplicationProgramsFolder" Id="ApplicationWebUiShortcut" Name="$(var.Property_ProductName) Web UI" Description="$(var.Property_ProductName) Web UI" Target="[ServerSyncthingDir]syncthing_webui.cmd" Icon="ApplicationIcon" Show="minimized">
<Icon Id="ApplicationIcon" SourceFile="SourceDir\syncthing.ico" />
</Shortcut>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]">
<RegistryValue Name="WebUiShortcutInstalled" Value="[ProductVersion]" Type="string" />
</RegistryKey>
</Component>
</DirectoryRef>
<DirectoryRef Id="ServerSyncthingDir">
<Component Id="Registration.xml" Guid="33EC1435-32F7-4CB7-94DB-50E146B44D62" DiskId="1">
<CreateFolder/>
<RemoveFolder Id="RemoveAppRootDirectory" On="uninstall" />
<File Id="SYNCTHING.EXE" Name="syncthing.exe" Source="SourceDir\syncthing.exe" />
<File Id="AUTHORS.TXT" Name="AUTHORS.txt" Source="SourceDir\AUTHORS.txt" />
<File Id="LICENSE.TXT" Name="LICENSE.txt" Source="SourceDir\LICENSE.txt" />
<File Id="README.TXT" Name="README.txt" Source="SourceDir\README.txt" />
<File Id="PSREPLACE.CMD" Name="psreplace.cmd" Source="SourceDir\psreplace.cmd" />
<File Id="SYNCTHING_CLI.CMD" Name="syncthing_cli.cmd" Source="SourceDir\syncthing_cli.cmd" />
<File Id="SYNCTHING_GRANT_FOLDER_ACCESS.CMD" Name="syncthing_grant_folder_access.cmd" Source="SourceDir\syncthing_grant_folder_access.cmd" />
<File Id="SYNCTHING_REMOVE.CMD" Name="syncthing_remove.cmd" Source="SourceDir\syncthing_remove.cmd" />
<File Id="SYNCTHING_SERVICE.CMD" Name="syncthing_service.cmd" Source="SourceDir\syncthing_service.cmd" />
<File Id="SYNCTHING_STRECHECKDBEVERY_OFF.CMD" Name="syncthing_strecheckdbevery_off.cmd" Source="SourceDir\syncthing_strecheckdbevery_off.cmd" />
<File Id="SYNCTHING_STRECHECKDBEVERY_ON.CMD" Name="syncthing_strecheckdbevery_on.cmd" Source="SourceDir\syncthing_strecheckdbevery_on.cmd" />
<File Id="SYNCTHING_UPGRADE.CMD" Name="syncthing_upgrade.cmd" Source="SourceDir\syncthing_upgrade.cmd" />
<File Id="SYNCTHING_WEBUI.CMD" Name="syncthing_webui.cmd" Source="SourceDir\syncthing_webui.cmd" />
<File Id="NSSM_X86.EXE" Name="nssm_x86.exe" Source="SourceDir\nssm_x86.exe" KeyPath="yes" />
<ServiceInstall
Id="NSSM_X86.EXE"
Type="ownProcess"
Vital="yes"
Name="$(var.Property_ServiceName)"
DisplayName="$(var.Property_ServiceName)"
Description="$(var.Property_ServiceName)"
Start="auto"
Account="NT AUTHORITY\[SERVICE_ACCOUNT]"
ErrorControl="ignore"
Interactive="no" >
</ServiceInstall>
<!--<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)" Type="integer" Name="DelayedAutostart" Value="1"/>-->
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)\Parameters" Type="expandable" Name="AppDirectory" Value="[CDrive]Syncthing"/>
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)\Parameters" Type="expandable" Name="Application" Value="[CDrive]Syncthing\syncthing_service.cmd"/>
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)\Parameters" Type="expandable" Name="AppParameters" Value="-no-console -no-browser -home [CDrive]Syncthing\appdata"/>
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)\Parameters" Type="integer" Name="AppStopMethodSkip" Value="8"/>
<RegistryValue Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\$(var.Property_ServiceName)\Parameters\AppExit" Type="string" Value="Exit"/>
<ServiceConfig ServiceName="$(var.Property_ServiceName)" DelayedAutoStart="yes" OnInstall="yes" OnReinstall ="yes" />
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="$(var.Property_ServiceName)" Wait="yes" />
<RegistryKey Root="HKLM" Key="Software\[Manufacturer]\[ProductName]">
<RegistryValue Name="Version" Value="[ProductVersion]" Type="string" />
</RegistryKey>
</Component>
</DirectoryRef>
<!--
<DirectoryRef Id="ServerSyncthingAppdataDir">
<Component Id="ServerSyncthingAppdataUserAccess" Guid="41111f53-f8ee-4776-a303-6bc39c3f2133" DiskId="1">
<CreateFolder>
<util:PermissionEx User="Users" GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" ChangePermission="yes" />
</CreateFolder>
</Component>
</DirectoryRef>
-->
<Feature Id="DefaultFeature" Title="Main Feature" Level="1">
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="Registration.xml" />
<!-- <ComponentRef Id="ServerSyncthingAppdataUserAccess" /> -->
</Feature>
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
<CustomAction
Id="ExecUpgradeCmd"
Directory='ServerSyncthingDir'
Execute='deferred'
Impersonate='no'
ExeCommand='[ServerSyncthingDir]syncthing_upgrade.cmd'
Return='check'/>
<CustomAction
Id="ExecRemoveCmd"
Directory='ServerSyncthingDir'
Execute='deferred'
Impersonate='no'
ExeCommand='[ServerSyncthingDir]syncthing_remove.cmd'
Return='check'/>
<!-- The InstallExecuteSequence table describes the order that actions will be executed during -->
<!-- installation, repair and uninstall of this product. -->
<InstallExecuteSequence>
<!--
<Custom Action="CA_BlockOlderVersionInstall" After="FindRelatedProducts">
<![CDATA[NEWERVERSIONDETECTED]]>
</Custom>
-->
<RemoveExistingProducts Before="InstallInitialize" />
<Custom Action="ExecUpgradeCmd" After="WriteRegistryValues">NOT REMOVE</Custom>
<Custom Action="ExecRemoveCmd" Before="RemoveFiles">REMOVE</Custom>
<LaunchConditions After="AppSearch"/>
</InstallExecuteSequence>
<UI />
</Product>
</Wix>