Merge pull request #990 from manongjohn/build_installers
Build Installer
This commit is contained in:
commit
5785927d28
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,2 +1,3 @@
|
|||
*.lib filter=lfs diff=lfs merge=lfs -text
|
||||
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||
*.scpt filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
16
.github/workflows/macOS_build.yml
vendored
16
.github/workflows/macOS_build.yml
vendored
|
@ -7,6 +7,8 @@ jobs:
|
|||
runs-on: macos-12
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: true
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
ci-scripts/osx/tahoma-install.sh
|
||||
|
@ -59,8 +61,12 @@ jobs:
|
|||
run: bash ./ci-scripts/osx/tahoma-buildpkg.sh
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Tahoma2D-osx.dmg
|
||||
path: toonz/build/Tahoma2D-osx.dmg
|
||||
name: Tahoma2D-portable-osx.dmg
|
||||
path: toonz/build/Tahoma2D-portable-osx.dmg
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Tahoma2D-install-osx.pkg
|
||||
path: toonz/build/Tahoma2D-install-osx.pkg
|
||||
- name: Get Nightly Release Date
|
||||
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
run: |
|
||||
|
@ -84,7 +90,7 @@ jobs:
|
|||
with:
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: false
|
||||
artifacts: toonz/build/Tahoma2D-osx.dmg
|
||||
artifacts: toonz/build/Tahoma2D-portable-osx.dmg,toonz/build/Tahoma2D-install-osx.pkg
|
||||
artifactContentType: "raw"
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
name: Latest Nightly ${{ env.NIGHTLYDATE }}
|
||||
|
@ -98,13 +104,13 @@ jobs:
|
|||
with:
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: false
|
||||
artifacts: toonz/build/Tahoma2D-osx.dmg
|
||||
artifacts: toonz/build/Tahoma2D-portable-osx.dmg,toonz/build/Tahoma2D-install-osx.pkg
|
||||
artifactContentType: "raw"
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
name: ${{ env.NIGHTLYDATETIME }}
|
||||
omitBodyDuringUpdate: true
|
||||
omitNameDuringUpdate: true
|
||||
owner: tahoma2d
|
||||
owner: tahoma2d
|
||||
prerelease: true
|
||||
replacesArtifacts: true
|
||||
repo: tahoma2d_nightlies
|
||||
|
|
10
.github/workflows/windows_build.yml
vendored
10
.github/workflows/windows_build.yml
vendored
|
@ -44,8 +44,12 @@ jobs:
|
|||
cp -r toonz\build\Tahoma2D artifact
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Tahoma2D-win
|
||||
name: Tahoma2D-portable-win
|
||||
path: artifact
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Tahoma2D-install-win.exe
|
||||
path: toonz\build\Tahoma2D-install-win.exe
|
||||
- name: Get Nightly Release Date
|
||||
if: ${{ github.repository_owner == 'tahoma2d' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||
run: |
|
||||
|
@ -70,7 +74,7 @@ jobs:
|
|||
with:
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: false
|
||||
artifacts: toonz\build\Tahoma2D-win.zip
|
||||
artifacts: toonz\build\Tahoma2D-portable-win.zip,toonz\build\Tahoma2D-install-win.exe
|
||||
artifactContentType: "raw"
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
name: Latest Nightly ${{ env.NIGHTLYDATE }}
|
||||
|
@ -84,7 +88,7 @@ jobs:
|
|||
with:
|
||||
allowUpdates: true
|
||||
artifactErrorsFailBuild: false
|
||||
artifacts: toonz\build\Tahoma2D-win.zip
|
||||
artifacts: toonz\build\Tahoma2D-portable-win.zip,toonz\build\Tahoma2D-install-win.exe
|
||||
artifactContentType: "raw"
|
||||
body: ${{ github.event.head_commit.message }}
|
||||
name: ${{ env.NIGHTLYDATETIME }}
|
||||
|
|
19
ci-scripts/osx/tahoma-buildpkg.sh
Executable file → Normal file
19
ci-scripts/osx/tahoma-buildpkg.sh
Executable file → Normal file
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
export TAHOMA2DVERSION=1.3
|
||||
|
||||
if [ -d /usr/local/Cellar/qt@5 ]
|
||||
then
|
||||
export QTDIR=/usr/local/opt/qt@5
|
||||
|
@ -13,14 +15,11 @@ then
|
|||
export TOONZDIR=$TOONZDIR/Release
|
||||
fi
|
||||
|
||||
echo ">>> Copying stuff to Tahoma2D.app/tahomastuff"
|
||||
if [ -d $TOONZDIR/Tahoma2D.app/tahomastuff ]
|
||||
then
|
||||
# In case of prior builds, replace stuff folder
|
||||
rm -rf $TOONZDIR/Tahoma2D.app/tahomastuff
|
||||
fi
|
||||
cp -R stuff $TOONZDIR/Tahoma2D.app/tahomastuff
|
||||
chmod -R 777 $TOONZDIR/Tahoma2D.app/tahomastuff
|
||||
|
||||
find $TOONZDIR/Tahoma2D.app/tahomastuff -name .gitkeep -exec rm -f {} \;
|
||||
|
||||
|
@ -178,9 +177,17 @@ done
|
|||
echo ">>> Moving DYSM to Tahoma2D.app"
|
||||
mv $TOONZDIR/DSYM $TOONZDIR/Tahoma2D.app
|
||||
|
||||
echo ">>> Creating Tahoma2D-osx.dmg"
|
||||
echo ">>> Creating Tahoma2D-install-osx.pkg"
|
||||
|
||||
toonz/installer/osx/app.rb $TOONZDIR stuff toonz/installer/osx/scripts $TAHOMA2DVERSION
|
||||
|
||||
mv $TOONZDIR/Tahoma2D-install-osx.pkg $TOONZDIR/..
|
||||
|
||||
echo ">>> Creating Tahoma2D-portable-osx.dmg"
|
||||
|
||||
cp -R stuff $TOONZDIR/Tahoma2D.app/tahomastuff
|
||||
chmod -R 777 $TOONZDIR/Tahoma2D.app/tahomastuff
|
||||
|
||||
$QTDIR/bin/macdeployqt $TOONZDIR/Tahoma2D.app -dmg -verbose=0
|
||||
|
||||
mv $TOONZDIR/Tahoma2D.dmg $TOONZDIR/../Tahoma2D-osx.dmg
|
||||
|
||||
mv $TOONZDIR/Tahoma2D.dmg $TOONZDIR/../Tahoma2D-portable-osx.dmg
|
||||
|
|
|
@ -4,7 +4,7 @@ brew update
|
|||
rm -f '/usr/local/bin/2to3'
|
||||
# Remove synlink to nghttp2 in order for latest curl to install
|
||||
brew unlink nghttp2
|
||||
brew install boost qt@5 clang-format glew lz4 lzo libmypaint jpeg-turbo nasm yasm fontconfig freetype gnutls lame libass libbluray libsoxr libvorbis libvpx opencore-amr openh264 openjpeg opus rav1e sdl2 snappy speex tesseract theora webp xvid xz
|
||||
brew install boost qt@5 clang-format glew lz4 lzo libmypaint jpeg-turbo nasm yasm fontconfig freetype gnutls lame libass libbluray libsoxr libvorbis libvpx opencore-amr openh264 openjpeg opus rav1e sdl2 snappy speex tesseract theora webp xvid xz gsed
|
||||
#brew install dav1d
|
||||
brew install meson ninja
|
||||
brew install automake autoconf gettext pkg-config libtool libusb-compat gd libexif
|
|
@ -35,10 +35,18 @@ IF EXIST ..\..\thirdparty\libgphoto2\include (
|
|||
REM Remove ILK files
|
||||
del Tahoma2D\*.ilk
|
||||
|
||||
echo ">>> Copying stuff to Tahoma2D\tahomastuff"
|
||||
echo ">>> Configuring Tahoma2D.exe for deployment"
|
||||
|
||||
mkdir Tahoma2D\tahomastuff
|
||||
xcopy /Y /E ..\..\stuff Tahoma2D\tahomastuff
|
||||
REM Setup for local builds
|
||||
set QT_PATH=C:\Qt\5.9.7\msvc2019_64
|
||||
|
||||
REM These are effective when running from Actions/Appveyor
|
||||
IF EXIST D:\a\tahoma2d\tahoma2d\thirdparty\qt\5.9\msvc2019_64 set QT_PATH=D:\a\tahoma2d\tahoma2d\thirdparty\qt\5.9\msvc2019_64
|
||||
|
||||
set VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC"
|
||||
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC" set VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC"
|
||||
|
||||
%QT_PATH%\bin\windeployqt.exe Tahoma2D\Tahoma2D.exe
|
||||
|
||||
del /A- /S Tahoma2D\tahomastuff\*.gitkeep
|
||||
|
||||
|
@ -58,19 +66,28 @@ IF EXIST ..\..\thirdparty\apps\rhubarb (
|
|||
xcopy /Y /E /I ..\..\thirdparty\apps\rhubarb\res "Tahoma2D\rhubarb\res"
|
||||
)
|
||||
|
||||
echo ">>> Configuring Tahoma2D.exe for deployment"
|
||||
echo ">>> Creating Tahoma2D Windows Installer"
|
||||
IF NOT EXIST installer mkdir installer
|
||||
cd installer
|
||||
|
||||
REM Setup for local builds
|
||||
set QT_PATH=C:\Qt\5.9.7\msvc2019_64
|
||||
rmdir /S /Q program
|
||||
rmdir /S /Q stuff
|
||||
|
||||
REM These are effective when running from Actions/Appveyor
|
||||
IF EXIST D:\a\tahoma2d\tahoma2d\thirdparty\qt\5.9\msvc2019_64 set QT_PATH=D:\a\tahoma2d\tahoma2d\thirdparty\qt\5.9\msvc2019_64
|
||||
xcopy /Y /E /I ..\Tahoma2D program
|
||||
|
||||
%QT_PATH%\bin\windeployqt.exe Tahoma2D\Tahoma2D.exe
|
||||
xcopy /Y /E /I ..\..\..\stuff stuff
|
||||
|
||||
echo ">>> Creating Tahoma2D Windows package"
|
||||
python ..\..\installer\windows\filelist_python3.py %cd%
|
||||
ISCC.exe /I. /O.. ..\..\installer\windows\setup.iss
|
||||
|
||||
cd ..
|
||||
|
||||
echo ">>> Creating Tahoma2D Windows Portable package"
|
||||
|
||||
xcopy /Y /E /I ..\..\stuff Tahoma2D\tahomastuff
|
||||
|
||||
IF EXIST Tahoma2D-portable-win.zip del Tahoma2D-portable-win.zip
|
||||
7z a Tahoma2D-portable-win.zip Tahoma2D
|
||||
|
||||
IF EXIST Tahoma2D-win.zip del Tahoma2D-win.zip
|
||||
7z a Tahoma2D-win.zip Tahoma2D
|
||||
|
||||
cd ../..
|
||||
|
|
81
toonz/installer/osx/app.rb
Executable file
81
toonz/installer/osx/app.rb
Executable file
|
@ -0,0 +1,81 @@
|
|||
#!/usr/bin/env ruby
|
||||
# -*- coding: utf-8 -*-
|
||||
require 'FileUtils'
|
||||
if ARGV.size != 4 then
|
||||
puts "usage: ./app.rb [BUILD_DIR] [SRC_STUFF_DIR] [SRC_SCRIPTS_DIR] [VERSION(float)]"
|
||||
exit 1
|
||||
end
|
||||
|
||||
def exec_with_assert(cmd)
|
||||
result = `#{cmd}`
|
||||
if $? != 0 then
|
||||
puts "Execution '#{cmd}' failed."
|
||||
exit 1
|
||||
end
|
||||
puts "Execution '#{cmd}' succeed."
|
||||
end
|
||||
|
||||
# Constant group
|
||||
BUILD_DIR = ARGV[0]
|
||||
SRC_STUFF_DIR = ARGV[1]
|
||||
SRC_SCRIPTS_DIR = ARGV[2]
|
||||
VERSION = ARGV[3]
|
||||
VIRTUAL_ROOT = "#{BUILD_DIR}/VirtualRoot"
|
||||
APP_BUNDLE = "#{BUILD_DIR}/Tahoma2D.app"
|
||||
APP = "Applications"
|
||||
|
||||
PKG_ID = "io.github.tahoma2d"
|
||||
PKG_TMP = "Tahoma2DBuild.pkg"
|
||||
FINAL_PKG = "#{BUILD_DIR}/Tahoma2D-install-osx.pkg"
|
||||
|
||||
# Installation in VirtualRoot
|
||||
# Delete existing and install
|
||||
if File.exist? VIRTUAL_ROOT then
|
||||
exec_with_assert "rm -rf #{VIRTUAL_ROOT}"
|
||||
end
|
||||
exec_with_assert "mkdir -p #{VIRTUAL_ROOT}/#{APP}"
|
||||
exec_with_assert "cp -r #{APP_BUNDLE} #{VIRTUAL_ROOT}/#{APP}"
|
||||
|
||||
# Generate the plist if it doesn't exist and apply the required changes
|
||||
PKG_PLIST = "#{BUILD_DIR}/app.plist"
|
||||
unless File.exist? PKG_PLIST then
|
||||
exec_with_assert "pkgbuild --root #{VIRTUAL_ROOT} --analyze #{PKG_PLIST}"
|
||||
exec_with_assert "gsed -i -e \"14i <key>BundlePreInstallScriptPath</key>\" #{PKG_PLIST}"
|
||||
exec_with_assert "gsed -i -e \"15i <string>preinstall-script.sh</string>\" #{PKG_PLIST}"
|
||||
exec_with_assert "gsed -i -e \"14i <key>BundlePostInstallScriptPath</key>\" #{PKG_PLIST}"
|
||||
exec_with_assert "gsed -i -e \"15i <string>postinstall-script.sh</string>\" #{PKG_PLIST}"
|
||||
end
|
||||
|
||||
# Preparing stuff
|
||||
if File.exist? "#{BUILD_DIR}/scripts" then
|
||||
exec_with_assert "rm -rf #{BUILD_DIR}/scripts"
|
||||
end
|
||||
exec_with_assert "cp -r #{SRC_SCRIPTS_DIR} #{BUILD_DIR}/."
|
||||
|
||||
# Delete the existing one, tar it and put it in scripts
|
||||
if File.exist? "#{BUILD_DIR}/scripts/stuff.tar.bz2" then
|
||||
exec_with_assert "rm #{BUILD_DIR}/scripts/*.tar.bz2"
|
||||
end
|
||||
exec_with_assert "cp -r #{SRC_STUFF_DIR} #{BUILD_DIR}/stuff"
|
||||
exec_with_assert "tar cjvf #{BUILD_DIR}/scripts/stuff.tar.bz2 -C #{BUILD_DIR} stuff"
|
||||
|
||||
# Generating a pkg using a plist
|
||||
exec_with_assert "pkgbuild --root #{VIRTUAL_ROOT} --component-plist #{PKG_PLIST} --scripts #{BUILD_DIR}/scripts --identifier #{PKG_ID} --version #{VERSION} #{PKG_TMP}"
|
||||
|
||||
# Generate if distribution.xml does not exist
|
||||
DIST_XML = "#{BUILD_DIR}/distribution.xml"
|
||||
unless File.exists? DIST_XML then
|
||||
exec_with_assert "productbuild --synthesize --package #{PKG_TMP} #{DIST_XML}"
|
||||
exec_with_assert "gsed -i -e \"3i <title>Tahoma2D</title>\" #{DIST_XML}"
|
||||
end
|
||||
|
||||
# Generate final pkg
|
||||
exec_with_assert "productbuild --distribution #{DIST_XML} --package-path #{PKG_TMP} --resources . #{FINAL_PKG}"
|
||||
|
||||
# Remove temporary product
|
||||
`rm #{PKG_TMP}`
|
||||
`rm -rf #{BUILD_DIR}/stuff`
|
||||
`rm -rf #{BUILD_DIR}/scripts`
|
||||
`rm -rf #{VIRTUAL_ROOT}`
|
||||
`rm #{DIST_XML}`
|
||||
`rm #{PKG_PLIST}`
|
3
toonz/installer/osx/scripts/getStuffFolderLocation.scpt
Normal file
3
toonz/installer/osx/scripts/getStuffFolderLocation.scpt
Normal file
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3719efe7269e2dd0d3842242fbb09aab58a391d01603e898ac224012fd1607a0
|
||||
size 3476
|
24
toonz/installer/osx/scripts/postinstall-script.sh
Executable file
24
toonz/installer/osx/scripts/postinstall-script.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
INIFILE=/Applications/Tahoma2D.app/Contents/Resources/SystemVar.ini
|
||||
STUFF_DIR="/Applications/Tahoma2D/Tahoma2D_stuff"
|
||||
if [ -f tahoma2dstuffdirloc ]
|
||||
then
|
||||
STUFF_DIR=`cat tahoma2dstuffdirloc`
|
||||
fi
|
||||
|
||||
tar xzvf stuff.tar.bz2
|
||||
|
||||
if [ ! -f $STUFF_DIR ]
|
||||
then
|
||||
mkdir -p $STUFF_DIR
|
||||
fi
|
||||
|
||||
cp -rf stuff/* $STUFF_DIR/
|
||||
rm -rf stuff
|
||||
|
||||
chmod -R 777 $STUFF_DIR
|
||||
|
||||
xxx=`echo $STUFF_DIR | sed -e"s/\//|/g"`
|
||||
sed -e"s/.Applications.*Tahoma2D_stuff/$xxx/" $INIFILE | sed -e"s/|/\//g" >| temp.ini
|
||||
sudo mv -f temp.ini $INIFILE
|
||||
|
2
toonz/installer/osx/scripts/preinstall-script.sh
Executable file
2
toonz/installer/osx/scripts/preinstall-script.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
osascript getStuffFolderLocation.scpt $HOME/Documents/Tahoma2D_stuff
|
36
toonz/installer/windows/filelist_python3.py
Normal file
36
toonz/installer/windows/filelist_python3.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# list up files in program and stuff
|
||||
# for python version 3.x (converted with 2to3.py from filelist.py)
|
||||
|
||||
import os
|
||||
import codecs
|
||||
import sys
|
||||
|
||||
currentPath=""
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
currentPath=sys.argv[1] + "\\"
|
||||
|
||||
fout = codecs.open("files.iss", "w", "utf_8_sig")
|
||||
|
||||
sourceDir=currentPath + 'program'
|
||||
|
||||
for path, dirs, files in os.walk(sourceDir):
|
||||
for file in files:
|
||||
print("""Source: "%s"; DestDir: "{app}%s"; Flags: ignoreversion""" % (
|
||||
os.path.join(path, file),
|
||||
path[len(sourceDir):]), file=fout)
|
||||
|
||||
print()
|
||||
|
||||
sourceDir=currentPath + 'stuff'
|
||||
|
||||
for path, dirs, files in os.walk(sourceDir):
|
||||
for file in files:
|
||||
print("""Source: "%s"; DestDir: "{code:GetStuffDir}%s"; Flags: uninsneveruninstall; Check: IsOverwiteStuffCheckBoxChecked""" % (
|
||||
os.path.join(path, file),
|
||||
path[len(sourceDir):]), file=fout)
|
||||
print("""Source: "%s"; DestDir: "{code:GetStuffDir}%s"; Flags: onlyifdoesntexist uninsneveruninstall; Check: not IsOverwiteStuffCheckBoxChecked""" % (
|
||||
os.path.join(path, file),
|
||||
path[len(sourceDir):]), file=fout)
|
||||
|
||||
fout.close()
|
115
toonz/installer/windows/setup.iss
Normal file
115
toonz/installer/windows/setup.iss
Normal file
|
@ -0,0 +1,115 @@
|
|||
; Script generated by the Inno Setup Script Wizard.
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "Tahoma2D"
|
||||
#define MyAppVersion "1.3"
|
||||
#define MyAppPublisher "Tahoma2D"
|
||||
#define MyAppURL "https://tahoma2d.org/"
|
||||
#define MyAppExeName "Tahoma2D.exe"
|
||||
|
||||
[Setup]
|
||||
; NOTE: The value of AppId uniquely identifies this application.
|
||||
; Do not use the same AppId value in installers for other applications.
|
||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||
AppId={{0BAD1682-048C-4657-82CF-23B98C0B5F33}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
DefaultDirName={commonpf}\Tahoma2D
|
||||
DefaultGroupName=Tahoma2D
|
||||
AllowNoIcons=yes
|
||||
;LicenseFile=license.rtf
|
||||
OutputBaseFilename=Tahoma2D-install-win
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
|
||||
[Languages]
|
||||
Name: "en"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
|
||||
|
||||
[Files]
|
||||
#include "files.iss"
|
||||
|
||||
[Dirs]
|
||||
Name: "{code:GetStuffDir}\plugins"; Flags: uninsneveruninstall
|
||||
Name: "{code:GetStuffDir}\toonzfarm"; Flags: uninsneveruninstall
|
||||
Name: "{code:GetStuffDir}\projects"; Flags: uninsneveruninstall
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
|
||||
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
[Registry]
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D"; Flags: uninsdeletekeyifempty
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; Flags: uninsdeletekey
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DROOT"; ValueData: "{code:GetStuffDir}"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DPROJECTS"; ValueData: "{code:GetStuffDir}\projects"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DCONFIG"; ValueData: "{code:GetStuffDir}\config"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DPROFILES"; ValueData: "{code:GetStuffDir}\profiles"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DFXPRESETS"; ValueData: "{code:GetStuffDir}\fxs"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DLIBRARY"; ValueData: "{code:GetStuffDir}\library"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "TAHOMA2DSTUDIOPALETTE"; ValueData: "{code:GetStuffDir}\studiopalette"
|
||||
Root: HKLM; Subkey: "Software\Tahoma2D\Tahoma2D"; ValueType: string; ValueName: "FARMROOT"; ValueData: ""
|
||||
|
||||
[Dirs]
|
||||
Name: {code:GetStuffDir}; Flags: uninsneveruninstall
|
||||
|
||||
[CustomMessages]
|
||||
en.StuffDirPageTitle=Choose Destination Location for Stuff Folder
|
||||
en.StuffDirPageDescription=Select the folder where setup will install the Tahoma2D Stuff folder containing various setting files
|
||||
en.StuffDirPageLabel=Install the Tahoma2D Stuff folder to:
|
||||
en.OverwriteStuffCheckBoxLabel=Overwrite all setting files in the Stuff folder except user's personal settings
|
||||
|
||||
[Code]
|
||||
var
|
||||
StuffDirPage: TInputDirWizardPage;
|
||||
OverwriteStuffCheckBox: TNewCheckBox;
|
||||
StuffRoot: String;
|
||||
|
||||
procedure InitializeWizard;
|
||||
begin
|
||||
StuffDirPage := CreateInputDirPage(wpSelectDir,
|
||||
CustomMessage('StuffDirPageTitle'),
|
||||
CustomMessage('StuffDirPageDescription'),
|
||||
CustomMessage('StuffDirPageLabel'),
|
||||
False,
|
||||
'');
|
||||
StuffDirPage.Add('');
|
||||
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Tahoma2D\Tahoma2D', 'TAHOMA2DROOT', StuffRoot) then
|
||||
begin
|
||||
StuffDirPage.Values[0] := StuffRoot;
|
||||
end
|
||||
else
|
||||
begin
|
||||
StuffDirPage.Values[0] := 'C:\Tahoma2D stuff';
|
||||
end;
|
||||
OverwriteStuffCheckBox := TNewCheckBox.Create(StuffDirPage);
|
||||
OverwriteStuffCheckBox.Caption := CustomMessage('OverwriteStuffCheckBoxLabel');
|
||||
OverwriteStuffCheckBox.Parent := StuffDirPage.Surface;
|
||||
OverwriteStuffCheckBox.Top := ScaleY(70);
|
||||
OverwriteStuffCheckBox.Width := StuffDirPage.SurfaceWidth;
|
||||
OverwriteStuffCheckBox.Checked := True;
|
||||
|
||||
end;
|
||||
|
||||
function GetStuffDir(Param: String): String;
|
||||
begin
|
||||
Result := StuffDirPage.Values[0];
|
||||
end;
|
||||
|
||||
function IsOverwiteStuffCheckBoxChecked: Boolean;
|
||||
begin
|
||||
Result := OverwriteStuffCheckBox.Checked;
|
||||
end;
|
Loading…
Reference in a new issue