-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create msi for windows #2819
Draft
dphulkar-msft
wants to merge
72
commits into
main
Choose a base branch
from
dphulkar/wingetPackage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+216
−15
Draft
Create msi for windows #2819
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
bd0722b
creating azcopy msi installer
dphulkar-msft f2651b0
Create windows msi
dphulkar-msft b5df7db
Create windows msi
dphulkar-msft 07e5f5e
Create windows msi
dphulkar-msft e84a248
Create windows msi
dphulkar-msft 9173779
Create windows msi
dphulkar-msft e134d48
Create windows msi
dphulkar-msft 0b49218
Create windows msi
dphulkar-msft 8371f1a
Create windows msi
dphulkar-msft 28ff617
Create windows msi
dphulkar-msft 24b4c27
Create windows msi
dphulkar-msft 28672eb
Create windows msi
dphulkar-msft 333d8a4
Create windows msi
dphulkar-msft f53f39a
Create windows msi
dphulkar-msft 8b8290a
Create windows msi
dphulkar-msft d17c4dc
Create windows msi
dphulkar-msft 04f31a7
Create windows msi
dphulkar-msft 78d9287
Create windows msi
dphulkar-msft 07890ab
Create windows msi
dphulkar-msft bfded4a
Create windows msi
dphulkar-msft 5da3c02
Create windows msi
dphulkar-msft f552be5
Create windows msi
dphulkar-msft 5783cc2
Create windows msi
dphulkar-msft d4d1cd4
Create windows msi
dphulkar-msft 1f4fbda
Create windows msi
dphulkar-msft 8500d18
Create windows msi
dphulkar-msft 599fe81
Create windows msi
dphulkar-msft 2b59069
Create windows msi
dphulkar-msft 560acbc
Create windows msi
dphulkar-msft fa836d6
Create windows msi
dphulkar-msft 6a63cab
Create windows msi
dphulkar-msft 56d0cdf
Create windows msi
dphulkar-msft ebf5389
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft f50f469
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 85ee524
create windows msi
dphulkar-msft 1a3104c
create windows msi
dphulkar-msft de165d7
create windows msi
dphulkar-msft 5941470
create windows msi
dphulkar-msft d57b439
create windows msi
dphulkar-msft 49ed85a
create windows msi
dphulkar-msft f04a07d
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 0de3c25
create windows msi
dphulkar-msft c9062e5
create windows msi
dphulkar-msft bb953ad
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft a1277c9
create msi
dphulkar-msft f8851ed
create msi
dphulkar-msft 802e04a
create msi
dphulkar-msft 56f968d
create msi
dphulkar-msft a18d80d
create msi
dphulkar-msft 63f694c
create msi
dphulkar-msft 2b1eb4d
create msi
dphulkar-msft 2ccdf7e
winget package
dphulkar-msft 3d49d5f
create windows msi
dphulkar-msft 1029314
create windows msi
dphulkar-msft 1ff705e
create windows msi
dphulkar-msft 883dcdf
create windows msi
dphulkar-msft 3a4e456
create windows msi
dphulkar-msft 0ba2759
create windows msi
dphulkar-msft e306726
create windows msi
dphulkar-msft dc4ec40
create windows msi
dphulkar-msft f720ad7
create windows msi
dphulkar-msft f375431
create windows msi
dphulkar-msft 37232f2
create windows msi
dphulkar-msft c1b6df2
create windows msi
dphulkar-msft 3cc6762
create windows msi
dphulkar-msft 59e6891
Merge branch 'main' of https://github.com/Azure/azure-storage-azcopy …
dphulkar-msft 05fb17c
create windows msi
dphulkar-msft adc6d36
Add msi to signing step
dphulkar-msft 42e75bc
display azcopy version after msi installation
dphulkar-msft 12812a9
Add support for windows arm64 msi
dphulkar-msft 4e77ea2
Fixed check for spelling errors failure
dphulkar-msft aafdfbb
Fixed check for spelling errors failure
dphulkar-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | ||
<Product Id="*" Name="azcopy" Language="1033" Version="10.28.0" Manufacturer="Microsoft" UpgradeCode="abeee33a-0cca-4060-89d7-0687f7374f7a"> | ||
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> | ||
|
||
<Media Id="1" Cabinet="azcopy.cab" EmbedCab="yes" /> | ||
|
||
<Directory Id="TARGETDIR" Name="SourceDir"> | ||
<Directory Id="ProgramFilesFolder"> | ||
<Directory Id="INSTALLDIR" Name="azcopy"> | ||
<Component Id="azcopy.exe" Guid="abeee33a-0cca-4060-89d7-0687f7374f7a"> | ||
<File Id="azcopy.exe" Source="azcopy_executable_path" /> | ||
</Component> | ||
</Directory> | ||
</Directory> | ||
</Directory> | ||
|
||
<Feature Id="ProductFeature" Title="AzCopy" Level="1"> | ||
<ComponentRef Id="azcopy.exe" /> | ||
</Feature> | ||
</Product> | ||
</Wix> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
parameters: | ||
working_dir: '' | ||
build_dir: '' | ||
azcopy_version: '' | ||
azcopy_msi_name: '' | ||
|
||
steps: | ||
- powershell: | | ||
# Check if Chocolatey is installed | ||
if (!(Get-Command choco.exe -ErrorAction SilentlyContinue)) { | ||
Write-Host "Chocolatey is not installed. Installing Chocolatey..." | ||
Set-ExecutionPolicy Bypass -Scope Process -Force; | ||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; | ||
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
} else { | ||
Write-Host "Chocolatey is already installed." | ||
} | ||
|
||
# Install WiX Toolset using Chocolatey | ||
Write-Host "Installing WiX Toolset via Chocolatey..." | ||
choco install wixtoolset -y | ||
Write-Host "WiX Toolset installation completed." | ||
displayName: 'Install Chocolatey and WiX Toolset' | ||
|
||
- powershell: | | ||
# Script to create MSI in an Azure Pipeline | ||
|
||
# Step 1: Set Variables | ||
$workDir = "${{ parameters.working_dir }}" | ||
$wixToolsPath = (where.exe candle.exe) -replace '\\candle.exe$', '' # Remove candle.exe from path | ||
$wxsFilePath = "$workDir\azcopy.wxs" | ||
$wixObjPath = "$workDir\azcopy.wixobj" | ||
$outputMsi = "${{ parameters.build_dir }}\${{ parameters.azcopy_msi_name }}" | ||
|
||
# Step 2: Update the fields in the .wxs file | ||
Write-Host "Updating Uuid in .wxs file..." | ||
$uuid = [guid]::NewGuid().Guid.ToString() | ||
|
||
# Load the XML file with namespace handling | ||
[xml]$wixXml = Get-Content $wxsFilePath | ||
|
||
# Define the XML namespace manager | ||
$namespaceManager = New-Object System.Xml.XmlNamespaceManager($wixXml.NameTable) | ||
$namespaceManager.AddNamespace("wix", "http://schemas.microsoft.com/wix/2006/wi") | ||
|
||
# Update fields using the namespace | ||
$productNode = $wixXml.SelectSingleNode("//wix:Product", $namespaceManager) | ||
$productNode.Name = "AzCopy v10" | ||
$productNode.Version = "${{ parameters.azcopy_version }}" | ||
$productNode.Manufacturer = "Updated Manufacturer" | ||
$productNode.UpgradeCode = $uuid | ||
|
||
# Locate the Component node using the namespace | ||
$component = $wixXml.SelectSingleNode("//wix:Directory[@Id='INSTALLDIR']/wix:Component", $namespaceManager) | ||
|
||
# Check if Component element exists | ||
if ($component) { | ||
# Check if Guid attribute exists and set it, or add it if missing | ||
if ($component.Attributes["Guid"]) { | ||
$component.Attributes["Guid"].Value = $uuid | ||
} else { | ||
$component.SetAttribute("Guid", $uuid) | ||
} | ||
Write-Host "Guid attribute updated successfully." | ||
} else { | ||
Write-Host "Component element not found in XML structure." | ||
} | ||
|
||
# Update the file source path | ||
$file = $component.SelectSingleNode("wix:File", $namespaceManager) | ||
$file.Source = "$workDir\azcopy.exe" | ||
|
||
# Save the updated XML back to the file | ||
$wixXml.Save($wxsFilePath) | ||
|
||
# Print the updated content of the .wxs file | ||
Write-Host "Updated content of the .wxs file:" | ||
Get-Content $wxsFilePath | ||
|
||
Write-Host "WiX XML file updated successfully." | ||
|
||
# Step 3: Compile the .wxs file using Candle | ||
Write-Host "Compiling .wxs file..." | ||
& "$wixToolsPath\candle.exe" -out $wixObjPath $wxsFilePath | ||
|
||
# Step 4: Link the .wixobj to create the MSI using Light | ||
Write-Host "Linking to create MSI..." | ||
& "$wixToolsPath\light.exe" -out $outputMsi $wixObjPath | ||
|
||
Write-Host "MSI creation process completed!" | ||
|
||
# Define the file path for the .wixpdb file | ||
$filePath = "$outputMsi\*.wixpdb" | ||
|
||
# Remove the azcopy.wixpdb file as it is not required. | ||
# .wixpdb file is a debugging file generated by WiX Toolset. | ||
# Check if the file exists | ||
if (Test-Path -Path $filePath) { | ||
# Remove the .wixpdb file if it exists | ||
Remove-Item -Path $filePath -Force | ||
Write-Host "The .wixpdb file has been deleted." | ||
} else { | ||
Write-Host "No .wixpdb file found to delete." | ||
} | ||
|
||
# Verify the file has been deleted | ||
if (-not (Test-Path -Path $filePath)) { | ||
Write-Host "File deletion confirmed." | ||
} else { | ||
Write-Host "File still exists." | ||
} | ||
|
||
# Step 5: Install the MSI and verify the installation | ||
Write-Host "Installing the MSI for verification ..." | ||
msiexec /i $outputMsi | ||
if ($LASTEXITCODE -eq 0) { | ||
Write-Host "Installation was successful." | ||
} else { | ||
Write-Host "Installation failed with exit code $LASTEXITCODE." | ||
} | ||
azcopy.exe --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit. Similar changes for the other params,