Compare commits
62 Commits
2022-01-18
...
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 |
@@ -1,13 +0,0 @@
|
||||
FROM mcr.microsoft.com/windows/servercore:ltsc2019
|
||||
|
||||
COPY ./msys2-base-x86_64-latest.sfx.exe /msys2.exe
|
||||
|
||||
RUN powershell -Command \
|
||||
$ErrorActionPreference = 'Stop'; \
|
||||
$ProgressPreference = 'SilentlyContinue'; \
|
||||
/msys2.exe -y -oC:\; \
|
||||
function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } \
|
||||
msys ' '; \
|
||||
msys 'pacman --noconfirm -Syuu'; \
|
||||
msys 'pacman --noconfirm -Syuu'; \
|
||||
msys 'pacman --noconfirm -Scc';
|
||||
@@ -1,13 +0,0 @@
|
||||
FROM mcr.microsoft.com/windows/servercore:ltsc2022
|
||||
|
||||
COPY ./msys2-base-x86_64-latest.sfx.exe /msys2.exe
|
||||
|
||||
RUN powershell -Command \
|
||||
$ErrorActionPreference = 'Stop'; \
|
||||
$ProgressPreference = 'SilentlyContinue'; \
|
||||
/msys2.exe -y -oC:\; \
|
||||
function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } \
|
||||
msys ' '; \
|
||||
msys 'pacman --noconfirm -Syuu'; \
|
||||
msys 'pacman --noconfirm -Syuu'; \
|
||||
msys 'pacman --noconfirm -Scc';
|
||||
131
.github/workflows/build.yml
vendored
131
.github/workflows/build.yml
vendored
@@ -1,131 +0,0 @@
|
||||
name: 'build'
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 3 * * *'
|
||||
|
||||
concurrency: nope
|
||||
|
||||
jobs:
|
||||
build-installer:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: setup-msys2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MSYS
|
||||
update: true
|
||||
install: p7zip tar mingw-w64-x86_64-qt-installer-framework
|
||||
|
||||
- name: Switch to the main mirror
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
echo 'Server = https://repo.msys2.org/mingw/$repo/' > /etc/pacman.d/mirrorlist.mingw
|
||||
echo 'Server = https://repo.msys2.org/msys/$arch/' > /etc/pacman.d/mirrorlist.msys
|
||||
pacman-conf.exe
|
||||
|
||||
- name: Update using the main mirror & Check install
|
||||
run: |
|
||||
msys2 -c 'pacman --noconfirm -Suuy'
|
||||
msys2 -c 'pacman --noconfirm -Suu'
|
||||
msys2 -c 'pacman -Qkq'
|
||||
|
||||
- name: Build Installer
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
bash make-msys2-installer
|
||||
|
||||
- name: Create 'latest' Variants and Checksums
|
||||
run: |
|
||||
mv msys2-base-x86_64-[0-9]*.sfx.exe msys2-base-x86_64-latest.sfx.exe
|
||||
mv msys2-x86_64-[0-9]*.exe msys2-x86_64-latest.exe
|
||||
mv msys2-*.tar.xz msys2-base-x86_64-latest.tar.xz
|
||||
sha256sum.exe msys2-*
|
||||
sha256sum.exe msys2-* > msys2-checksums.txt
|
||||
|
||||
- name: Upload Results
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: installer
|
||||
path: msys2-*
|
||||
|
||||
test-installer:
|
||||
name: windows-${{ matrix.image }}
|
||||
runs-on: windows-${{ matrix.image }}
|
||||
needs: build-installer
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [2019, 2022]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: installer
|
||||
|
||||
- name: Install
|
||||
run: |
|
||||
./msys2-x86_64-latest.exe in --confirm-command --accept-messages --root C:/msys2-install-test
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman --version"
|
||||
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman -Qkv"
|
||||
C:\msys2-install-test\usr\bin\bash.exe -lc "pacman -Syy"
|
||||
|
||||
- name: Uninstall
|
||||
run: |
|
||||
C:\msys2-install-test\uninstall.exe pr --confirm-command
|
||||
|
||||
test-docker-sfx:
|
||||
name: ltsc-${{ matrix.image }}
|
||||
runs-on: windows-${{ matrix.image }}
|
||||
needs: build-installer
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [2019, 2022]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: installer
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t msys2-base -f ./.ci/Dockerfile.${{ matrix.image }} .
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
docker run msys2-base C:\msys64\usr\bin\bash.exe -lc "pacman --version"
|
||||
docker run msys2-base C:\msys64\usr\bin\bash.exe -lc "pacman -Qkv"
|
||||
docker run msys2-base C:\msys64\usr\bin\bash.exe -lc "pacman -Syy"
|
||||
|
||||
upload-nightly:
|
||||
permissions:
|
||||
contents: write
|
||||
needs:
|
||||
- test-docker-sfx
|
||||
- test-installer
|
||||
if: github.ref == 'refs/heads/master'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: installer
|
||||
|
||||
- name: Upload Installers
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload nightly-x86_64 msys2-* --clobber -R ${{ github.repository }}
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +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
|
||||
25
README.md
25
README.md
@@ -1,9 +1,5 @@
|
||||
# MSYS2 Installer
|
||||
|
||||
## Nightly build
|
||||
|
||||
https://github.com/msys2/msys2-installer/releases/tag/nightly-x86_64
|
||||
|
||||

