Skip to content

Commit b9b48bd

Browse files
committed
symlink to install folder
1 parent 6642951 commit b9b48bd

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

directory.build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<AssemblyTrademark></AssemblyTrademark>
66
<AssemblyCulture></AssemblyCulture>
77
<ProductName>SQLcl</ProductName>
8-
<ProductVersion>25.2.2.199</ProductVersion>
8+
<ProductVersion>25.3.2.317</ProductVersion>
99
</PropertyGroup>
1010
</Project>

sqlclinstaller/ComponentGroups.wxs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
<ComponentGroup Id="EnvironmentChanges" Directory="INSTALLFOLDER">
2323
<Component Id="SystemPathUpdate" Guid="{84B1CE94-CF19-4EED-964F-09477D7D8C4F}">
2424
<!-- add sqlcl to the system path -->
25-
<Environment Id="SQLCLPATH" Name="PATH" Value="[SQLCLFOLDER]bin" Permanent="no" Part="first" Action="set" System="yes" />
25+
<Environment Id="SQLCLPATH" Name="PATH" Value="[SQLCLPATHFOLDER]$(ProductName)\bin" Permanent="no" Part="first" Action="set" System="yes" />
2626
</Component>
2727
</ComponentGroup>
2828
<ComponentGroup Id="MainRegistryChanges" Directory="INSTALLFOLDER">
2929
<Component Id="MainProductRegistryKey" Guid="{15D465E0-6D7C-4BE1-931B-0ADC650610FB}">
3030
<RegistryKey Root="HKMU" Key="Software\[Manufacturer]\[ProductName]" ForceDeleteOnUninstall="yes">
3131
<RegistryValue Name="InstallDir" Type="string" Value="[INSTALLFOLDER]" KeyPath="yes" />
32+
<RegistryValue Name="EnvPathDir" Type="string" Value="[SQLCLPATHFOLDER]$(ProductName)\bin" />
3233
<RegistryValue Name="Version" Type="string" Value="$(ProductVersion)" />
3334
<!-- Version of sql.exe - may not match ${ProductVersion) because the product version may have been increased to indicate a new bundled JRE is included -->
3435
<RegistryValue Name="OracleVersion" Type="string" Value="$(OracleVersion)" />

sqlclinstaller/Folders.wxs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
</Directory>
99
</Directory>
1010
</StandardDirectory>
11+
<StandardDirectory Id="CommonAppDataFolder">
12+
<Directory Id="SQLCLPATHFOLDER" Name="$(ProductName)" />
13+
</StandardDirectory>
1114
</Fragment>
1215
</Wix>

sqlclinstaller/Package.wxs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?include "Include.wxi"?>
33
<Package Name="$(ProductName)" Language="1033" Version="$(ProductVersion)" Manufacturer="$(Manufacturer)" UpgradeCode="{7A4A42D9-448F-48D2-8C42-22C82830705F}" Scope="perMachine">
44
<SummaryInformation Description="Oracle SQLcl $(ProductVersion)" />
5-
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no" />
5+
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" AllowSameVersionUpgrades="no" Schedule="afterInstallFinalize" />
66
<Upgrade Id="{7A4A42D9-448F-48D2-8C42-22C82830705F}">
77
<!-- This ensures upgrades select/deselect JRE install depending on existing install -->
88
<UpgradeVersion Maximum="$(ProductVersion)" MigrateFeatures="yes" Property="PRODUPGRADE" />
@@ -23,6 +23,21 @@
2323
<util:BroadcastEnvironmentChange />
2424
<util:BroadcastSettingChange />
2525

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="&quot;[%ComSpec]&quot; /c IF NOT EXIST &quot;[SQLCLPATHFOLDER]&quot; mklink /D &quot;[SQLCLPATHFOLDER]&quot; &quot;[INSTALLFOLDER]&quot;" 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="&quot;[%ComSpec]&quot; /c rd &quot;[SQLCLPATHFOLDER]&quot;" 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+
2641
<Feature Id="Main" Title="SQLcl $(ProductVersion)" Level="1" AllowAdvertise="no" InstallDefault="local" TypicalDefault="install" AllowAbsent="no" Description="SQLcl application." Display="expand" ConfigurableDirectory="INSTALLFOLDER" >
2742
<Feature Id="SQLcl" Title="SQLcl required components" Level="1" InstallDefault="followParent" AllowAdvertise="no" TypicalDefault="install" AllowAbsent="no">
2843
<ComponentGroupRef Id="SQLclComponents" />

0 commit comments

Comments
 (0)