Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
112 lines (83 sloc) 2.95 KB
#
# 7-Zip turbo.me file
# https://github.com/turboapps/turbome/tree/master/7-zip
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
###################################
# Meta tags
###################################
meta title="7-zip"
meta namespace="7-zip"
meta name="7-zip"
###################################
# Pull dependency images
###################################
using turbo/turboscript-tools:2016.3.17
###################################
# Download and install
###################################
# Set working directory
cmd mkdir @SYSDRIVE@\Workspace
workdir @SYSDRIVE@\Workspace
# Get download urls for 7-zip
batch
echo import sys, requests, re > getUrl.py
echo headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0"} >> getUrl.py
echo r = requests.get("http://www.7-zip.org/", headers=headers, verify=False, timeout=10) >> getUrl.py
echo print([re.findall('href="(.*?\-x64.exe)"^>Download', r.text)[0], re.findall('href="([^-]*?\.exe)"^>Download', r.text)[0]]) >> getUrl.py
cmd python getUrl.py
var res = last
cmd "python -c ""print( %res% [0])"""
var urlx64="http://www.7-zip.org/" + last
cmd "python -c ""print( %res% [1])"""
var urlx86="http://www.7-zip.org/" + last
# Download and install 7-zip
batch
@ECHO Downloading 7-zip 64-bit %urlx64%...
wget.exe --no-check-certificate --quiet -O x64.exe %urlx64%
@ECHO Downloading 7-zip 32-bit %urlx86%...
wget.exe --no-check-certificate --quiet -O x86.exe %urlx86%
@ECHO Installing 7-zip 64-bit...
x64.exe /S
@ECHO Installing 7-zip 32-bit...
x86.exe /S
# Apply file Associations
batch
assoc .7z=7-Zip.7z
ftype 7-Zip.7z="C:\Program Files\7-Zip\7zFM.exe" "%%1"
assoc .zip=7-Zip.zip
ftype 7-Zip.zip="C:\Program Files\7-Zip\7zFM.exe" "%%1"
assoc .bz2=7-Zip.bz2
ftype 7-Zip.bz2="C:\Program Files\7-Zip\7zFM.exe" "%%1"
assoc .gz=7-Zip.gz
ftype 7-Zip.gz="C:\Program Files\7-Zip\7zFM.exe" "%%1"
assoc .tar=7-Zip.tar
ftype 7-Zip.tar="C:\Program Files\7-Zip\7zFM.exe" "%%1"
assoc .tgz=7-Zip.tgz
ftype 7-Zip.tgz="C:\Program Files\7-Zip\7zFM.exe" "%%1"
# Get version of 7-zip app
cmd "powershell (Get-Item (Join-Path $env:systemdrive 'Program Files\7-zip\7z.exe')).VersionInfo.FileVersion"
var tag=last
meta tag=tag
###################################
# VM Settings
###################################
enable MergeStartupDir
###################################
# Startup File
###################################
startup file ("@PROGRAMFILESX86@\7-zip\7zFM.exe")
###################################
# Environment Variables
###################################
env path="@PROGRAMFILESX86@\7-zip"
env pathext=""
###################################
# Clean up
###################################
workdir @SYSDRIVE@
batch
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "Import-Module Turbo; Remove-BuildTools"
rmdir %SYSTEMDRIVE%\Workspace /s /q
rmdir %SYSTEMDRIVE%\TurboBuildTools /s /q