Skip to content

Commit

Permalink
Created a shortcut for file_explorer_renew.exe in Start Menu. #115
Browse files Browse the repository at this point in the history
Added a new dialog in the installer about instructions before uninstalling.
  • Loading branch information
end2endzone committed Jan 12, 2024
1 parent 5fb43c8 commit e453904
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${CPACK_WIX_HELP_LINK}")
# Define start menu shortcuts for WIX
# More shortcuts are defined in file "wix/WIX.extra.in"
set_property(INSTALL "bin/$<TARGET_FILE_NAME:sa.tests>" PROPERTY CPACK_START_MENU_SHORTCUTS "${PROJECT_NAME} unit tests")
set_property(INSTALL "bin/$<TARGET_FILE_NAME:file_explorer_renew>" PROPERTY CPACK_START_MENU_SHORTCUTS "File Explorer Renew")
set_property(INSTALL "${README_FILENAME}" PROPERTY CPACK_START_MENU_SHORTCUTS "${README_FILENAME}" )
set_property(INSTALL "${USERMANUAL_FILENAME}" PROPERTY CPACK_START_MENU_SHORTCUTS "${USERMANUAL_FILENAME}" )
set_property(INSTALL "${CONTRIBUTING_FILENAME}" PROPERTY CPACK_START_MENU_SHORTCUTS "${CONTRIBUTING_FILENAME}" )
Expand All @@ -461,9 +462,13 @@ set_property(INSTALL "bin/unregister.bat" PROPERTY
configure_file("${CMAKE_SOURCE_DIR}/wix/WIX.patches.in" "${CMAKE_BINARY_DIR}/wix/WIX.patches.wxs")
configure_file("${CMAKE_SOURCE_DIR}/wix/WIX.extra.in" "${CMAKE_BINARY_DIR}/wix/WIX.extra.wxs" )
set(CPACK_WIX_PATCH_FILE "${CMAKE_BINARY_DIR}/wix/WIX.patches.wxs")
set(CPACK_WIX_EXTRA_SOURCES "${CMAKE_BINARY_DIR}/wix/WIX.extra.wxs" )
set(CPACK_WIX_EXTRA_SOURCES
"${CMAKE_BINARY_DIR}/wix/WIX.extra.wxs"
"${CMAKE_SOURCE_DIR}/wix/WixUI_FileExplorerRenewDlg.wxs"
"${CMAKE_SOURCE_DIR}/wix/WixUI_ShellAnythingUI.wxs"
)
set(CPACK_WIX_EXTENSIONS "WiXUtilExtension") # This is required for the util:InternetShortcut in WIX.extra.in
set(CPACK_WIX_UI_REF "WixUI_FeatureTree") # To show a custom install directory and list of features.
set(CPACK_WIX_UI_REF "WixUI_ShellAnythingUI") # To show a custom install directory and list of features.

# Starting from version 0.8.0 we must disable the installation of ShellAnything if an existing version is already installed.
# See issues for details:
Expand Down
34 changes: 34 additions & 0 deletions wix/WixUI_FileExplorerRenewDlg.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI>
<Dialog Id="FileExplorerRenewDlg" Width="370" Height="270" Title="[ProductName] Setup">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>

<Control Id="Message1" Type="Text" X="25" Y="60" Width="325" Height="165" Transparent="yes" NoPrefix="yes" >
<Text>
<![CDATA[Shell Extensions DLLs often cannot be deleted during the uninstall process because _File Explorer_ usually have a lock on the file. Because of the lock, a system reboot is required to complete the uninstall.
ShellAnything provides an utility called "File Explorer Renew" that can close and reopen all File Explorer windows. If the shell extension is unregistered, it will renew all windows and release the lock on the shell extension dll.
For more details, check the following in the documentation: ]]>
</Text>
</Control>

<Control Id="Link1" Type="Hyperlink" X="25" Y="150" Width="325" Height="15" Transparent="yes">
<Text><![CDATA[<a href="https://github.com/end2endzone/ShellAnything/blob/master/INSTALL.md#uninstall">INSTALL.md, uninstall section</a>]]></Text>
</Control>

<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="It is possible to uninstall Shell Extensions without rebooting" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Before you uninstall" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
</Dialog>
</UI>
</Fragment>
</Wix>
76 changes: 76 additions & 0 deletions wix/WixUI_ShellAnythingUI.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
This file is a modified version of WixUI_FeatureTree.wxs from Wix Toolset v3.11.
-->

<!--
First-time install dialog sequence:
- WixUI_WelcomeDlg
- WixUI_LicenseAgreementDlg
- FileExplorerRenewDlg
- WixUI_CustomizeDlg
- WixUI_VerifyReadyDlg
- WixUI_DiskCostDlg
Maintenance dialog sequence:
- WixUI_MaintenanceWelcomeDlg
- WixUI_MaintenanceTypeDlg
- WixUI_FileExplorerRenewDlg
- WixUI_CustomizeDlg
- WixUI_VerifyReadyDlg
Patch dialog sequence:
- WixUI_WelcomeDlg
- WixUI_VerifyReadyDlg
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="WixUI_ShellAnythingUI">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Property Id="WixUI_Mode" Value="FeatureTree" />

<DialogRef Id="ErrorDlg" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="FileExplorerRenewDlg">LicenseAccepted = "1"</Publish>

<Publish Dialog="FileExplorerRenewDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="1">1</Publish>
<Publish Dialog="FileExplorerRenewDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="1">1</Publish>

<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="FileExplorerRenewDlg" Order="2">NOT Installed</Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish>

<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

<Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
</UI>

<UIRef Id="WixUI_Common" />
</Fragment>
</Wix>

0 comments on commit e453904

Please sign in to comment.