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

lite version without vbox #14

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 21 additions & 8 deletions Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ARG GIT_REVISION
ARG VBOX_VERSION_WIN
ARG VBOX_REV_WIN
ARG MIXPANEL_TOKEN
ARG VARIANT

RUN dpkg --add-architecture i386
RUN sed -i "s/main/main contrib non-free/" /etc/apt/sources.list.d/debian.sources
Expand Down Expand Up @@ -92,18 +93,30 @@ RUN if [ $GIT_REVISION -gt 1 ]; then GIT_FILENAME="Git-$GIT_VERSION.$GIT_REVISIO
ENV VBOX_URL "https://download.virtualbox.org/virtualbox/$VBOX_VERSION_WIN"
ENV VBOX_EXE "$VBOX_URL/VirtualBox-$VBOX_VERSION_WIN-$VBOX_REV_WIN-Win.exe"

RUN curl -fsSL -o virtualbox.exe "$VBOX_EXE" \
&& echo "$(curl -fsSL "$VBOX_URL"'/SHA256SUMS' \
| awk '$2 ~ /-Win.exe$/ { print $1 }') *virtualbox.exe" \
| sha256sum -c -
RUN if [ "$VARIANT" != "-lite" ]; then \
curl -fsSL -o virtualbox.exe "$VBOX_EXE" \
&& echo "$(curl -fsSL "$VBOX_URL"'/SHA256SUMS' \
| awk '$2 ~ /-Win.exe$/ { print $1 }') *virtualbox.exe" \
| sha256sum -c -; \
fi

RUN wine virtualbox.exe -extract -silent -path . && \
rm virtualbox.exe && \
mv *.msi VirtualBox_amd64.msi
RUN if [ "$VARIANT" != "-lite" ]; then \
wine virtualbox.exe -extract -silent -path . && \
rm virtualbox.exe && \
mv *.msi VirtualBox_amd64.msi; \
fi

# Add installer resources
COPY windows /installer

WORKDIR /installer
RUN rm -rf /tmp/.wine-0/
RUN wine ../innosetup/ISCC.exe Toolbox.iss /DMyAppVersion=$INSTALLER_VERSION /DMixpanelToken=$MIXPANEL_TOKEN
RUN if [ "$VARIANT" = "-lite" ]; then \
sed -i 's|^#define MyAppName "Toolbox2docker"|#define MyAppName "Toolbox2docker'$VARIANT'"|g' Toolbox.iss; \
sed -i 's|^AppId=.*$|AppId={{5DFD8320-1E10-11EF-9E35-0800200C9A66}|g' Toolbox.iss; \
sed -i 's|^Name: vbox_ndis5;|// Name: vbox_ndis5;|g' Toolbox.iss; \
sed -i 's|^Name: "VirtualBox";|// Name: "VirtualBox";|g' Toolbox.iss; \
sed -i 's|^Source: "{#virtualBoxMsi}"|// Source: "{#virtualBoxMsi}"|g' Toolbox.iss; \
sed -i 's|Wizardform\.ComponentsList\.|// Wizardform\.ComponentsList\.|g' Toolbox.iss; \
fi && \
wine ../innosetup/ISCC.exe Toolbox.iss /DMyAppVersion=$INSTALLER_VERSION /DMixpanelToken=$MIXPANEL_TOKEN
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ The resulting installers will be in the `dist` directory.

**Do I have to install VirtualBox?**

No, you can deselect VirtualBox during installation. It is bundled in case you want to have a working environment for free.
No, there is a lite version that comes without VirtualBox.

You can also deselect VirtualBox during installation in the default installer. It is bundled in case you want to have a working environment for free.
51 changes: 29 additions & 22 deletions script/build-windows
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,32 @@
set -e

. versions
docker build \
-t windows-installer \
-f Dockerfile.windows \
--build-arg DOCKER_RELEASE_STAGE="${DOCKER_RELEASE_STAGE}" \
--build-arg INSTALLER_VERSION="${INSTALLER_VERSION}" \
--build-arg DOCKER_VERSION="${DOCKER_VERSION}" \
--build-arg DOCKER_BUILDX_VERSION="${DOCKER_BUILDX_VERSION}" \
--build-arg DOCKER_COMPOSE2_VERSION="${DOCKER_COMPOSE2_VERSION}" \
--build-arg DOCKER_MACHINE_VERSION="${DOCKER_MACHINE_VERSION}" \
--build-arg GITLAB_MACHINE_VERSION="${GITLAB_MACHINE_VERSION}" \
--build-arg T2D_MACHINE_VERSION="${T2D_MACHINE_VERSION}" \
--build-arg GIT_VERSION="${GIT_VERSION}" \
--build-arg GIT_REVISION="${GIT_REVISION}" \
--build-arg VBOX_VERSION_WIN="${VBOX_VERSION_WIN}" \
--build-arg VBOX_REV_WIN="${VBOX_REV_WIN}" \
--build-arg MIXPANEL_TOKEN="${MIXPANEL_TOKEN}" \
.
CONTAINER="$(docker create windows-installer)"
mkdir -p dist
docker cp "${CONTAINER}":/installer/Output/Toolbox2docker.exe \
dist/Toolbox2docker-${INSTALLER_VERSION}.exe
docker rm "${CONTAINER}" 2>/dev/null || true

declare -a variants=("-lite" "")

for variant in "${variants[@]}"
do
docker build \
-t windows-installer"${variant}" \
-f Dockerfile.windows \
--build-arg VARIANT="${variant}" \
--build-arg DOCKER_RELEASE_STAGE="${DOCKER_RELEASE_STAGE}" \
--build-arg INSTALLER_VERSION="${INSTALLER_VERSION}" \
--build-arg DOCKER_VERSION="${DOCKER_VERSION}" \
--build-arg DOCKER_BUILDX_VERSION="${DOCKER_BUILDX_VERSION}" \
--build-arg DOCKER_COMPOSE2_VERSION="${DOCKER_COMPOSE2_VERSION}" \
--build-arg DOCKER_MACHINE_VERSION="${DOCKER_MACHINE_VERSION}" \
--build-arg GITLAB_MACHINE_VERSION="${GITLAB_MACHINE_VERSION}" \
--build-arg T2D_MACHINE_VERSION="${T2D_MACHINE_VERSION}" \
--build-arg GIT_VERSION="${GIT_VERSION}" \
--build-arg GIT_REVISION="${GIT_REVISION}" \
--build-arg VBOX_VERSION_WIN="${VBOX_VERSION_WIN}" \
--build-arg VBOX_REV_WIN="${VBOX_REV_WIN}" \
--build-arg MIXPANEL_TOKEN="${MIXPANEL_TOKEN}" \
.
CONTAINER="$(docker create windows-installer${variant})"
mkdir -p dist
docker cp "${CONTAINER}":/installer/Output/Toolbox2docker.exe \
dist/Toolbox2docker${variant}-${INSTALLER_VERSION}.exe
docker rm "${CONTAINER}" 2>/dev/null || true
done