mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Move scripts into scripts/ folder.
Also updated the Travis config to use Google Test's new GitHub download location.
This commit is contained in:
@@ -0,0 +1,199 @@
|
||||
#! /usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Creates an archive of a LOOT release, putting it in the 'build' folder.
|
||||
|
||||
# LOOT
|
||||
#
|
||||
# A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
|
||||
# Fallout: New Vegas.
|
||||
#
|
||||
# Copyright (C) 2013-2015 WrinklyNinja
|
||||
#
|
||||
# This file is part of LOOT.
|
||||
#
|
||||
# LOOT is free software: you can redistribute
|
||||
# it and/or modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation, either version 3 of
|
||||
# the License, or (at your option) any later version.
|
||||
#
|
||||
# LOOT is distributed in the hope that it will
|
||||
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LOOT. If not, see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
import zipfile
|
||||
import subprocess
|
||||
|
||||
# There are two compression methods available:
|
||||
#
|
||||
# * Zip (Deflate)
|
||||
# * 7-Zip (LZMA)
|
||||
#
|
||||
# Python 3.3+ can also do BZIP2 and LZMA zip archives, but they don't have good
|
||||
# Windows OS support, so people think they should be able to open them without
|
||||
# an archiving utility, find they can't, and think the archive is broken. So
|
||||
# they won't be used.
|
||||
#
|
||||
# Look for 7-Zip in its default install location, and use it if it is found.
|
||||
# Fall back to zip if not.
|
||||
#
|
||||
# Archives are named using the output of `git describe --tags --long`, if Git
|
||||
# is found in the current PATH. Otherwise, they will simply be named
|
||||
# 'LOOT Archive'.
|
||||
#
|
||||
# The current path throughout the script is the `src` folder, where this script
|
||||
# is located.
|
||||
|
||||
# Find an executable's path from its name. Like Python 3.3's shutil.which, but
|
||||
# also checks likely paths for hardcoded programs.
|
||||
def which(cmd):
|
||||
if 'which' in dir(shutil):
|
||||
exe_path = shutil.which(cmd)
|
||||
else:
|
||||
# Check the PATH environmental variable manually.
|
||||
exe_path = None
|
||||
path = os.getenv('PATH')
|
||||
for p in path.split(os.path.pathsep):
|
||||
p = os.path.join(p, cmd)
|
||||
if os.path.exists(p) and os.access(p, os.X_OK):
|
||||
exe_path = p
|
||||
|
||||
if not exe_path:
|
||||
if cmd == '7z.exe':
|
||||
sevenzip_path = os.path.join('C:\\', 'Program Files', '7-Zip', '7z.exe')
|
||||
if os.path.exists(sevenzip_path):
|
||||
exe_path = sevenzip_path
|
||||
elif cmd == 'vulcanize.cmd':
|
||||
npm = os.path.join( os.getenv('APPDATA'), 'npm' )
|
||||
if (os.path.exists(npm, 'vulcanize.cmd')):
|
||||
exe_path = os.path.join(npm, 'vulcanize.cmd')
|
||||
|
||||
return exe_path
|
||||
|
||||
def getNameSuffix():
|
||||
# Check for a Git install, and get the revision info if found.
|
||||
git = which('git.exe')
|
||||
if git:
|
||||
args = [git, 'describe', '--tags', '--long']
|
||||
output = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||
if len(output[1]) == 0:
|
||||
return output[0].decode('ascii')[:-1]
|
||||
|
||||
return ''
|
||||
|
||||
def buildUIFiles():
|
||||
# Vulcanize the UI's files.
|
||||
vulcanize = which('vulcanize.cmd')
|
||||
dest_path = os.path.join('..', 'build', 'Release', 'resources', 'ui')
|
||||
args = [
|
||||
vulcanize,
|
||||
'--inline',
|
||||
'--strip',
|
||||
'--config',
|
||||
os.path.join('vulcanize.config.json'),
|
||||
'-o',
|
||||
os.path.join(dest_path, 'index.html'),
|
||||
os.path.join('..', 'src', 'gui', 'html', 'index.html')];
|
||||
if not os.path.exists(dest_path):
|
||||
os.makedirs(dest_path)
|
||||
subprocess.call(args);
|
||||
|
||||
def createArchive(folder_path, archive_path):
|
||||
sevenzip_path = os.path.join('C:\\', 'Program Files', '7-Zip', '7z.exe')
|
||||
if os.path.exists(sevenzip_path):
|
||||
args = [sevenzip_path, 'a', '-r', archive_path + '.7z', os.path.join(folder_path, '*')]
|
||||
subprocess.call(args)
|
||||
else:
|
||||
zip = zipfile.ZipFile( archive_path + '.zip', 'w', zipfile.ZIP_DEFLATED )
|
||||
for root, dirs, files in os.walk(folder_path):
|
||||
for file in files:
|
||||
zip.write(os.path.join(root, file))
|
||||
zip.close()
|
||||
|
||||
def createAppArchive(archive_path):
|
||||
temp_path = os.path.join('..', 'build', 'archive.tmp')
|
||||
|
||||
# Delete the temporary folder if it already exists, then create it.
|
||||
if os.path.exists(temp_path):
|
||||
shutil.rmtree(temp_path)
|
||||
os.makedirs(temp_path)
|
||||
|
||||
# Now copy everything into the temporary folder.
|
||||
# LOOT executable and CEF files.
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'LOOT.exe'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'd3dcompiler_47.dll'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'libEGL.dll'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'libGLESv2.dll'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'libcef.dll'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'wow_helper.exe'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'natives_blob.bin'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'snapshot_blob.bin'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'cef.pak'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'cef_100_percent.pak'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'cef_200_percent.pak'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'devtools_resources.pak'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'icudtl.dat'), temp_path )
|
||||
|
||||
# Translation files.
|
||||
os.makedirs(os.path.join(temp_path, 'resources', 'l10n'))
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'resources', 'l10n', 'en-US.pak'), os.path.join(temp_path, 'resources', 'l10n') )
|
||||
for lang in ['es', 'ru', 'fr', 'zh_CN', 'pl', 'pt_BR', 'fi', 'de', 'da', 'ko']:
|
||||
os.makedirs(os.path.join(temp_path, 'resources', 'l10n', lang, 'LC_MESSAGES'))
|
||||
shutil.copy( os.path.join('..', 'resources', 'l10n', lang, 'LC_MESSAGES', 'loot.mo'), os.path.join(temp_path, 'resources', 'l10n', lang, 'LC_MESSAGES') )
|
||||
|
||||
# UI files.
|
||||
os.makedirs( os.path.join(temp_path, 'resources', 'ui', 'css') )
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'resources', 'ui', 'index.html'), os.path.join(temp_path, 'resources', 'ui') )
|
||||
shutil.copy( os.path.join('..', 'resources', 'ui', 'css', 'dark-theme.css'), os.path.join(temp_path, 'resources', 'ui', 'css') )
|
||||
shutil.copytree( os.path.join('..', 'resources', 'ui', 'fonts'), os.path.join(temp_path, 'resources', 'ui', 'fonts') )
|
||||
|
||||
# Docs.
|
||||
shutil.copytree( os.path.join('..', 'docs', 'images'), os.path.join(temp_path, 'docs', 'images') )
|
||||
shutil.copytree( os.path.join('..', 'docs', 'licenses'), os.path.join(temp_path, 'docs', 'licenses') )
|
||||
shutil.copy( os.path.join('..', 'docs', 'LOOT Metadata Syntax.html'), os.path.join(temp_path, 'docs') )
|
||||
shutil.copy( os.path.join('..', 'docs', 'LOOT Readme.html'), os.path.join(temp_path, 'docs') )
|
||||
|
||||
# Now compress the temporary folder.
|
||||
createArchive(temp_path, archive_path);
|
||||
|
||||
# And finally, delete the temporary folder.
|
||||
shutil.rmtree(temp_path)
|
||||
|
||||
def createApiArchive(archive_path):
|
||||
temp_path = os.path.join('..', 'build', 'archive.tmp')
|
||||
|
||||
# Delete the temporary folder if it already exists, then create it.
|
||||
if os.path.exists(temp_path):
|
||||
shutil.rmtree(temp_path)
|
||||
os.makedirs(temp_path)
|
||||
|
||||
# Create directories in temporary folder.
|
||||
os.makedirs( os.path.join(temp_path, 'include', 'loot') )
|
||||
os.makedirs( os.path.join(temp_path, 'docs') )
|
||||
|
||||
# Now copy everything into the temporary folder.
|
||||
shutil.copy( os.path.join('..', 'build', 'Release', 'loot32.dll'), temp_path )
|
||||
shutil.copy( os.path.join('..', 'src', 'api', 'api.h'), os.path.join(temp_path, 'include', 'loot') )
|
||||
shutil.copy( os.path.join('..', 'docs', 'latex', 'refman.pdf'), os.path.join(temp_path, 'docs', 'readme.pdf') )
|
||||
|
||||
shutil.copytree( os.path.join('..', 'docs', 'licenses'), os.path.join(temp_path, 'docs', 'licenses') )
|
||||
|
||||
# Now compress the temporary folder.
|
||||
createArchive(temp_path, archive_path);
|
||||
|
||||
# And finally, delete the temporary folder.
|
||||
shutil.rmtree(temp_path)
|
||||
|
||||
# Create the archives.
|
||||
archive_suffix = getNameSuffix()
|
||||
buildUIFiles();
|
||||
createAppArchive( os.path.join('..', 'build', 'LOOT ' + archive_suffix) )
|
||||
createApiArchive( os.path.join('..', 'build', 'LOOT API ' + archive_suffix) )
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -ev
|
||||
|
||||
# Currently inside the cloned repo path.
|
||||
# Get the 3rd-party CMake modules.
|
||||
wget -P build https://raw.githubusercontent.com/rpavlik/cmake-modules/master/GetGitRevisionDescription.cmake
|
||||
wget -P build https://raw.githubusercontent.com/rpavlik/cmake-modules/master/GetGitRevisionDescription.cmake.in
|
||||
cd ../..
|
||||
|
||||
# Install libespm.
|
||||
wget https://github.com/WrinklyNinja/libespm/archive/master.tar.gz -O - | tar -xz
|
||||
mv libespm-master libespm
|
||||
|
||||
# Build yaml-cpp
|
||||
wget https://github.com/WrinklyNinja/yaml-cpp/archive/patched-for-loot.tar.gz -O - | tar -xz
|
||||
mv yaml-cpp-patched-for-loot yaml-cpp
|
||||
mkdir yaml-cpp/build && cd yaml-cpp/build
|
||||
cmake ..
|
||||
make yaml-cpp
|
||||
cd ../..
|
||||
|
||||
# Build libgit2
|
||||
wget https://github.com/libgit2/libgit2/archive/v0.23.1.tar.gz -O - | tar -xz
|
||||
mv libgit2-0.23.1 libgit2
|
||||
mkdir libgit2/build && cd libgit2/build
|
||||
cmake .. -DBUILD_SHARED_LIBS=OFF
|
||||
make git2
|
||||
cd ../..
|
||||
|
||||
# Build libloadorder
|
||||
wget https://github.com/WrinklyNinja/libloadorder/archive/master.tar.gz -O - | tar -xz
|
||||
mv libloadorder-master libloadorder
|
||||
mkdir libloadorder/build && cd libloadorder/build
|
||||
cmake .. -DPROJECT_ARCH=64 -DPROJECT_STATIC_RUNTIME=OFF -DBUILD_SHARED_LIBS=OFF -DGTEST_ROOT=../gtest-1.7.0
|
||||
make loadorder64
|
||||
cd ../..
|
||||
|
||||
# Install pseudosem
|
||||
wget https://github.com/WrinklyNinja/pseudosem/archive/1.0.1.tar.gz -O - | tar -xz
|
||||
mv pseudosem-1.0.1 pseudosem
|
||||
@@ -0,0 +1,254 @@
|
||||
; LOOT installer Inno Setup script.
|
||||
; This file must be encoded in UTF-8 WITH a BOM for Unicode text to
|
||||
; be displayed correctly.
|
||||
|
||||
#define MyAppName "LOOT"
|
||||
#define MyAppVersion "0.8.0"
|
||||
#define MyAppPublisher "LOOT Team"
|
||||
#define MyAppURL "http://loot.github.io"
|
||||
#define MyAppExeName "LOOT.exe"
|
||||
|
||||
#if FileExists(AddBackslash(CompilerPath) + 'Languages\Korean.isl')
|
||||
#define KoreanExists
|
||||
#endif
|
||||
|
||||
#if FileExists(AddBackslash(CompilerPath) + 'Languages\ChineseSimplified.isl')
|
||||
#define SimplifiedChineseExists
|
||||
#endif
|
||||
|
||||
[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={{BF634210-A0D4-443F-A657-0DCE38040374}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
AppCopyright=Copyright (C) 2009-2015 {#MyAppPublisher}
|
||||
DefaultDirName={pf}\{#MyAppName}
|
||||
DefaultGroupName={#MyAppName}
|
||||
AllowNoIcons=yes
|
||||
SourceDir=..\
|
||||
OutputBaseFilename=LOOT Installer
|
||||
OutputDir=build
|
||||
SetupIconFile=resources\icon.ico
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
DisableReadyPage=yes
|
||||
|
||||
[Languages]
|
||||
Name: "en"; MessagesFile: "compiler:Default.isl"
|
||||
Name: "pt_BR"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
|
||||
Name: "da"; MessagesFile: "compiler:Languages\Danish.isl"
|
||||
Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl"
|
||||
Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
|
||||
Name: "de"; MessagesFile: "compiler:Languages\German.isl"
|
||||
#ifdef KoreanExists
|
||||
Name: "ko"; MessagesFile: "compiler:Languages\Korean.isl"
|
||||
#endif
|
||||
Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl"
|
||||
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
|
||||
#ifdef SimplifiedChineseExists
|
||||
Name: "zh_CN"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
||||
#endif
|
||||
Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "build\Release\LOOT.exe"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\cef.pak"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\cef_100_percent.pak"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\cef_200_percent.pak"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\d3dcompiler_47.dll"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\devtools_resources.pak"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\icudtl.dat"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\libcef.dll"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\libEGL.dll"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\libGLESv2.dll"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\wow_helper.exe"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\natives_blob.bin"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\snapshot_blob.bin"; \
|
||||
DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "build\Release\resources\l10n\en-US.pak"; \
|
||||
DestDir: "{app}\resources\l10n"; Flags: ignoreversion
|
||||
|
||||
Source: "docs\LOOT Metadata Syntax.html"; \
|
||||
DestDir: "{app}\docs"; Flags: ignoreversion
|
||||
Source: "docs\LOOT Readme.html"; \
|
||||
DestDir: "{app}\docs"; Flags: ignoreversion isreadme
|
||||
Source: "docs\licenses\*"; \
|
||||
DestDir: "{app}\docs\licenses"; Flags: ignoreversion
|
||||
Source: "docs\images\main.png"; \
|
||||
DestDir: "{app}\docs\images"; Flags: ignoreversion
|
||||
Source: "docs\images\settings.png"; \
|
||||
DestDir: "{app}\docs\images"; Flags: ignoreversion
|
||||
|
||||
Source: "build\Release\resources\ui\index.html"; \
|
||||
DestDir: "{app}\resources\ui"; Flags: ignoreversion
|
||||
Source: "resources\ui\css\dark-theme.css"; \
|
||||
DestDir: "{app}\resources\ui\css"; Flags: ignoreversion
|
||||
Source: "resources\ui\fonts\*"; \
|
||||
DestDir: "{app}\resources\ui\fonts"; Flags: ignoreversion
|
||||
|
||||
Source: "resources\l10n\da\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\da\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\de\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\de\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\es\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\es\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\fi\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\fi\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\fr\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\fr\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\ko\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\ko\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\pl\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\pl\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\pt_BR\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\pt_BR\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\ru\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\ru\LC_MESSAGES"; Flags: ignoreversion
|
||||
Source: "resources\l10n\zh_CN\LC_MESSAGES\loot.mo"; \
|
||||
DestDir: "{app}\resources\l10n\zh_CN\LC_MESSAGES"; Flags: ignoreversion
|
||||
|
||||
Source: "resources\settings.yaml"; \
|
||||
DestDir: "{localappdata}\{#MyAppName}"; Flags: onlyifdoesntexist uninsneveruninstall; AfterInstall: SetLOOTLanguage
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[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]
|
||||
; Store install path for backwards-compatibility with old NSIS install script behaviour.
|
||||
Root: HKLM; Subkey: "Software\LOOT"; ValueType: string; ValueName: "Installed Path"; ValueData: "{app}"; Flags: deletekey uninsdeletekey
|
||||
|
||||
[UninstallDelete]
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\";
|
||||
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Oblivion\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Skyrim\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\Fallout3\masterlist.yaml";
|
||||
Type: files; Name: "{localappdata}\{#MyAppName}\FalloutNV\masterlist.yaml";
|
||||
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Oblivion\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Skyrim\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\Fallout3\.git";
|
||||
Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\FalloutNV\.git";
|
||||
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Oblivion";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Skyrim";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\Fallout3";
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}\FalloutNV";
|
||||
|
||||
Type: dirifempty; Name: "{localappdata}\{#MyAppName}";
|
||||
|
||||
[CustomMessages]
|
||||
en.DeleteUserFiles=Do you want to delete your settings and user metadata?
|
||||
;pt_BR.DeleteUserFiles=
|
||||
da.DeleteUserFiles=Ønsker du at slette dine indstillinger og bruger metadata?
|
||||
fi.DeleteUserFiles=Haluatko poistaa asetukset ja käyttäjä metatiedot?
|
||||
fr.DeleteUserFiles=Voulez-vous supprimer vos paramètres et les métadonnées de l'utilisateur?
|
||||
de.DeleteUserFiles=Möchten Sie Ihre Einstellungen und Benutzer-Metadaten löschen?
|
||||
#ifdef KoreanExists
|
||||
ko.DeleteUserFiles=당신은 당신의 설정과 사용자 메타 데이터를 삭제 하시겠습니까?
|
||||
#endif
|
||||
pl.DeleteUserFiles=Czy chcesz usunąć ustawienia i metadane użytkownika?
|
||||
ru.DeleteUserFiles=Вы хотите удалить ваши настройки и метаданные пользователя?
|
||||
#ifdef SimplifiedChineseExists
|
||||
zh_CN.DeleteUserFiles=你想要删除你的设置和用户数据吗?
|
||||
#endif
|
||||
es.DeleteUserFiles=¿Quieres borrar sus ajustes y metadatos de usuario?
|
||||
|
||||
[Code]
|
||||
// Set LOOT's language in settings.yaml
|
||||
procedure SetLOOTLanguage();
|
||||
var
|
||||
SearchLineStart: String;
|
||||
ReplaceLine: String;
|
||||
Lines: TArrayOfString;
|
||||
I: Integer;
|
||||
begin
|
||||
if ActiveLanguage = 'en' then
|
||||
exit;
|
||||
|
||||
SearchLineStart := 'language:';
|
||||
ReplaceLine := 'language: ' + ActiveLanguage;
|
||||
|
||||
if LoadStringsFromFile(ExpandConstant(CurrentFileName), Lines) = True then begin
|
||||
for I := 0 to GetArrayLength(Lines) - 1 do begin
|
||||
if Copy(Lines[I], 0, Length(SearchLineStart)) = SearchLineStart then begin
|
||||
Lines[I] := ReplaceLine;
|
||||
SaveStringsToUTF8File(ExpandConstant(CurrentFileName), Lines, False)
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// Query user whether their data files should be deleted on uninstall.
|
||||
procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
|
||||
begin
|
||||
// Don't remove user data if the uninstall is silent.
|
||||
if UninstallSilent then
|
||||
exit;
|
||||
if CurUninstallStep = usUninstall then begin
|
||||
if MsgBox(CustomMessage('DeleteUserFiles'), mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDYES
|
||||
then begin
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\LOOTDebugLog.txt'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\CEFDebugLog.txt'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\settings.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Oblivion\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Skyrim\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\Fallout3\userlist.yaml'));
|
||||
DeleteFile(ExpandConstant('{localappdata}\{#MyAppName}\FalloutNV\userlist.yaml'));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
// Run a previous install's uninstaller before starting this installation.
|
||||
procedure CurStepChanged(CurStep: TSetupStep);
|
||||
var
|
||||
RegKey: String;
|
||||
RegValue: String;
|
||||
ResultCode: Integer;
|
||||
begin
|
||||
if CurStep = ssInstall then begin
|
||||
// First try using the Inno Setup installer's uninstall Registry key to get
|
||||
// the uninstaller's path. This is necessary instead of just using the
|
||||
// backwards-compatible key because the filename of the uninstaller created
|
||||
// by Inno Setup can vary.
|
||||
RegKey := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
|
||||
if RegQueryStringValue(HKLM, RegKey, 'UninstallString', RegValue) then begin
|
||||
Exec(RemoveQuotes(RegValue), '/VERYSILENT', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||
// Now try using the backwards-compatible Registry key, and run the NSIS
|
||||
// uninstaller, which has a fixed filename.
|
||||
end
|
||||
else begin
|
||||
if RegQueryStringValue(HKLM, 'Software\LOOT', 'Installed Path', RegValue) then begin
|
||||
Exec(RegValue + '\Uninstall.exe', '/S', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"excludes": {
|
||||
"styles": [ "css/theme.css" ]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user