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 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 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
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
Binary file added build-msi/IDEASY.msi
Binary file not shown.
16 changes: 16 additions & 0 deletions build-msi/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>
73 changes: 73 additions & 0 deletions build-msi/Package.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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-setup\**" />
</Feature>

<!-- Embedd .cab file with setup folder inside -->
<MediaTemplate EmbedCab="yes" />

<!-- Specifying license and bitmap files -->
<WixVariable Id="WixUILicenseRtf" Value=".\assets\LICENSE.rtf" />
<WixVariable Id="WixUIBannerBmp" Value=".\assets\banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value=".\assets\dialog.bmp" />

<!-- Specifying Directories and Properties for installation location selection-->
<Property Id="INSTALLTYPE" Value="ROOT" />

<Directory Id="ROOTDIRECTORY">
<Directory Id="INSTALLFOLDER" Name="projects" />
</Directory>

<Property Id="USERFOLDER" >
<DirectorySearch Id="userProfileSearch" Depth="0" Path="[%USERPROFILE]" />
</Property>

<Directory Id="USERFOLDER" >
<Directory Id="USERHOMEFOLDER" Name="projects" />
</Directory>

<!-- Execution of setup.bat script-->
<SetProperty
Id="RunSetupAction"
Value="&quot;[INSTALLFOLDER]_ide\setup.bat&quot; -b"
Before="RunSetupAction"
Sequence="execute"
/>

<!-- Needed for quiet execution of scripts-->
<CustomAction
Id="RunSetupAction"
BinaryRef="Wix4UtilCA_X64"
DllEntry="WixQuietExec"
Execute="deferred"
Impersonate="yes"
Return="ignore"
/>

<CustomAction
Id="RunUninstallAction"
Directory="INSTALLFOLDER"
ExeCommand="[SOURCEDIR]scripts/uninstall.bat"
Execute="deferred" Return="ignore"
/>

<!-- Specifying when Custom Actions should run -->
<InstallExecuteSequence>
<Custom Action="RunSetupAction" Condition="NOT Installed" Before="InstallFinalize" />
<Custom Action='RunUninstallAction' Condition="Installed AND NOT UPGRADINGPRODUCTCODE" After="InstallInitialize" />
</InstallExecuteSequence>

<!-- UI Element -->
<ui:WixUI Id="WixUI_InstallDirCustom" InstallDirectory="INSTALLFOLDER" />

</Package>
</Wix>
93 changes: 93 additions & 0 deletions build-msi/WixUI_OwnSetup.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">

<?foreach WIXUIARCH in X86;X64;A64 ?>
<Fragment>
<UI Id="WixUI_InstallDirCustom_$(WIXUIARCH)">
<Publish Dialog="LicenseAgreementDlg" Control="Print" Event="DoAction" Value="WixUIPrintEula_$(WIXUIARCH)" />
</UI>
<UIRef Id="WixUI_InstallDirCustom" />
</Fragment>
<?endforeach?>

<Fragment>
<UI Id="file WixUI_InstallDirCustom">
<TextStyle Id="WixUI_Font_Normal" FaceName="Segoe UI" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Segoe UI" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Segoe UI" Size="9" Bold="yes" />

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

<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<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" />

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

<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" />
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallPathDlg" Condition="LicenseAccepted = &quot;1&quot;" />

<Publish Dialog="InstallPathDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" />
<Publish Dialog="InstallPathDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2" />

<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InstallPathDlg" Order="1" Condition="NOT Installed" />
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2" Condition="Installed AND NOT PATCH" />
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" Condition="Installed AND PATCH" />

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

<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg" />

<Property Id="ARPNOMODIFY" Value="1" />

</UI>

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

<Fragment>
<UI>

<Dialog Id="InstallPathDlg" Width="370" Height="270" Title="!(loc.InstallPathDlg_Title)">

<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallPathDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallPathDlgTitle)" />
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<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" />

<!-- Drive selector e.g C: -->
<Control Id="VolumeSelectorText" Type="Text" X="20" Y="60" Width="250" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SelectRootDriveText)" />
<Control Id="VolumeSelector" Type="VolumeSelectCombo" X="20" Y="80" Width="40" Height="40" Fixed="yes" Property="ROOTDRIVE" Text="!(loc.SelectRootDrive)" />

<!-- Radio Buttons to select the ROOT or USERHOME folder -->
<Control Id="InstallLocationText" Type="Text" X="20" Y="115" Width="250" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.SelectInstallLocationText)" />
<Control Id="InstallLocation" Type="RadioButtonGroup" Property="INSTALLTYPE" X="20" Y="130" Width="280" Height="100">
<RadioButtonGroup Property="INSTALLTYPE">
<RadioButton Value="ROOT" Text="!(loc.InstallRootOption)" X="0" Y="0" Width="260" Height="20" />
<RadioButton Value="HOME" Text="!(loc.InstallHomeOption)" X="0" Y="20" Width="260" Height="20" />
</RadioButtonGroup>
</Control>

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Property="INSTALLFOLDER" Value="[ROOTFOLDER]" Condition="INSTALLTYPE=&quot;ROOT&quot;" Order="1" />
<Publish Property="INSTALLFOLDER" Value="[USERHOMEFOLDER]" Condition="INSTALLTYPE=&quot;HOME&quot;" Order="2" />
</Control>
<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" />
</Control>
</Dialog>
</UI>
</Fragment>
</Wix>
Loading