|
2 | 2 | <?include "Include.wxi"?> |
3 | 3 | <Package Name="$(ProductName)" Language="1033" Version="$(ProductVersion)" Manufacturer="$(Manufacturer)" UpgradeCode="{7A4A42D9-448F-48D2-8C42-22C82830705F}" Scope="perMachine"> |
4 | 4 | <SummaryInformation Description="Oracle SQLcl $(ProductVersion)" /> |
5 | | - <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no" /> |
| 5 | + <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no" Schedule="afterInstallFinalize" /> |
6 | 6 | <Upgrade Id="{7A4A42D9-448F-48D2-8C42-22C82830705F}"> |
7 | 7 | <!-- This ensures upgrades select/deselect JRE install depending on existing install --> |
8 | 8 | <UpgradeVersion Maximum="$(ProductVersion)" MigrateFeatures="yes" Property="PRODUPGRADE" /> |
|
23 | 23 | <util:BroadcastEnvironmentChange /> |
24 | 24 | <util:BroadcastSettingChange /> |
25 | 25 |
|
| 26 | + <!-- |
| 27 | + Custom Actions to create/remove symlink to the install folder in the ProgramData folder. |
| 28 | + This is necessary because sql.exe can't handle spaces in the path to its classes, so we add the symlink folder to the system path instead. |
| 29 | + --> |
| 30 | + <SetProperty Id="CreateProgramDataSymlink" Value=""[%ComSpec]" /c IF NOT EXIST "[SQLCLPATHFOLDER]" mklink /D "[SQLCLPATHFOLDER]" "[INSTALLFOLDER]"" Before="CreateProgramDataSymlink" Sequence="execute" /> |
| 31 | + <CustomAction Id="CreateProgramDataSymlink" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no" Return="check" /> |
| 32 | + <SetProperty Id="DeleteProgramDataSymlink" Value=""[%ComSpec]" /c rd "[SQLCLPATHFOLDER]"" Before="DeleteProgramDataSymlink" Sequence="execute" /> |
| 33 | + <CustomAction Id="DeleteProgramDataSymlink" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no" Return="ignore" /> |
| 34 | + |
| 35 | + <InstallExecuteSequence> |
| 36 | + <!-- Only create symlink on INSTALL or UPGRADE --> |
| 37 | + <Custom Action="CreateProgramDataSymlink" Before="InstallFinalize" Condition="(NOT Installed) OR (REINSTALL) OR (UPGRADINGPRODUCTCODE)" /> |
| 38 | + <Custom Action="DeleteProgramDataSymlink" Before="CreateProgramDataSymlink" /> |
| 39 | + </InstallExecuteSequence> |
| 40 | + |
26 | 41 | <Feature Id="Main" Title="SQLcl $(ProductVersion)" Level="1" AllowAdvertise="no" InstallDefault="local" TypicalDefault="install" AllowAbsent="no" Description="SQLcl application." Display="expand" ConfigurableDirectory="INSTALLFOLDER" > |
27 | 42 | <Feature Id="SQLcl" Title="SQLcl required components" Level="1" InstallDefault="followParent" AllowAdvertise="no" TypicalDefault="install" AllowAbsent="no"> |
28 | 43 | <ComponentGroupRef Id="SQLclComponents" /> |
|
0 commit comments