forked from devonfw/IDEasy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devonfw#420: Create Windows Installer with WixToolset (devonfw#978)
Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>
- Loading branch information
Showing
10 changed files
with
3,515 additions
and
5 deletions.
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
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,16 @@ | ||
<!-- | ||
This file contains the declaration of all the localizable strings. | ||
--> | ||
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
|
||
<String Id="DowngradeError" Value="A newer version of [ProductName] is already installed." /> | ||
<String Id="InstallPathDlg_Title" Value="[ProductName] Setup" /> | ||
<String Id="InstallPathDlgTitle" Value="{\WixUI_Font_Title}Select Project Folder" /> | ||
<String Id="InstallPathDlgDescription" Value="Click Next to install to the default folder or customize with options below." /> | ||
<String Id="InstallDirDlgBannerBitmap" Value="WixUI_Bmp_Banner"/> | ||
<String Id="SelectRootDrive" Value="Please choose the drive where you want to install IDEasy:"/> | ||
<String Id="SelectRootDriveText" Value="Please choose the drive where you want to install IDEasy:"/> | ||
<String Id="SelectInstallLocationText" Value="Select your preferred installation location:"/> | ||
<String Id="InstallRootOption" Value="Install in Root Directory (e.g., C:\projects)"/> | ||
<String Id="InstallHomeOption" Value="Install in Home Directory (e.g., C:\Users\YourUsername\projects)"/> | ||
</WixLocalization> |
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,78 @@ | ||
<?define ProductName = "IDEasy" ?> | ||
<?define Manufacturer = "devonfw" ?> | ||
<?define ProductVersion = "1.0.0" ?> | ||
<?define UpgradeCode = "1848091f-6184-451b-ba4c-097662e2cfaa" ?> | ||
|
||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"> | ||
<Package Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)" Version="$(var.ProductVersion)" UpgradeCode="$(var.UpgradeCode)"> | ||
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
|
||
<Feature Id="main"> | ||
<!-- Include files that has to be installed --> | ||
<Files Include="msi-files\**" /> | ||
</Feature> | ||
|
||
<MediaTemplate EmbedCab="yes" /> | ||
|
||
<!-- Specifying license and bitmap files --> | ||
<WixVariable Id="WixUILicenseRtf" Value=".\assets\LICENSE.rtf" /> | ||
<WixVariable Id="WixUIBannerBmp" Value=".\assets\banner.bmp" /> | ||
|
||
<!-- Specifying Directories and Properties for installation location selection--> | ||
<Property Id="INSTALLTYPE" Value="ROOT" /> | ||
|
||
<Directory Id="ROOTDIRECTORY"> | ||
<Directory Id="INSTALLFOLDER" Name="projects\_ide"/> | ||
</Directory> | ||
|
||
<Property Id="USERFOLDER" > | ||
<DirectorySearch Id="userProfileSearch" Depth="0" Path="[%USERPROFILE]" /> | ||
</Property> | ||
|
||
<Directory Id="USERFOLDER" > | ||
<Directory Id="USERHOMEFOLDER" Name="projects\_ide" /> | ||
</Directory> | ||
|
||
<!-- Execution of install command--> | ||
<SetProperty | ||
Id="RunInstallAction" | ||
Value=""[%SystemFolder]cmd.exe" /c "[INSTALLFOLDER]bin\ideasy.exe -f install"" | ||
Before="RunInstallAction" | ||
Sequence="execute" | ||
/> | ||
<CustomAction | ||
Id="RunInstallAction" | ||
BinaryRef="Wix4UtilCA_X64" | ||
DllEntry="WixQuietExec" | ||
Execute="deferred" | ||
Impersonate="yes" | ||
Return="check" | ||
/> | ||
|
||
<!-- Execution of uninstall command--> | ||
<SetProperty | ||
Id="RunUninstallAction" | ||
Value=""[%SystemFolder]cmd.exe" /c "[INSTALLFOLDER]bin\ideasy.exe -f uninstall"" | ||
Before="RunUninstallAction" | ||
Sequence="execute" | ||
/> | ||
<CustomAction | ||
Id="RunUninstallAction" | ||
BinaryRef="Wix4UtilCA_X64" | ||
DllEntry="WixQuietExec" | ||
Execute="deferred" | ||
Impersonate="yes" | ||
Return="check" | ||
/> | ||
|
||
<!-- Specifying when Custom Actions should run --> | ||
<InstallExecuteSequence> | ||
<Custom Action="RunInstallAction" Condition="NOT Installed" Before="InstallFinalize" /> | ||
<Custom Action='RunUninstallAction' Condition="Installed AND NOT UPGRADINGPRODUCTCODE" After="InstallInitialize" /> | ||
</InstallExecuteSequence> | ||
|
||
<!-- Custom UI Reference --> | ||
<ui:WixUI Id="WixUI_InstallDirCustom" InstallDirectory="INSTALLFOLDER" /> | ||
|
||
</Package> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
:toc: macro | ||
toc::[] | ||
|
||
== Building IDEASY MSI Package with WixToolSet v5 | ||
|
||
=== Prerequisites | ||
|
||
Ensure you have the following installed: | ||
|
||
- .NET SDK 6.0 or later | ||
- dotnet (supported by IDEasy itself) | ||
- Wixtoolset v.5 `dotnet tool install --global wix --version 5.0.2` | ||
|
||
=== Steps to Build the MSI Package | ||
|
||
1. **Add the necessary WiX extensions** | ||
|
||
cd windows-installer | ||
wix extension add WixToolset.UI.wixext/5.0.2 | ||
wix extension add WixToolset.Util.wixext/5.0.2 | ||
|
||
2. **Build the MSI package** | ||
|
||
wix build Package.wxs WixUI_IDEasySetup.wxs -loc Package.en-us.wxl -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -d ProductVersion=${current.version} -o ideasy.msi | ||
|
||
== Debugging Installation Issues | ||
|
||
To debug the installation process and capture detailed logs, use the following command: | ||
|
||
``` | ||
msiexec /i IDEASY.msi /l*v install.log | ||
``` | ||
|
||
This will create a verbose log file (`install.log`) that can help diagnose installation issues. | ||
|
||
== Additional Notes | ||
|
||
- Ensure that all dependencies and required WiX extensions are correctly installed. | ||
- Verify the generated MSI file to confirm that all components are included as expected. | ||
- Use the log file for troubleshooting any issues encountered during installation. | ||
- Use CMD or Powershell | ||
|
||
== Files | ||
|
||
link:Package.wxs[Package.wxs] | ||
|
||
This file serves as the entry point for the Windows installation process. | ||
It defines custom actions, properties, and the installation logic. | ||
Additionally, it specifies which files should be installed during the process. | ||
|
||
Here you can define what files should be included in the installation: | ||
|
||
<Files Include="msi-files\**" /> | ||
|
||
Here you define the script that will be executed after installation: | ||
|
||
<SetProperty | ||
Id="RunSetupAction" | ||
Value=""[INSTALLFOLDER]bin\ideasy.exe" -f install" | ||
Before="RunSetupAction" | ||
Sequence="execute" | ||
/> | ||
|
||
link:WixUI_IDEasySetup.wxs[WixUI_IDEasySetup.wxs] | ||
|
||
This file contains all elements related to the UI for the installation. | ||
You can configure the sequence of UI dialogs, add triggers for custom actions based on UI elements and customize dialogs like the InstallPathDlg, where users can choose their preferred installation directory. | ||
Most of the current UI is inherited by `WixUI_InstallDir.wxs` from WixUI dialog library in WixToolSet. | ||
|
||
link:Package.en-us.wxl[Package.en-us.wxl] | ||
|
||
A localization file containing text strings for English (US). | ||
By adding further localization files, we can support additional languages. |
Oops, something went wrong.