aboutsummaryrefslogtreecommitdiff
path: root/contrib/polipo.wxs
blob: c23b9e5309bfa137ed3df0f1df18235d23eea2d5 (plain)
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0" encoding="Windows-1252" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define ThisProductVersion="1.0.4" ?>
  <?define ThisProductVersionDisp="1.0.4.1" ?>
  <?define UpgradeCode="b45b9db8-8670-4546-8dd4-e9284ca81616" ?>
  
  <?define CurrProductGUID="22c59fc2-8c94-4151-ad82-2c90bfa7ff99" ?>
  <?define CurrExecutableGUID="cef195c5-817c-4963-a1f7-03e88c79985b" ?>
  <?define CurrRegExLibsGUID="04b3e6f5-a4f3-4cc0-adb1-765c39050865" ?>
  <?define CurrMingwLibsGUID="bd31ec38-27a3-415e-b19f-ccd61bc41d9a" ?>
  <?define CurrDocumentsGUID="ff70f640-1a87-4eed-9897-277059e55c4f" ?>
  <?define CurrConfigFileGUID="fbe1473f-de4d-4ca2-a8a4-66f3f92fff7d" ?>
  <?define CurrStartMenuGUID="0b577f55-1ca5-43b8-9df2-3834843fc80b" ?>
  <?define CurrDesktopGUID="0e7e07f2-b21b-49ea-a25e-569eae46e0ce" ?>
  <?define CurrDocsOnDesktopGUID="783fb5f6-835d-4a81-988b-d46c683ac0e2" ?>
  <?define CurrStartupGUID="60bc5fc3-74d2-4d7b-a659-8acebea93aa4" ?>
  <?define CurrLocalProgramsGUID="e0c517aa-5eb7-4909-a23f-7fccd7fddeef" ?>

  <Product Name="Polipo $(var.ThisProductVersionDisp)" Id="$(var.CurrProductGUID)"
           Language="1033" Codepage="1252"
           Version="$(var.ThisProductVersion)"
           Manufacturer="mailto: coderman at gmail.com - test package for The Tor Project, Inc."
           UpgradeCode="$(var.UpgradeCode)">
    
    <Package Id="*" Keywords="Installer"
             Description="Polipo $(var.ThisProductVersionDisp) Installer"
             Manufacturer="mailto: coderman at gmail.com - test package for The Tor Project, Inc."
             InstallerVersion="100" Compressed="yes"
             Languages="1033"  SummaryCodepage="1252"
             InstallPrivileges="limited" />

    <Media Id="1" Cabinet="Polipo.cab" CompressionLevel="high"
           EmbedCab="yes" DiskPrompt="CD-ROM #1" />
    <Property Id="DiskPrompt" Value="Polipo $(var.ThisProductVersionDisp) Installation Volume [1]" />
    <Property Id="ALLUSERS" Secure="yes"/>
    <Property Id="ReinstallModeText">omus</Property>

    <!-- To avoid placing shortcuts all over the desktop / start menu during a
    silent installation the NOSC=1 option can be passed to omit shortcuts.
    This is useful if bundled with other applications like Vidalia that manage
    configuration and Tor related processes themselves.
      -->
    <Property Id="NOSC" Secure="yes"/>

    <!-- Associate this package with the upgrade code for this series
    to ensure that upgrade installations by Thandy or other means work
    as expected.
    The OnlyDetect option must be false to ensure that existing files
    from an older version are removed and replaced with current files.
      -->
    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion
        Property="UPGRADEFOUND"
        OnlyDetect="no"
        Minimum="0.0.0"
        IncludeMinimum="yes"
        Maximum="$(var.ThisProductVersion)"
        IncludeMaximum="no"
      />
    </Upgrade>


    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="LocalAppDataFolder" Name="LocalAppData">
       <Directory Id="LocalProgramsFolder" Name="Programs">

         <!-- Until proper support for per-user installs is available we manage Programs folder.
         Note that this directory will be left in place if it is in use by any other app.
           -->
         <Component Id="LocalProgramsFolderRef" Guid="$(var.CurrLocalProgramsGUID)">
           <CreateFolder/>
           <RemoveFolder Id="RemoveLocalProgramsFolder" On="uninstall" />
           <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
             <RegistryValue Name="LocalProgramsFolderRef" Value="1" Type="integer" KeyPath="yes" />
           </RegistryKey>
         </Component>

         <Directory Id="LocalProgramsInstDir" Name="Polipo">

          <!-- Main Polipo application files -->
          <Component Id="PolipoExecutable" Guid="$(var.CurrExecutableGUID)">
            <CreateFolder/>
            <RemoveFolder Id="RemoveLocalProgramsInstDir" On="uninstall" />
            <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
              <RegistryValue Name="Version" Value="$(var.ThisProductVersionDisp)" Type="string" KeyPath="yes" />
            </RegistryKey>
            <File Id="PolipoExe" DiskId="1"
                  Name="polipo.exe" Source="bin\polipo.exe" />
          </Component>

          <!-- MinGW-related library files -->
          <Component Id="MinGWLibrary" Guid="$(var.CurrMingwLibsGUID)">
            <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
              <RegistryValue Name="MinGWLibrary" Value="1" Type="integer" KeyPath="yes" />
            </RegistryKey>
            <File Id="MinGWDll" DiskId="1"
                  Name="mingwm10.dll" Source="bin\mingwm10.dll" />
          </Component>

          <!-- GNU RegEx library files -->
          <Component Id="GnuRegExLibrary" Guid="$(var.CurrRegExLibsGUID)">
            <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
              <RegistryValue Name="RegExLibrary" Value="1" Type="integer" KeyPath="yes" />
            </RegistryKey>
            <File Id="gnurxdll" DiskId="1"
                  Name="libgnurx-0.dll" Source="bin\libgnurx-0.dll" />
          </Component>

         </Directory>
        </Directory>

        <Directory Id="INSTALLDIR" Name="Polipo">
          <Component Id="PolipoConfig" Guid="$(var.CurrConfigFileGUID)">
            <CreateFolder/>
            <RemoveFolder Id="RemoveINSTALLDIR" On="uninstall" />
            <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
              <RegistryValue Name="ConfigFile" Value="1" Type="integer" KeyPath="yes" />
            </RegistryKey>
            <File
              Id="PolipoConfigFile"
              Name="config.txt"
              Source="bin\polipo.conf"
              Vital="yes"
              ReadOnly="no"
              DiskId="1"> 
              <CopyFile
                Id="PolipoSavedConfig"
                DestinationName="save-cfg.txt"
              />
            </File>
          </Component>

        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ShortcutFolder" Name="Polipo">
          <Component Id="AddPolipoToStartMenu" Guid="$(var.CurrStartMenuGUID)">
            <Condition><![CDATA[NOSC <> 1]]> </Condition>
            <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
              <RegistryValue Name="StartMenuShortcut" Value="1" Type="integer" KeyPath="yes" />
            </RegistryKey>
            <Shortcut Id="PolipoStartMenuShortcut"
                      Name="Polipo" Target="[LocalProgramsInstDir]polipo.exe"
                      Directory="ShortcutFolder" WorkingDirectory="LocalProgramsInstDir" />
            <RemoveFolder Id="RemoveShortcutFolder" On="uninstall" />
          </Component>
        </Directory>
      </Directory>

      <Directory Id="DesktopFolder" Name="Desktop">
        <Component Id="AddPolipoToDesktop" Guid="$(var.CurrDesktopGUID)">
          <Condition><![CDATA[NOSC <> 1]]> </Condition>
          <RegistryKey Root="HKCU" Key="Software\Polipo" Action="createAndRemoveOnUninstall">
            <RegistryValue Name="DesktopShortcut" Value="1" Type="integer" KeyPath="yes" />
          </RegistryKey>
          <Shortcut Id="PolipoDesktopShortcut"
                    Name="Polipo" Target="[LocalProgramsInstDir]polipo.exe"
                    Directory="DesktopFolder" WorkingDirectory="LocalProgramsInstDir" />
        </Component>
      </Directory>

      <Component Id="AddToStartupItems" Guid="$(var.CurrStartupGUID)">
        <Condition><![CDATA[NOSC <> 1]]> </Condition>
        <RegistryKey Root="HKCU"
                     Key="Software\Microsoft\Windows\CurrentVersion\Run"
                     Action="createAndRemoveOnUninstall">
          <RegistryValue Name="Polipo" Value='"[LocalProgramsInstDir]polipo.exe"' Type="string" />
        </RegistryKey>
      </Component>
    </Directory>

    <!-- Build up the feature hierarchy -->
    <Feature Id="Complete" Title="Polipo"
             Level="1" Display="expand" ConfigurableDirectory="INSTALLDIR"
             Description="Polipo is application that helps you control, monitor, and configure the Tor software.">
      <Feature Id="MainApplication" Title="Polipo $(var.ThisProductVersionDisp)"
               AllowAdvertise="no" Absent="disallow" Level="1"
               Description="Main application">
        <ComponentRef Id="LocalProgramsFolderRef" />
        <ComponentRef Id="PolipoExecutable" />
        <ComponentRef Id="MinGWLibrary" />
        <ComponentRef Id="GnuRegExLibrary" />
        <ComponentRef Id="PolipoConfig" />
      </Feature>
      <Feature Id="Shortcuts" Title="Shortcuts"
               AllowAdvertise="no" Absent="allow" Level="1"
               Description="Add a shortcut to Polipo to your Start menu or Desktop.">
        <Feature Id="StartMenuShortcuts" Title="Add to Start menu"
                 AllowAdvertise="no" Absent="allow" Level="1"
                 Description="Add Polipo to your Start menu">
          <ComponentRef Id="AddPolipoToStartMenu" />
        </Feature>
        <Feature Id="DesktopShortcuts" Title="Add to Desktop"
                 AllowAdvertise="no" Absent="allow" Level="1"
                 Description="Add Polipo to your Desktop">
          <ComponentRef Id="AddPolipoToDesktop" />
        </Feature>
        <Feature Id="RunAtStartup" Title="Run at Startup"
                 AllowAdvertise="no" Absent="allow" Level="1"
                 Description="Run Polipo automatically when your system starts">
          <ComponentRef Id="AddToStartupItems" />
        </Feature>
      </Feature>
    </Feature>

    <!-- Upgrade installation sequence. -->
    <InstallExecuteSequence>
      <RemoveExistingProducts After="InstallValidate" />
    </InstallExecuteSequence>

    <!-- Set the UI options -->
    <UIRef Id="WixUI_Tor" />
    <WixVariable Id="WixUIBannerBmp" Value="header.bmp" />
    <WixVariable Id="WixUIDialogBmp" Value="welcome.bmp" />
  </Product>
</Wix>