Compare commits
100 Commits
2020-07-20
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c9763a0a8 | ||
|
|
3d24b45be7 | ||
|
|
4c976e8ef9 | ||
|
|
be354de86b | ||
|
|
2473ff0808 | ||
|
|
f65d1b8a42 | ||
|
|
65a56be710 | ||
|
|
750994a32b | ||
|
|
c30215fef8 | ||
|
|
1c7eee8426 | ||
|
|
f2c532a889 | ||
|
|
de2a6ca3e7 | ||
|
|
39996f539c | ||
|
|
c286b296d3 | ||
|
|
84dfd74760 | ||
|
|
3cf8b7eabe | ||
|
|
58f6dc63ea | ||
|
|
cf1e9b4c20 | ||
|
|
477a2f5603 | ||
|
|
97d7bf58b4 | ||
|
|
759168a89b | ||
|
|
3b935b9f61 | ||
|
|
4d83cc210c | ||
|
|
6eaa6d49cd | ||
|
|
a3839b22e2 | ||
|
|
224d05263c | ||
|
|
59a34503fe | ||
|
|
741fb309a2 | ||
|
|
e73e164c3c | ||
|
|
56d39282b5 | ||
|
|
68a5ee8f33 | ||
|
|
cfd23616d2 | ||
|
|
b5fb298387 | ||
|
|
cdda721492 | ||
|
|
81f081a283 | ||
|
|
e3ead38d71 | ||
|
|
10a4d0854e | ||
|
|
f295a63b69 | ||
|
|
eb76bfb492 | ||
|
|
e48c22a1dc | ||
|
|
e2246ea5db | ||
|
|
b0d576213a | ||
|
|
d4cb165312 | ||
|
|
512da17221 | ||
|
|
7a48e24250 | ||
|
|
73aa4870d8 | ||
|
|
82a3c5ccd5 | ||
|
|
cbdbd2e246 | ||
|
|
3b0215d235 | ||
|
|
c76b36f1f0 | ||
|
|
1012614b7a | ||
|
|
56bdbbadbf | ||
|
|
07f47e5e96 | ||
|
|
439a6c5cba | ||
|
|
19b98a20ac | ||
|
|
2480a1e1ae | ||
|
|
bb31bc4758 | ||
|
|
a63c2efbb1 | ||
|
|
0f0ce8ac4a | ||
|
|
92cd8703f0 | ||
|
|
d7119e21be | ||
|
|
3afa802e7b | ||
|
|
109259037b | ||
|
|
ff11ad435d | ||
|
|
5ff691e212 | ||
|
|
a2903688fa | ||
|
|
c898282f3f | ||
|
|
289a0c9938 | ||
|
|
097ca2e025 | ||
|
|
14c8d38bc1 | ||
|
|
17b1d7ee2d | ||
|
|
febbec6b28 | ||
|
|
8216e9655b | ||
|
|
f898970dc7 | ||
|
|
0fd65b0ee4 | ||
|
|
2779e83ac4 | ||
|
|
f9dca48d21 | ||
|
|
26c21ec33f | ||
|
|
dbb542e04b | ||
|
|
1491e3b29c | ||
|
|
6a200a8209 | ||
|
|
13d7be8a0e | ||
|
|
9526399f7c | ||
|
|
c0f11534c2 | ||
|
|
9fedc87b6a | ||
|
|
7cd10e81b9 | ||
|
|
b2ede322c2 | ||
|
|
02864876e3 | ||
|
|
59f5965b5c | ||
|
|
013ed1d783 | ||
|
|
059986c768 | ||
|
|
7b4b35f659 | ||
|
|
d5dd27fe4d | ||
|
|
7b149f78c1 | ||
|
|
a588bcc370 | ||
|
|
8e7f4c3fe6 | ||
|
|
d51f1426b6 | ||
|
|
049636c00b | ||
|
|
032322e2f7 | ||
|
|
6eca2a3ba6 |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
_cache
|
||||
*.exe
|
||||
*.xz
|
||||
*.zst
|
||||
_build
|
||||
16
HACKING.md
Normal file
16
HACKING.md
Normal file
@@ -0,0 +1,16 @@
|
||||
## Build Instructions
|
||||
|
||||
```bash
|
||||
# Run in a MINGW64 environment
|
||||
./make-msys2-installer
|
||||
```
|
||||
|
||||
## New Release TODO List
|
||||
|
||||
* Trigger a new nightly build via https://github.com/msys2/msys2-installer/actions/workflows/build.yml or use an existing one
|
||||
* Get all files with dates in their names, sign them and create checksum files (.sig and .sha256)
|
||||
* Create a new git tag following format: `date -I`
|
||||
* Upload the installer files to the release tag
|
||||
* Update the download link and checksum for the GiHub action and verify that all tests pass: https://github.com/msys2/setup-msys2/blob/master/main.js
|
||||
* Run `msys2-devtools/update-installer "$(date -I)"` on the server to copy the release from GitHub
|
||||
* Update the link, name and checksum on the main website (pointing to GitHub): https://github.com/msys2/msys2.github.io/blob/source/web/index.md
|
||||
26
LICENSE
Normal file
26
LICENSE
Normal file
@@ -0,0 +1,26 @@
|
||||
Copyright 2021 MSYS2 devs
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
39
README.md
39
README.md
@@ -1,14 +1,35 @@
|
||||
# MSYS2 Installer
|
||||
|
||||
## Nightly build
|
||||
|
||||
Download: [msys2-x86_64-latest.exe](https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-x86_64-latest.exe)
|
||||
|
||||

