Skip to content

Commit fe1f204

Browse files
authored
Merge pull request #241 from microsoft/stuartpa/fix-msi-path-order
Fix MSI path order
2 parents bc6575f + 07b0083 commit fe1f204

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

release/windows/msi/product.wxs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<?define ProductVersion="$(env.CLI_VERSION)" ?>
55

66
<?define ProductName = "Sqlcmd Tools" ?>
7+
<?define AppName = "SqlCmd" ?>
78
<?define ProductDescription = "Command-line tools for Microsoft SQL Server." ?>
89
<?define ProductAuthor = "Microsoft Corporation" ?>
910
<?define ProductResources = ".\resources\" ?>
@@ -29,8 +30,6 @@
2930
<Property Id="ARPHELPLINK" Value="https://docs.microsoft.com/sql/tools/sqlcmd-utility" />
3031
<Property Id="ARPURLINFOABOUT" Value="https://github.com/microsoft/go-sqlcmd" />
3132
<Property Id="ARPURLUPDATEINFO" Value="https://github.com/microsoft/go-sqlcmd" />
32-
<Property Id="ApplicationFolderName" Value="SqlCmd\Tools" />
33-
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
3433

3534
<!-- User Interface -->
3635
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProductResources)CLI_LICENSE.rtf"/>
@@ -42,27 +41,31 @@
4241

4342
<Directory Id="TARGETDIR" Name="SourceDir">
4443
<Directory Id="ProgramFiles64Folder">
45-
<Directory Id="SQLCMDFOLDER" Name="SqlCmd">
46-
<Directory Id="SQLCMDTOOLSFOLDER" Name="Tools">
47-
</Directory>
44+
<Directory Id="SqlcmdDirectory" Name="$(var.AppName)">
45+
<Component Id="sqlcmd.exe" Guid="2988854C-D02C-4D48-866C-8EAEBA6BC54B">
46+
<CreateFolder />
47+
<RemoveFolder Id="RemoveSqlCmdDirectory" On="uninstall" />
48+
<RegistryKey Root="HKCU" Key="Software\Microsoft\SqlCmd">
49+
<RegistryValue Name="MainExe" Value="1" KeyPath="yes" Type="integer" />
50+
</RegistryKey>
51+
<File
52+
Id="sqlcmd.exe"
53+
Name="sqlcmd.exe"
54+
Source="$(env.PIPELINE_WORKSPACE)\SqlcmdWindowsAmd64\sqlcmd.exe"
55+
DiskId="1"
56+
Checksum="yes"/>
57+
<Environment
58+
Id="PATH"
59+
Name="PATH"
60+
Value="[SqlcmdDirectory]"
61+
Permanent="yes"
62+
Part="first"
63+
Action="set"
64+
System="yes" />
65+
</Component>
4866
</Directory>
4967
</Directory>
5068
</Directory>
51-
52-
<DirectoryRef Id="SQLCMDTOOLSFOLDER">
53-
<Component Id="sqlcmd.exe" Guid="2988854C-D02C-4D48-866C-8EAEBA6BC54B">
54-
<File Id="sqlcmd.exe" Source="$(env.PIPELINE_WORKSPACE)\SqlcmdWindowsAmd64\sqlcmd.exe" KeyPath="yes" Checksum="yes"/>
55-
<Environment
56-
Id="PATH"
57-
Name="PATH"
58-
Value="[SQLCMDTOOLSFOLDER]"
59-
Permanent="yes"
60-
Part="last"
61-
Action="set"
62-
System="yes" />
63-
</Component>
64-
</DirectoryRef>
65-
6669
<Feature Id="ProductFeature"
6770
Title="SqlCmd Tools"
6871
Level="1"

release/windows/msi/scripts/pipeline-test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ Write-Output "$env:path"
4141
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
4242
Write-Output "$env:path"
4343

44-
$sqlcmd = $env:ProgramFiles + "\SqlCmd\Tools\sqlcmd"
44+
$sqlcmd = $env:ProgramFiles + "\SqlCmd\sqlcmd"
4545
& $sqlcmd --help

0 commit comments

Comments
 (0)