Skip to content
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

#420: Create Windows Installer with WixToolset #978

Merged
merged 56 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
a6180d2
add first template for MSI
alfeilex Jan 22, 2025
e1171de
remove path variable
alfeilex Jan 22, 2025
bf7f5ba
Merge branch 'devonfw:main' into #420-create-win-installer
alfeilex Jan 29, 2025
45dd4cb
Add CustomAction to run setup.bat after installation
alfeilex Jan 29, 2025
c5882a0
remove license here (moved to assets)
alfeilex Jan 29, 2025
38842bc
add readme how to build
alfeilex Jan 29, 2025
a50976d
remove code interpreter syntax highlighting
alfeilex Jan 29, 2025
08583cd
some correction
alfeilex Jan 29, 2025
f35d9d5
add info
alfeilex Jan 29, 2025
72163e7
small adaption
alfeilex Jan 29, 2025
8a31e88
add quiet setup.bat executin and pre built msi for testing
alfeilex Jan 29, 2025
b0a954e
change setup.bat run before InstallFinalize
alfeilex Jan 29, 2025
ed6020c
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 4, 2025
6949a8a
update for Ideasy msi
alfeilex Feb 5, 2025
f026bf2
update for Ideasy msi
alfeilex Feb 5, 2025
523586e
update readme
alfeilex Feb 5, 2025
2bbd6d7
update CustomActionValidation.CA.dll
alfeilex Feb 5, 2025
312d5a7
update
alfeilex Feb 5, 2025
147f9cb
add custom action code
alfeilex Feb 5, 2025
d9e3324
update CA
alfeilex Feb 5, 2025
79eb2d0
more compact
alfeilex Feb 5, 2025
0e26392
Refactor and add Dlg for Select install Location
alfeilex Feb 12, 2025
946b9f8
Merge branch 'main' of https://github.com/devonfw/IDEasy into #420-cr…
alfeilex Feb 12, 2025
58b5a70
Remove unnecessary files
alfeilex Feb 12, 2025
d986e4d
add some explaination to the readme
alfeilex Feb 12, 2025
e6e14d7
Merge branch 'devonfw:main' into #420-create-win-installer
alfeilex Feb 18, 2025
6636651
Merge branch 'devonfw:main' into #420-create-win-installer
alfeilex Feb 19, 2025
971dd5d
update path for setup files
alfeilex Feb 19, 2025
d9edb86
update readme
alfeilex Feb 19, 2025
30447ba
update projects\_ide and readme
alfeilex Feb 19, 2025
ea06a5f
delete msi
alfeilex Feb 19, 2025
e81f1ac
Merge branch 'main' into #420-create-win-installer
hohwille Feb 21, 2025
cdc4027
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 23, 2025
0cd8d79
Rename folder
alfeilex Feb 23, 2025
ec47ece
#420: Add changelog entry
alfeilex Feb 23, 2025
ac4bc64
#420: change LICENSE and use ideasy.exe install and uninstall
alfeilex Feb 23, 2025
bfb77ee
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 25, 2025
b3b0837
#420: update uninstall command and update LICENSE.rtf
alfeilex Feb 25, 2025
d648dbd
#420: working setup.bat call because calling ideasy.exe didnt work
alfeilex Feb 25, 2025
3bc1e11
#420: add build helper maven plugin to attach msi
alfeilex Feb 25, 2025
967e327
#420: use ideasy.exe install -f install and uninstall
alfeilex Feb 25, 2025
d1554df
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 25, 2025
d08403a
#420: add maven ant run and builder help plugin to attach the MSI in …
alfeilex Feb 26, 2025
c990521
#420: add maven ant run and builder help plugin to attach the MSI in …
alfeilex Feb 26, 2025
3448641
#420: remove classifier installer
alfeilex Feb 26, 2025
5158717
#420: add nightly build for windows installer
alfeilex Feb 26, 2025
df3b26e
#420: remove dialog bmp and adapt readme
alfeilex Feb 26, 2025
c5da6ae
#420: revert to workflow_dispatch
alfeilex Feb 26, 2025
6bba96e
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 26, 2025
893047c
#420: remove dialog.bmp
alfeilex Feb 26, 2025
edeba9d
Merge branch 'main' into #420-create-win-installer
alfeilex Feb 26, 2025
7ab9bc7
#420: add release workflow
alfeilex Feb 26, 2025
509ef3e
Merge branch '#420-create-win-installer' of https://github.com/alfeil…
alfeilex Feb 26, 2025
841bce6
#420: revert push trigger in release worfklow
alfeilex Feb 26, 2025
3c78781
#420: adapt CHANGELOG.adoc
alfeilex Feb 26, 2025
d292a7f
Merge branch 'main' into #420-create-win-installer
hohwille Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ jobs:
with:
name: natives-${{ matrix.os }}
path: cli/target/ideasy*
- name: Build MSI with WixToolSet
if: runner.os == 'Windows'
shell: bash
run: |
cd documentation
mvn -B -ntp clean install
cd ..
mkdir -p windows-installer/msi-files
cp documentation/target/generated-docs/IDEasy.pdf windows-installer/msi-files
cp -r cli/target/package/* windows-installer/msi-files
cd windows-installer
dotnet tool install --global wix --version 5.0.2
wix extension add WixToolset.UI.wixext/5.0.2
wix extension add WixToolset.Util.wixext/5.0.2
wix build Package.wxs WixUI_IDEasySetup.wxs -loc Package.en-us.wxl -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -o ideasy.msi
- name: Upload MSI
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: msi
path: windows-installer/ideasy.msi

# Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to OSSRH Nexus
deploy:
Expand All @@ -52,10 +73,9 @@ jobs:
- name: Download natives and build project
uses: actions/download-artifact@v4
with:
pattern: natives-*
path: ./cli/target/
- name: Deploy to OSSRH nexus
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dgpg.skip=true -Dstyle.color=always -B -ntp -Passembly,deploy deploy
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dgpg.skip=true -Dstyle.color=always -B -ntp -Passembly,msi,deploy deploy
25 changes: 23 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,27 @@ jobs:
with:
name: natives-${{ matrix.os }}
path: cli/target/ideasy*
- name: Build MSI with WixToolSet
if: runner.os == 'Windows'
shell: bash
run: |
cd documentation
mvn -B -ntp clean install
cd ..
mkdir -p windows-installer/msi-files
cp documentation/target/generated-docs/IDEasy.pdf windows-installer/msi-files
cp -r cli/target/package/* windows-installer/msi-files
cd windows-installer
dotnet tool install --global wix --version 5.0.2
wix extension add WixToolset.UI.wixext/5.0.2
wix extension add WixToolset.Util.wixext/5.0.2
wix build Package.wxs WixUI_IDEasySetup.wxs -loc Package.en-us.wxl -ext WixToolset.UI.wixext -ext WixToolset.Util.wixext -o ideasy.msi
- name: Upload MSI
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: msi
path: windows-installer/ideasy.msi

# Downloads all native image artifacts to cli/target and builds the project using assemblies for final deployment to Maven Central.
# The version number for the next build will be incremented automatically.
Expand All @@ -62,7 +83,6 @@ jobs:
- name: Download natives and build project
uses: actions/download-artifact@v4
with:
pattern: natives-*
path: ./cli/target/
- name: Create assemblies and publish to Apache Maven Central
run: |
Expand All @@ -78,7 +98,7 @@ jobs:
git tag -a "release/${next_version}" -m "tagged version ${next_version}"
export GPG_TTY=$TTY
mkdir -p ./cli/target/
mvn --settings .mvn/settings.xml -B -ntp deploy -Passembly,deploy -Dgpg.pin.entry.mode=loopback -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
mvn --settings .mvn/settings.xml -B -ntp deploy -Passembly,msi,deploy -Dgpg.pin.entry.mode=loopback -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand All @@ -102,6 +122,7 @@ jobs:
git push --tags
noDotVersion="${current_version//.}"
gh release create "release/${current_version}" ./cli/target/*.tar.gz --title "${current_version}" --notes "# Download
* Windows-MSI: https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}.msi
* Windows: https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-windows-x64.tar.gz
* Mac(arm): https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-mac-arm.tar.gz
* Mac(x64): https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/${current_version}/ide-cli-${current_version}-mac-x64.tar.gz
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE

Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/420[#420]: Add MSI Build and Deployment
* https://github.com/devonfw/IDEasy/issues/1061[#1061]: Mac: no such file or directory: /_ide/installation/functions

The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/22?closed=1[milestone 2025.02.002].
Expand Down
50 changes: 49 additions & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<jline.version>3.24.1</jline.version>
<jansi.version>2.4.1</jansi.version>
<jackson.version>2.18.2</jackson.version>
<build.helper.maven.plugin.version>3.6.0</build.helper.maven.plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -250,13 +251,60 @@
<arg>--enable-url-protocols=http,https</arg>
<arg>-march=compatibility</arg>
<arg>--initialize-at-build-time=org.apache.commons</arg>
<arg>-H:IncludeResourceBundles=com.sun.org.apache.xml.internal.res.XMLErrorResources,com.sun.org.apache.xerces.internal.impl.msg.XMLMessages</arg>
<arg>-H:IncludeResourceBundles=com.sun.org.apache.xml.internal.res.XMLErrorResources,com.sun.org.apache.xerces.internal.impl.msg.XMLMessages
</arg>
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>msi</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<move file="${project.basedir}/target/msi/ideasy.msi"
tofile="${project.basedir}/target/${project.artifactId}-${revision}.msi"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build.helper.maven.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.basedir}/target/${project.artifactId}-${revision}.msi</file>
<type>msi</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
16 changes: 16 additions & 0 deletions windows-installer/Package.en-us.wxl
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>
78 changes: 78 additions & 0 deletions windows-installer/Package.wxs
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="&quot;[%SystemFolder]cmd.exe&quot; /c &quot;[INSTALLFOLDER]bin\ideasy.exe -f install&quot;"
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="&quot;[%SystemFolder]cmd.exe&quot; /c &quot;[INSTALLFOLDER]bin\ideasy.exe -f uninstall&quot;"
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>
73 changes: 73 additions & 0 deletions windows-installer/README.adoc
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="&quot;[INSTALLFOLDER]bin\ideasy.exe&quot; -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.
Loading