|
||||
|
||||
## CLI Usage examples
|
||||
@@ -26,19 +22,14 @@ Installing the self extracting archive to `C:\msys64`:
|
||||
.\msys2-base-x86_64-latest.sfx.exe -y -oC:\
|
||||
```
|
||||
|
||||
## Build Instructions
|
||||
## FAQ
|
||||
|
||||
```bash
|
||||
# Run in a MSYS2 environment
|
||||
./make-msys2-installer
|
||||
```
|
||||
### What's the difference between the installer and the archives?
|
||||
|
||||
## New Release TODO List
|
||||
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.
|
||||
|
||||
* 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
|
||||
* 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
|
||||
* Update the download link and checksum for the GiHub action: https://github.com/msys2/setup-msys2/blob/master/main.js
|
||||
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 InstallDir="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("InstallDir")
|
||||
|
||||
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()
|
||||
{
|
||||
if (!install_dir) {
|
||||
install_dir = "C:/MSYS64"
|
||||
}
|
||||
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 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 )
|
||||
}
|
||||
*/
|
||||
17
create-sfx.sh
Normal file → Executable file
17
create-sfx.sh
Normal file → Executable file
@@ -3,21 +3,28 @@
|
||||
|
||||
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="7z21.03-zstd-x64"
|
||||
CHECKSUM="531b20dfb03d8f30f61ae56a181610bbb6f3cf7cc71dac1d8f95511289de76f3"
|
||||
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/v21.03-v1.5.0-R2/$NAME.exe" -o "$BASE.exe"
|
||||
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
|
||||
|
||||
# Creat SFX installer
|
||||
# Create SFX installer
|
||||
INPUT="$1"
|
||||
OUTPUT="$2"
|
||||
TEMP="$OUTPUT.payload"
|
||||
@@ -25,4 +32,4 @@ TEMP="$OUTPUT.payload"
|
||||
rm -f "$TEMP"
|
||||
"$BASE/7z" a "$TEMP" -ms1T -m0=zstd -mx22 "$INPUT"
|
||||
cat "$BASE/7zCon.sfx" "$TEMP" > "$OUTPUT"
|
||||
rm "$TEMP"
|
||||
rm "$TEMP"
|
||||
@@ -1,147 +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
|
||||
export XZ_OPT="-e9T0"
|
||||
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
|
||||
"${_thisdir}/create-sfx.sh" "msys${_bitness}" "${_thisdir}/${_filename3}"
|
||||
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}
|
||||
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,18 +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>
|
||||
<Title>MSYS2</Title>
|
||||
<Publisher>Befator Inc.</Publisher>
|
||||
<ControlScript>control.js</ControlScript>
|
||||
<StartMenuDir>MSYS2 @BITNESS@bit</StartMenuDir>
|
||||
<RunProgram>@TargetDir@/msys2_shell.cmd</RunProgram>
|
||||
<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>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
function Controller()
|
||||
{
|
||||
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
|
||||
if (installer.isInstaller()) {
|
||||
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
|
||||
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
|
||||
}
|
||||
}
|
||||
|
||||
Controller.prototype.IntroductionPageCallback = function()
|
||||
|
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
@@ -1,40 +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 x86.lnk", "-mingw32", "iconPath=@TargetDir@/mingw32.exe");
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MinGW x64.lnk", "-mingw64", "iconPath=@TargetDir@/mingw64.exe");
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MinGW UCRT x64.lnk", "-ucrt64", "iconPath=@TargetDir@/ucrt64.exe");
|
||||
component.addOperation("CreateShortcut", cmdLocation, "@StartMenuDir@/MSYS2 MinGW Clang x64.lnk", "-clang64", "iconPath=@TargetDir@/clang64.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>
|
||||
|
||||
Reference in New Issue
Block a user