|
||||
|
||||
## Build Instructions
|
||||
## CLI Usage examples
|
||||
|
||||
```bash
|
||||
# Run in a MSYS2 environment
|
||||
./make-msys2-installer
|
||||
```
|
||||
Installing the GUI installer via the CLI to `C:\msys64`:
|
||||
|
||||
```powershell
|
||||
.\msys2-x86_64-latest.exe in --confirm-command --accept-messages --root C:/msys64
|
||||
```
|
||||
|
||||
Uninstalling an existing installation in `C:\msys64` via the CLI:
|
||||
|
||||
```powershell
|
||||
C:\msys64\uninstall.exe pr --confirm-command
|
||||
```
|
||||
|
||||
Installing the self extracting archive to `C:\msys64`:
|
||||
|
||||
```powershell
|
||||
.\msys2-base-x86_64-latest.sfx.exe -y -oC:\
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### What's the difference between the installer and the archives?
|
||||
|
||||
The installer provides some additional features such as installing shortcuts, registering an uninstaller, a GUI for selecting the installation path and automatically running a login shell at the end to initialize the MSYS2 environment.
|
||||
|
||||
If you unpack the archives and run a login shell once, you will get a functionally equivalent MSYS2 installation.
|
||||
|
||||
### What is contained in the installer/archives?
|
||||
|
||||
It contains the [base](https://packages.msys2.org/package/base) package and all its dependencies. You can list the contained packages using: `pactree base -lu | sort`
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
// Run with:
|
||||
// ./msys2-x86_64-$(date +'%Y%m%d').exe --platform minimal --script auto-install.js -v
|
||||
// To specify the installation directory, add InstallPrefix="C:\custom_install\path\"
|
||||
// Currently it gets stuck on the last page.
|
||||
// To see graphically what's happening, remove "--platform minimal"
|
||||
|
||||
var install_dir = installer.value("InstallPrefix")
|
||||
|
||||
function Controller()
|
||||
{
|
||||
print("(print) Hello Installer World!\n");
|
||||
console.log("(console.log) Hello Installer World!\n");
|
||||
installer.setDefaultPageVisible(QInstaller.Introduction, true);
|
||||
|
||||
var page = gui.pageWidgetByObjectName( "ComponentSelectionPage" );
|
||||
page.selectComponent( "com.msys2.root" );
|
||||
page.selectComponent( "com.msys2.root.base" );
|
||||
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
|
||||
installer.setDefaultPageVisible(QInstaller.PerformInstallation, true);
|
||||
installer.setDefaultPageVisible(QInstaller.InstallationFinished, true);
|
||||
installer.setDefaultPageVisible(QInstaller.FinishedPage, true);
|
||||
ComponentSelectionPage.selectAll();
|
||||
installer.autoRejectMessageBoxes();
|
||||
var result = QMessageBox.question("quit.question", "Installer", "Do you want to quit the installer?",
|
||||
QMessageBox.Yes | QMessageBox.No);
|
||||
|
||||
console.log("(console.log) result " + result);
|
||||
|
||||
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
|
||||
installer.setMessageBoxAutomaticAnswer("stopProcessesForUpdates", QMessageBox.Ignore);
|
||||
}
|
||||
|
||||
Controller.prototype.IntroductionPageCallback = function()
|
||||
{
|
||||
gui.clickButton(buttons.NextButton);
|
||||
}
|
||||
|
||||
Controller.prototype.TargetDirectoryPageCallback = function()
|
||||
{
|
||||
gui.currentPageWidget().TargetDirectoryLineEdit.setText(install_dir);
|
||||
gui.clickButton(buttons.NextButton);
|
||||
}
|
||||
|
||||
Controller.prototype.StartMenuDirectoryPageCallback = function()
|
||||
{
|
||||
gui.clickButton(buttons.NextButton);
|
||||
}
|
||||
|
||||
Controller.prototype.PerformInstallationPageCallback = function()
|
||||
{
|
||||
var page = gui.pageWidgetByObjectName("PerformInstallationPage");
|
||||
installer.setAutomatedPageSwitchEnabled(true);
|
||||
gui.clickButton(buttons.NextButton);
|
||||
}
|
||||
|
||||
Controller.prototype.InstallationFinishedPageCallback = function()
|
||||
{
|
||||
console.log("(console.log) InstallationFinishedPageCallback ");
|
||||
var checkBox = gui.pageWidgetByObjectName("RunItCheckBox");
|
||||
console.log("typeof checkBox is " + typeof checkBox);
|
||||
assert(typeof checkBox === 'object');
|
||||
|
||||
var page = gui.pageWidgetByObjectName("InstallationFinishedPage");
|
||||
gui.clickButton(buttons.NexthButton);
|
||||
}
|
||||
|
||||
Controller.prototype.FinishedPageCallback = function()
|
||||
{
|
||||
console.log("(console.log) FinishedPageCallback ");
|
||||
// var checkBox = gui.pageWidgetByObjectName("RunItCheckBox");
|
||||
// console.log("typeof checkBox is " + typeof checkBox);
|
||||
// assert(typeof checkBox === 'object');
|
||||
|
||||
var page = gui.pageWidgetByObjectName("FinishedPage");
|
||||
page.RunItCheckBox.checked = false;
|
||||
gui.clickButton(buttons.FinishButton);
|
||||
}
|
||||
|
||||
/*
|
||||
Controller.prototype.ComponentSelectionPageCallback = function()
|
||||
{
|
||||
var page = gui.pageWidgetByObjectName( "ComponentSelectionPage" )
|
||||
page.deselectComponent( "com.nokia.ndk.tools.maemo.usbdriver" )
|
||||
gui.clickButton( buttons.NextButton )
|
||||
}
|
||||
*/
|
||||
@@ -1,58 +0,0 @@
|
||||
schedules:
|
||||
- cron: '0 0 * * 0'
|
||||
displayName: weekly build
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
always: true
|
||||
|
||||
jobs:
|
||||
- job: MSYS
|
||||
timeoutInMinutes: 360
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
strategy:
|
||||
maxParallel: 5
|
||||
matrix:
|
||||
x86_64:
|
||||
MSYS_DIR: msys64
|
||||
BASE_REPO: msys2-ci-base
|
||||
ARCH: x86_64
|
||||
steps:
|
||||
- powershell: |
|
||||
(New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2020-06-29/msys2-base-x86_64-20200629.sfx.exe", "sfx.exe")
|
||||
displayName: Download MSYS2
|
||||
- script: |
|
||||
sfx.exe -y -o%CD:~0,2%\
|
||||
%CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc " "
|
||||
%CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "pacman --noconfirm -Syuu"
|
||||
%CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "pacman --noconfirm -Syuu"
|
||||
displayName: Extract/Install/Update MSYS2
|
||||
- script: |
|
||||
%CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "pacman --noconfirm -S p7zip tar"
|
||||
displayName: Install deps
|
||||
- script: |
|
||||
set CHERE_INVOKING=yes
|
||||
%CD:~0,2%\$(MSYS_DIR)\usr\bin\bash -lc "bash make-msys2-installer; cp msys2-base-$(ARCH)-[0-9]*.sfx.exe msys2-base-$(ARCH)-latest.sfx.exe; cp msys2-$(ARCH)-[0-9]*.exe msys2-$(ARCH)-latest.exe; cp msys2-*.tar.xz msys2-base-$(ARCH)-latest.tar.xz"
|
||||
displayName: CI-Build
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
contents: 'msys2-*'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Copy installer
|
||||
- task: GithubRelease@0
|
||||
inputs:
|
||||
githubConnection: 'msys2-installer-release-connection'
|
||||
action: 'edit'
|
||||
tag: nightly-$(ARCH)
|
||||
assets: '$(Build.ArtifactStagingDirectory)/*'
|
||||
assetUploadMode: 'delete'
|
||||
addChangeLog: false
|
||||
displayName: 'Create GitHub Release'
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), ne(variables['Build.Reason'], 'PullRequest'))
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish packages
|
||||
inputs:
|
||||
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||
artifactName: $(MSYS_DIR)
|
||||
condition: and(succeeded(), or(ne(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest')))
|
||||
35
create-sfx.sh
Executable file
35
create-sfx.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
# usage: ./create-sfx.sh /some/path/to/msys64 installer.exe
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$MSYSTEM" = "CLANGARM64" ]; then
|
||||
ARCH="arm64"
|
||||
CHECKSUM="c526e8c6cb5dc0d175778f1b6b67bd1571ba8a2cf6f6b36b7c8a8d3197ad2bac"
|
||||
else
|
||||
ARCH="x64"
|
||||
CHECKSUM="d140094f0277b49a4e895159bd734da03cd2b60fb73a65e4151edfedc612981e"
|
||||
fi
|
||||
|
||||
# Download and extract https://github.com/mcmilk/7-Zip-zstd
|
||||
NAME="7z25.01-zstd-${ARCH}"
|
||||
DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
mkdir -p "$DIR/_cache"
|
||||
BASE="$DIR/_cache/$NAME"
|
||||
if [ ! -f "$BASE.exe" ]; then
|
||||
curl --fail -L "https://github.com/mcmilk/7-Zip-zstd/releases/download/v25.01-v1.5.7-R1/$NAME.exe" -o "$BASE.exe"
|
||||
fi
|
||||
echo "$CHECKSUM $BASE.exe" | sha256sum --quiet --check
|
||||
if [ ! -d "$BASE" ]; then
|
||||
7z e -o"$BASE" "$DIR/_cache/$NAME.exe"
|
||||
fi
|
||||
|
||||
# Create SFX installer
|
||||
INPUT="$1"
|
||||
OUTPUT="$2"
|
||||
TEMP="$OUTPUT.payload"
|
||||
|
||||
rm -f "$TEMP"
|
||||
"$BASE/7z" a "$TEMP" -ms1T -m0=zstd -mx22 "$INPUT"
|
||||
cat "$BASE/7zCon.sfx" "$TEMP" > "$OUTPUT"
|
||||
rm "$TEMP"
|
||||
10
fetch-sfx.sh
10
fetch-sfx.sh
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Fetch 7zCon.sfx from upstream 7-zip
|
||||
curl "https://www.7-zip.org/a/7z1900.exe" -o 7z1900.exe
|
||||
echo "759aa04d5b03ebeee13ba01df554e8c962ca339c74f56627c8bed6984bb7ef80 7z1900.exe" | sha256sum --check
|
||||
7z x -o7zout 7z1900.exe
|
||||
cp 7zout/7zCon.sfx .
|
||||
rm -Rf 7zout 7z1900.exe
|
||||
@@ -1,150 +1,113 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
_thisdir="$(dirname $0)"
|
||||
test "${_thisdir}" = "." && _thisdir=${PWD}
|
||||
_ifwroot="${_thisdir}"/qt-ifw
|
||||
_arch=$(uname -m)
|
||||
set -e
|
||||
|
||||
_thisdir="$( cd "$( dirname "$0" )" && pwd )"
|
||||
_build="${_thisdir}/_build"
|
||||
_ifwroot="${_build}/qt-ifw"
|
||||
_date=$(date +'%Y%m%d')
|
||||
_dateqif=$(date +'%Y-%m-%d')
|
||||
_version=${_date}
|
||||
_filename=msys2-${_arch}-${_date}.exe
|
||||
_filename2=msys2-base-${_arch}-${_date}.tar.xz
|
||||
_filename3=msys2-base-${_arch}-${_date}.sfx.exe
|
||||
_log=/tmp/installer-${_arch}-${_date}.log
|
||||
if [ "${_arch}" = "x86_64" ]; then
|
||||
_bitness=64
|
||||
_version="${_date}"
|
||||
_newmsysbase="${_build}/newmsys"
|
||||
_newmsys="${_newmsysbase}/msys64"
|
||||
|
||||
if [ "$MSYSTEM" = "CLANGARM64" ]; then
|
||||
_arch_name="arm64"
|
||||
else
|
||||
_bitness=32
|
||||
_arch_name="x86_64"
|
||||
fi
|
||||
_archivegen=/mingw${_bitness}/bin/archivegen.exe
|
||||
_binarycreator=/mingw${_bitness}/bin/binarycreator.exe
|
||||
_installerbase=/mingw${_bitness}/bin/installerbase.exe
|
||||
_newmsysbase=/tmp/newmsys
|
||||
_newmsys=${_newmsysbase}/msys"${_bitness}"
|
||||
|
||||
declare -a undo_commands
|
||||
create_installer_archive() {
|
||||
echo "[Creating installer archive...]"
|
||||
|
||||
_exitcode=5
|
||||
|
||||
exit_with_undo() {
|
||||
for _cmd in ${undo_commands[@]}; do
|
||||
eval "${_cmd}" | tee -a ${_log}
|
||||
done
|
||||
exit ${_exitcode}
|
||||
}
|
||||
|
||||
exit_cleanly() {
|
||||
_exitcode=$1; shift;
|
||||
local _message=$1; shift;
|
||||
echo "${_message}" | tee -a ${_log}
|
||||
exit_with_undo
|
||||
}
|
||||
|
||||
do_seds() {
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@DATE@|${_dateqif}|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@VERSION@|${_version}|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|@BITNESS@|${_bitness}|g" "{}" \;
|
||||
undo_commands+=("undo_seds")
|
||||
}
|
||||
|
||||
undo_seds() {
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|<ReleaseDate>${_dateqif}<|<ReleaseDate>@DATE@<|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|<Version>${_version}<|<Version>@VERSION@<|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|msys${_bitness}|msys@BITNESS@|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|${_bitness}bit|@BITNESS@bit|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" -or -name "installscript.js" \) -exec sed -i "s|if (\"@BITNESS@bit\" === \"@BITNESS@bit\")|if (\"@BITNESS@bit\" === \"32bit\")|g" "{}" \;
|
||||
local _data="${_ifwroot}"/packages/com.msys2.root/data
|
||||
pushd / > /dev/null
|
||||
mkdir -p "${_data}"
|
||||
7z a -mx9 -md128m "${_data}/msys64.7z" "${_newmsys}/"*
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
create_archives() {
|
||||
local _data="${_ifwroot}"/packages/com.msys2.root.base/data
|
||||
[ -d "${_data}" ] && rm -rf "${_data}"
|
||||
mkdir -p "${_data}"
|
||||
|
||||
local _dirs="${_newmsys}/"*
|
||||
local _compress_cmd="${_archivegen} --compression 9 ${_data}/msys${_bitness}.7z ${_dirs}"
|
||||
pushd / > /dev/null
|
||||
echo "Run: ${_compress_cmd} ..." | tee -a ${_log}
|
||||
eval "${_compress_cmd}" 2>&1 | tee -a ${_log}
|
||||
_result=$?
|
||||
if [ "${_result}" -eq "0" ]; then
|
||||
echo " archivegen succeeded. Created ${_data}/msys${_bitness}.7z" | tee -a ${_log}
|
||||
else
|
||||
exit_cleanly "3" "archivegen failed. See ${_log}"
|
||||
fi
|
||||
echo "[Creating tarball...]"
|
||||
pushd "${_newmsysbase}" > /dev/null
|
||||
/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cf "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" msys64
|
||||
popd > /dev/null
|
||||
|
||||
pushd ${_newmsysbase} > /dev/null
|
||||
local _compress_cmd2="/usr/bin/tar --transform='s/:/_/g' --dereference --hard-dereference -cJf ${_thisdir}/${_filename2} msys${_bitness}"
|
||||
echo "Run: ${_compress_cmd2} ..." | tee -a ${_log}
|
||||
eval "${_compress_cmd2}" 2>&1 | tee -a ${_log}
|
||||
_result=$?
|
||||
if [ "${_result}" -eq "0" ]; then
|
||||
echo " tar succeeded. Created " | tee -a ${_log}
|
||||
else
|
||||
die "MSYS2 compressing fail. See ${_log}"
|
||||
fi
|
||||
echo "[Creating xz archive...]"
|
||||
xz -9 --keep --verbose --force --compress --threads=0 "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar"
|
||||
xz --test "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.xz"
|
||||
|
||||
# self extracting cli 7z archive
|
||||
7z a -mx=9 "${_thisdir}/_temp.7z" "msys${_bitness}"
|
||||
cat ${_thisdir}/7zCon.sfx "${_thisdir}/_temp.7z" > "${_thisdir}/${_filename3}"
|
||||
rm "${_thisdir}/_temp.7z"
|
||||
echo "[Creating zstd archive...]"
|
||||
zstd -T0 -22 --ultra --force "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar" -o "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.zst"
|
||||
zstd --test "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar.zst"
|
||||
|
||||
rm "${_thisdir}/msys2-base-${_arch_name}-${_date}.tar"
|
||||
}
|
||||
|
||||
create_sfx() {
|
||||
echo "[Creating SFX...]"
|
||||
|
||||
pushd "${_newmsysbase}" > /dev/null
|
||||
"${_thisdir}/create-sfx.sh" "msys64" "${_thisdir}/msys2-base-${_arch_name}-${_date}.sfx.exe"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
# Add -v to get more information.
|
||||
make_installer() {
|
||||
eval "\"${_binarycreator}\" \
|
||||
-t \"${_installerbase}\" \
|
||||
-p \"${_ifwroot}/packages\" \
|
||||
-c \"${_ifwroot}/config/config.xml\" \
|
||||
--offline-only \
|
||||
\"${_filename}\" \
|
||||
-v" | tee -a ${_log}
|
||||
copy_installer() {
|
||||
echo "[Copying installer...]"
|
||||
rm -Rf "${_ifwroot}" && cp -r "${_thisdir}"/qt-ifw "${_ifwroot}"
|
||||
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@DATE@|${_dateqif}|g" "{}" \;
|
||||
find "${_ifwroot}" \( -name "package.xml" -or -name "config.xml" \) -exec sed -i "s|@VERSION@|${_version}|g" "{}" \;
|
||||
}
|
||||
|
||||
trap exit_with_undo 1 2 15
|
||||
create_installer() {
|
||||
echo "[Creating installer...]"
|
||||
|
||||
pushd "${_build}" > /dev/null
|
||||
binarycreator \
|
||||
-t "$(command -v installerbase)" \
|
||||
-p "${_ifwroot}/packages" \
|
||||
-c "${_ifwroot}/config/config.xml" \
|
||||
--offline-only \
|
||||
"${_thisdir}/msys2-${_arch_name}-${_date}.exe" \
|
||||
-v
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
create_chroot_system() {
|
||||
[ -d ${_newmsysbase} ] && rm -rf ${_newmsysbase}
|
||||
mkdir -p "${_newmsys}"
|
||||
pushd "${_newmsys}" > /dev/null
|
||||
echo "[Creating chroot system...]"
|
||||
rm -Rf "${_newmsysbase}" && mkdir -p "${_newmsys}"
|
||||
|
||||
pushd "${_newmsys}" > /dev/null
|
||||
mkdir -p var/lib/pacman
|
||||
mkdir -p var/log
|
||||
mkdir -p tmp
|
||||
|
||||
eval "pacman -Syu --root \"${_newmsys}\"" | tee -a ${_log}
|
||||
# https://github.com/msys2/MSYS2-packages/issues/2049
|
||||
eval "pacman -S filesystem --noconfirm --root \"${_newmsys}\"" | tee -a ${_log}
|
||||
eval "pacman -S base --noconfirm --root \"${_newmsys}\"" | tee -a ${_log}
|
||||
_result=$?
|
||||
if [ "${_result}" -ne "0" ]; then
|
||||
exit_cleanly "1" "failed to create newmsys2 via command 'pacman -S base --noconfirm --root ${_newmsys}'"
|
||||
fi
|
||||
pacman -Syu --root "${_newmsys}"
|
||||
pacman -S filesystem msys2-runtime --noconfirm --root "${_newmsys}"
|
||||
pacman -S base --noconfirm --root "${_newmsys}"
|
||||
pacman -Q --root "${_newmsys}" > "${_thisdir}/msys2-base-${_arch_name}-${_date}.packages.txt"
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
if [ ! -f "${_archivegen}" ]; then
|
||||
eval "pacman -S --noconfirm mingw${_bitness}/mingw-w64-${_arch}-qt-installer-framework" | tee -a ${_log}
|
||||
fi
|
||||
main() {
|
||||
pacman -S --noconfirm --needed \
|
||||
"${MINGW_PACKAGE_PREFIX}-qt-installer-framework" \
|
||||
"${MINGW_PACKAGE_PREFIX}-7zip" \
|
||||
"${MINGW_PACKAGE_PREFIX}-xz" \
|
||||
"${MINGW_PACKAGE_PREFIX}-zstd" \
|
||||
"tar"
|
||||
|
||||
if [ ! -f "${_archivegen}" ]; then
|
||||
exit_cleanly "2" "installation of qt installer framework failed. See ${_log}"
|
||||
fi
|
||||
create_chroot_system
|
||||
|
||||
if [ -f "${_log}" ]; then
|
||||
rm "${_log}"
|
||||
fi
|
||||
copy_installer
|
||||
create_installer_archive
|
||||
create_installer
|
||||
|
||||
echo "Creating MSYS2 chroot system ${_newmsys}" | tee -a ${_log}
|
||||
create_chroot_system
|
||||
if [ "$_arch_name" != "arm64" ]; then
|
||||
create_archives
|
||||
create_sfx
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Creating MSYS2 installer /tmp/${_filename}" | tee -a ${_log}
|
||||
if [ -f /tmp/${_filename} ]; then
|
||||
rm -f /tmp/${_filename}
|
||||
fi
|
||||
|
||||
do_seds
|
||||
create_archives
|
||||
make_installer
|
||||
exit_cleanly "0" "All done, see ${_filename}"
|
||||
main
|
||||
@@ -1,12 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Installer>
|
||||
<Name>MSYS2 @BITNESS@bit</Name>
|
||||
<Name>MSYS2</Name>
|
||||
<Version>@VERSION@</Version>
|
||||
<Title>MSYS2 @BITNESS@bit</Title>
|
||||
<Publisher>The MSYS2 Developers</Publisher>
|
||||
<StartMenuDir>MSYS2 @BITNESS@bit</StartMenuDir>
|
||||
<RunProgram>@TargetDir@/msys2_shell.cmd</RunProgram>
|
||||
<Title>MSYS2</Title>
|
||||
<Publisher>Befator Inc.</Publisher>
|
||||
<ControlScript>control.js</ControlScript>
|
||||
<StartMenuDir>MSYS2</StartMenuDir>
|
||||
<RunProgram>@TargetDir@/ucrt64.exe</RunProgram>
|
||||
<RunProgramArguments></RunProgramArguments>
|
||||
<InstallerApplicationIcon>../../msys2</InstallerApplicationIcon>
|
||||
<InstallerWindowIcon>../../msys2</InstallerWindowIcon>
|
||||
<InstallerApplicationIcon>msys2</InstallerApplicationIcon>
|
||||
<InstallerWindowIcon>msys2.ico</InstallerWindowIcon>
|
||||
<InstallActionColumnVisible>false</InstallActionColumnVisible>
|
||||
<WizardStyle>Modern</WizardStyle>
|
||||
<WizardDefaultWidth>40em</WizardDefaultWidth>
|
||||
<MaintenanceToolName>uninstall</MaintenanceToolName>
|
||||
<SupportsModify>false</SupportsModify>
|
||||
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
|
||||
<SaveDefaultRepositories>false</SaveDefaultRepositories>
|
||||
<AllowRepositoriesForOfflineInstaller>false</AllowRepositoriesForOfflineInstaller>
|
||||
</Installer>
|
||||
|
||||
20
qt-ifw/config/control.js
Normal file
20
qt-ifw/config/control.js
Normal file
@@ -0,0 +1,20 @@
|
||||
function Controller()
|
||||
{
|
||||
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
|
||||
if (installer.isInstaller()) {
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.prototype.IntroductionPageCallback = function()
|
||||
{
|
||||
const widget = gui.currentPageWidget();
|
||||
const radioNames = ["PackageManagerRadioButton", "UpdaterRadioButton"];
|
||||
for (const name of radioNames) {
|
||||
const el = gui.findChild(widget, name);
|
||||
if (el != null) {
|
||||
el.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
qt-ifw/config/msys2.ico
Normal file
BIN
qt-ifw/config/msys2.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -1,38 +0,0 @@
|
||||
function Component()
|
||||
{
|
||||
// constructor
|
||||
}
|
||||
|
||||
Component.prototype.isDefault = function()
|
||||
{
|
||||
// select the component by default
|
||||
return true;
|
||||
}
|
||||
|
||||
function createShortcuts()
|
||||
{
|
||||
var windir = installer.environmentVariable("WINDIR");
|
||||
if (windir === "") {
|
||||
QMessageBox["warning"]( "Error" , "Error", "Could not find windows installation directory");
|
||||
return;
|
||||
}
|
||||
|
||||
var cmdLocation = installer.value("TargetDir") + "\\msys2_shell.cmd";
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MinGW 32-bit.lnk", "-mingw32", "iconPath=@TargetDir@/mingw32.exe");
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MinGW 64-bit.lnk", "-mingw64", "iconPath=@TargetDir@/mingw64.exe");
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MSYS.lnk", "-msys", "iconPath=@TargetDir@/msys2.exe");
|
||||
|
||||
if ("@BITNESS@bit" === "32bit") {
|
||||
component.addOperation( "Execute",
|
||||
["@TargetDir@\\autorebase.bat"]);
|
||||
}
|
||||
|
||||
component.addOperation( "Execute",
|
||||
["@TargetDir@\\usr\\bin\\bash.exe", "--login", "-c", "exit"]);
|
||||
}
|
||||
|
||||
Component.prototype.createOperations = function()
|
||||
{
|
||||
component.createOperations();
|
||||
createShortcuts();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<Package>
|
||||
<DisplayName>MSYS2 @BITNESS@bit base</DisplayName>
|
||||
<Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
|
||||
<Version>@VERSION@</Version>
|
||||
<ReleaseDate>@DATE@</ReleaseDate>
|
||||
<Default>true</Default>
|
||||
<Script>installscript.js</Script>
|
||||
</Package>
|
||||
@@ -1,16 +1,69 @@
|
||||
function cancelInstaller(message)
|
||||
{
|
||||
installer.setDefaultPageVisible(QInstaller.Introduction, false);
|
||||
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
|
||||
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.PerformInstallation, false);
|
||||
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
|
||||
|
||||
var abortText = "<font color='red'>" + message +"</font>";
|
||||
installer.setValue("FinishedText", abortText);
|
||||
installer.setValue("RunProgram", null);
|
||||
}
|
||||
|
||||
function isSupported()
|
||||
{
|
||||
if (systemInfo.kernelType === "winnt") {
|
||||
var major = parseInt(systemInfo.kernelVersion.split(".", 1));
|
||||
var minor = parseInt(systemInfo.kernelVersion.split(".", 2)[1]);
|
||||
// Windows >= 8.1
|
||||
if (major > 6 || (major == 6 && minor >= 3)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function createShortcuts()
|
||||
{
|
||||
var windir = installer.environmentVariable("WINDIR");
|
||||
if (windir === "") {
|
||||
QMessageBox["warning"]( "Error" , "Error", "Could not find windows installation directory");
|
||||
return;
|
||||
}
|
||||
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/mingw32.exe", "@StartMenuDir@/MSYS2 MINGW32.lnk", "iconPath=@TargetDir@/mingw32.exe");
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/mingw64.exe", "@StartMenuDir@/MSYS2 MINGW64.lnk", "iconPath=@TargetDir@/mingw64.exe");
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/ucrt64.exe", "@StartMenuDir@/MSYS2 UCRT64.lnk", "iconPath=@TargetDir@/ucrt64.exe");
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/clang64.exe", "@StartMenuDir@/MSYS2 CLANG64.lnk", "iconPath=@TargetDir@/clang64.exe");
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/clangarm64.exe", "@StartMenuDir@/MSYS2 CLANGARM64.lnk", "iconPath=@TargetDir@/clangarm64.exe");
|
||||
component.addOperation("CreateShortcut", "@TargetDir@/msys2.exe", "@StartMenuDir@/MSYS2 MSYS.lnk", "iconPath=@TargetDir@/msys2.exe");
|
||||
|
||||
component.addOperation( "Execute",
|
||||
["@TargetDir@\\usr\\bin\\bash.exe", "--login", "-c", "exit"]);
|
||||
}
|
||||
|
||||
function Component() {
|
||||
|
||||
if (!isSupported()) {
|
||||
cancelInstaller("Installation on " + systemInfo.prettyProductName + " is not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
var systemDrive = installer.environmentVariable("SystemDrive");
|
||||
// Use C: as a default for messed up systems.
|
||||
if (systemDrive === "") {
|
||||
systemDrive = "C:";
|
||||
}
|
||||
var targetDir = installer.value("TargetDir", systemDrive+"\\msys@BITNESS@")
|
||||
var targetDir = installer.value("TargetDir", systemDrive+"\\msys64")
|
||||
|
||||
installer.setValue("TargetDir", targetDir);
|
||||
installer.setDefaultPageVisible(QInstaller.Introduction, false);
|
||||
installer.setDefaultPageVisible(QInstaller.TargetDirectory, true);
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
|
||||
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, true);
|
||||
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
|
||||
}
|
||||
|
||||
Component.prototype.createOperations = function()
|
||||
{
|
||||
component.createOperations();
|
||||
createShortcuts();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<Package>
|
||||
<DisplayName>MSYS2 @BITNESS@bit</DisplayName>
|
||||
<DisplayName>Befator Inc. MSYS2</DisplayName>
|
||||
<Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
|
||||
<Version>@VERSION@</Version>
|
||||
<ReleaseDate>@DATE@</ReleaseDate>
|
||||
<Default>true</Default>
|
||||
<Script>installscript.js</Script>
|
||||
</Package>
|
||||
|
||||
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 8.2 KiB |
Reference in New Issue
Block a user