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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

alfeilex
Copy link
Member

@alfeilex alfeilex commented Jan 22, 2025

Fixes: #420

This PR implements the creation of a MSI file for Windows Installer with WixToolset

The Windows Installer UI steps contain:

  • Accept License
  • Set installation path to (default C:\projects)
    • Validate path entries (advanced)
    • Copy files to the path
    • Run setup.bat -b after copying files in quiet mode
    • Set environment variables and registries
  • Run uninstall script when remove is selected in the installer

@coveralls
Copy link
Collaborator

coveralls commented Jan 22, 2025

Pull Request Test Coverage Report for Build 13168418547

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 68.379%

Totals Coverage Status
Change from base Build 13111467361: 0.0%
Covered Lines: 7391
Relevant Lines: 10390

💛 - Coveralls

@alfeilex alfeilex self-assigned this Jan 22, 2025
@alfeilex
Copy link
Member Author

I would like to start a discussion about the Windows Installer. In the current state, our UI is based on an extension thats provide the most important UI dialogs, such as the License agreement, installation path selection and when running the MSI again, the options to either repair the tool or remove it completely. It also includes a simple path validation, though not as advanced as described in the issue.

So when we would like to integrate some custom features such as an advanced validation or space capacity of 1GB, we need to create our own UI dialogs. My suggestion would be to initially stick with the extension UI and focus more on the installation and CI itself.

<!-- Specifying custom actions-->
<CustomAction Id="RunSetupAction" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]_ide\setup.bat -b" Execute="deferred" Return="check" />
<CustomAction Id="RunUninstallAction" Directory="INSTALLFOLDER" ExeCommand="[INSTALLFOLDER]_ide\ideeasy uninstall" Execute="deferred" Return="ignore" />

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As suggested, we could run the setup.bat -b script to add PATH entries and Registry keys. The only problem is that a terminal window pops up when the script is executed. I am looking for a solution but references in the documenation like (https://wixtoolset.org/docs/tools/wixext/quietexec/#silent-running) are out-dated and it's really hard for me to understand how this whole wixtoolset is working.

The other option would be to convert the .bat into a VBScript

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I know, we don't have a command to uninstall the ide from the system, like in devonfw-ide. If we decide to offer a remove feature in the UI, then it would be an option to create such as script with these steps: https://github.com/devonfw/IDEasy/blob/main/documentation/setup.adoc#uninstall

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After much trial and error, I finally managed to integrate the WixQuietExec custom action to run scripts silently. So now, we could stick to the idea of creating Windows Installer related scripts for installation, uninstallation and repair mode

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup.bat script in the MSI installation adds C:\projects\_ide\bin in the PATH in each installation run even its already there

<?define version = "1.0.0"?>
<?define publisher = "devonfw-ide"?>
<?define guid = "ba3ad5c0-94e9-42c3-9374-efaaddd3b967"?>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also define the correct meta information for the MSI packages

build-msi/IDEASY.wxs Outdated Show resolved Hide resolved
@alfeilex
Copy link
Member Author

alfeilex commented Feb 5, 2025

How can we convert LICENSE.adoc in LICENSE.rtf ?

@alfeilex
Copy link
Member Author

alfeilex commented Feb 5, 2025

Current State of Dialogs:

Welcome Dialog:
image

LicenseAgreement Dialog:
image

Installation Directory Dialog:
image

Agree Installation Dialog:
image

End of Installation Dialog:
image

Change, Repair Dialog:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Team Review
Development

Successfully merging this pull request may close these issues.

Create installer for Windows
2 participants