Skip to content

Commit

Permalink
{Packaging} MSI: Use WixBroadcastEnvironmentChange and set `WIXUI_E…
Browse files Browse the repository at this point in the history
…XITDIALOGOPTIONALTEXT` (#23749)
  • Loading branch information
heaths authored Sep 2, 2022
1 parent daa3b68 commit b1c7966
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 169 deletions.
18 changes: 7 additions & 11 deletions build_scripts/windows/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,7 @@
</Feature>

<!--Custom action to propagate path env variable change-->
<Binary Id="PropagateEnvChangeExe" SourceFile=".\propagate_env_change\propagate_env_change.exe" />
<Property Id="WixQuietExecCmdLine" Value="propagate_env_change.exe"/>
<!--Ignoring the return value if case there is app-hang we can't control -->
<CustomAction Id="PropagateEnvChange"
BinaryKey="PropagateEnvChangeExe"
ExeCommand="propagate_env_change.exe"
Execute="commit"
Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="PropagateEnvChange" Before="InstallFinalize" />
</InstallExecuteSequence>
<CustomActionRef Id="WixBroadcastEnvironmentChange" />

<!-- User Interface -->
<WixVariable Id="WixUILicenseRtf" Value="$(var.ProductResources)CLI_LICENSE.rtf"/>
Expand All @@ -61,6 +51,12 @@
<UIRef Id="WixUI_Minimal"/>
<UIRef Id="WixUI_ErrorProgressText"/>

<!-- Show message to restart any terminals only if the PATH is changed -->
<CustomAction Id="Set_WIXUI_EXITDIALOGOPTIONALTEXT" Property="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Please close and reopen any active terminal window to use Azure CLI." />
<InstallUISequence>
<Custom Action="Set_WIXUI_EXITDIALOGOPTIONALTEXT" After="CostFinalize">NOT Installed AND NOT WIX_UPGRADE_DETECTED</Custom>
</InstallUISequence>

</Product>

<Fragment>
Expand Down
4 changes: 4 additions & 0 deletions build_scripts/windows/azure-cli.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="BeforeBuild">
Expand Down
14 changes: 0 additions & 14 deletions build_scripts/windows/propagate_env_change/main.cpp

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions build_scripts/windows/scripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ set PYTHON_VERSION=3.10.5

set WIX_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/msi/wix310-binaries-mirror.zip"
set PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/%PYTHON_VERSION%/python-%PYTHON_VERSION%-embed-win32.zip"
set PROPAGATE_ENV_CHANGE_DOWNLOAD_URL="https://azurecliprod.blob.core.windows.net/util/propagate_env_change.zip"

REM https://pip.pypa.io/en/stable/installation/#get-pip-py
set GET_PIP_DOWNLOAD_URL="https://bootstrap.pypa.io/get-pip.py"
Expand All @@ -34,7 +33,6 @@ set TEMP_SCRATCH_FOLDER=%ARTIFACTS_DIR%\cli_scratch
set BUILDING_DIR=%ARTIFACTS_DIR%\cli
set WIX_DIR=%ARTIFACTS_DIR%\wix
set PYTHON_DIR=%ARTIFACTS_DIR%\Python
set PROPAGATE_ENV_CHANGE_DIR=%~dp0..\propagate_env_change

set REPO_ROOT=%~dp0..\..\..

Expand Down Expand Up @@ -184,20 +182,6 @@ popd

if %errorlevel% neq 0 goto ERROR

REM ensure propagate_env_change.exe is available
if exist "%PROPAGATE_ENV_CHANGE_DIR%\propagate_env_change.exe" (
echo Using existing propagate_env_change.exe at %PROPAGATE_ENV_CHANGE_DIR%
) else (
pushd %PROPAGATE_ENV_CHANGE_DIR%
echo Downloading propagate_env_change.exe.
curl --output propagate_env_change.zip %PROPAGATE_ENV_CHANGE_DOWNLOAD_URL%
unzip propagate_env_change.zip
if %errorlevel% neq 0 goto ERROR
del propagate_env_change.zip
echo propagate_env_change.exe downloaded and extracted successfully.
popd
)

echo Building MSI...
msbuild /t:rebuild /p:Configuration=Release %REPO_ROOT%\build_scripts\windows\azure-cli.wixproj

Expand Down

0 comments on commit b1c7966

Please sign in to comment.