Setup: various small adjustments and fixes
This commit is contained in:
parent
eda8c6f263
commit
4b38cb4c2e
2
Utils.py
2
Utils.py
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
|
|
||||||
def tuplize_version(version: str) -> typing.Tuple[int, ...]:
|
def tuplize_version(version: str) -> Version:
|
||||||
return Version(*(int(piece, 10) for piece in version.split(".")))
|
return Version(*(int(piece, 10) for piece in version.split(".")))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,25 @@
|
||||||
#define sourcepath "build\exe.win-amd64-3.8\"
|
#define sourcepath "build\exe.win-amd64-3.8"
|
||||||
#define MyAppName "Archipelago"
|
#define MyAppName "Archipelago"
|
||||||
#define MyAppExeName "ArchipelagoServer.exe"
|
#define MyAppExeName "ArchipelagoServer.exe"
|
||||||
#define MyAppIcon "data/icon.ico"
|
#define MyAppIcon "data/icon.ico"
|
||||||
|
#dim VersionTuple[4]
|
||||||
|
#define MyAppVersion ParseVersion('build\exe.win-amd64-3.8\ArchipelagoServer.exe', VersionTuple[0], VersionTuple[1], VersionTuple[2], VersionTuple[3])
|
||||||
|
#define MyAppVersionText Str(VersionTuple[0])+"."+Str(VersionTuple[1])+"."+Str(VersionTuple[2])
|
||||||
|
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
; NOTE: The value of AppId uniquely identifies this application.
|
; NOTE: The value of AppId uniquely identifies this application.
|
||||||
; Do not use the same AppId value in installers for other applications.
|
; Do not use the same AppId value in installers for other applications.
|
||||||
AppId={{918BA46A-FAB8-460C-9DFF-AE691E1C865B}}
|
AppId={{918BA46A-FAB8-460C-9DFF-AE691E1C865B}}
|
||||||
AppName={#MyAppName}
|
AppName={#MyAppName}
|
||||||
AppVerName={#MyAppName}
|
AppCopyright=Distributed under MIT License
|
||||||
|
AppVerName={#MyAppName} {#MyAppVersionText}
|
||||||
|
VersionInfoVersion={#MyAppVersion}
|
||||||
DefaultDirName={commonappdata}\{#MyAppName}
|
DefaultDirName={commonappdata}\{#MyAppName}
|
||||||
DisableProgramGroupPage=yes
|
DisableProgramGroupPage=yes
|
||||||
DefaultGroupName=Archipelago
|
DefaultGroupName=Archipelago
|
||||||
OutputDir=setups
|
OutputDir=setups
|
||||||
OutputBaseFilename=Setup {#MyAppName}
|
OutputBaseFilename=Setup {#MyAppName} {#MyAppVersionText}
|
||||||
Compression=lzma2
|
Compression=lzma2
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
LZMANumBlockThreads=8
|
LZMANumBlockThreads=8
|
||||||
|
@ -27,6 +33,7 @@ SignTool= signtool
|
||||||
LicenseFile= LICENSE
|
LicenseFile= LICENSE
|
||||||
WizardStyle= modern
|
WizardStyle= modern
|
||||||
SetupLogging=yes
|
SetupLogging=yes
|
||||||
|
ShowComponentSizes=no
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
@ -52,8 +59,8 @@ Name: "client/factorio"; Description: "Factorio"; Types: full playing
|
||||||
NAME: "{app}"; Flags: setntfscompression; Permissions: everyone-modify users-modify authusers-modify;
|
NAME: "{app}"; Flags: setntfscompression; Permissions: everyone-modify users-modify authusers-modify;
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: "{code:GetROMPath}"; DestDir: "{app}"; DestName: "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc"; Flags: external; Components: client/lttp or server
|
Source: "{code:GetROMPath}"; DestDir: "{app}"; DestName: "Zelda no Densetsu - Kamigami no Triforce (Japan).sfc"; Flags: external; Components: client/lttp or generator
|
||||||
Source: "{#sourcepath}*"; Excludes: "*.sfc, *.log, data\sprites\alttpr, SNI, EnemizerCLI, *exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: "{#sourcepath}\*"; Excludes: "*.sfc, *.log, data\sprites\alttpr, SNI, EnemizerCLI, *exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: "{#sourcepath}\SNI"; Excludes: "*.sfc, *.log"; DestDir: "{app}\SNI"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: client/lttp
|
Source: "{#sourcepath}\SNI"; Excludes: "*.sfc, *.log"; DestDir: "{app}\SNI"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: client/lttp
|
||||||
Source: "{#sourcepath}\EnemizerCLI"; Excludes: "*.sfc, *.log"; DestDir: "{app}\EnemizerCLI"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: generator
|
Source: "{#sourcepath}\EnemizerCLI"; Excludes: "*.sfc, *.log"; DestDir: "{app}\EnemizerCLI"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: generator
|
||||||
|
|
||||||
|
@ -77,7 +84,7 @@ Name: "{commondesktop}\{#MyAppName} Factorio Client"; Filename: "{app}\Archipela
|
||||||
[Run]
|
[Run]
|
||||||
|
|
||||||
Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/passive /norestart"; Check: IsVCRedist64BitNeeded; StatusMsg: "Installing VC++ redistributable..."
|
Filename: "{tmp}\vc_redist.x64.exe"; Parameters: "/passive /norestart"; Check: IsVCRedist64BitNeeded; StatusMsg: "Installing VC++ redistributable..."
|
||||||
Filename: "{app}\ArchipelagoLttPAdjuster"; Parameters: "--update_sprites"; StatusMsg: "Updating Sprite Library..."; Components: client/lttp or server
|
Filename: "{app}\ArchipelagoLttPAdjuster"; Parameters: "--update_sprites"; StatusMsg: "Updating Sprite Library..."; Components: client/lttp or generator
|
||||||
|
|
||||||
[UninstallDelete]
|
[UninstallDelete]
|
||||||
Type: dirifempty; Name: "{app}"
|
Type: dirifempty; Name: "{app}"
|
||||||
|
|
35
setup.py
35
setup.py
|
@ -5,11 +5,12 @@ import sysconfig
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import cx_Freeze
|
import cx_Freeze
|
||||||
from kivy_deps import sdl2, glew
|
from kivy_deps import sdl2, glew
|
||||||
|
from Utils import version_tuple
|
||||||
|
|
||||||
is_64bits = sys.maxsize > 2 ** 32
|
is_64bits = sys.maxsize > 2 ** 32
|
||||||
|
|
||||||
arch_folder = "exe.{platform}-{version}".format(platform=sysconfig.get_platform(),
|
arch_folder = "exe.{platform}-{version}".format(platform=sysconfig.get_platform(),
|
||||||
version=sysconfig.get_python_version())
|
version=sysconfig.get_python_version())
|
||||||
buildfolder = Path("build", arch_folder)
|
buildfolder = Path("build", arch_folder)
|
||||||
sbuildfolder = str(buildfolder)
|
sbuildfolder = str(buildfolder)
|
||||||
libfolder = Path(buildfolder, "lib")
|
libfolder = Path(buildfolder, "lib")
|
||||||
|
@ -39,20 +40,25 @@ def _threaded_hash(filepath):
|
||||||
os.makedirs(buildfolder, exist_ok=True)
|
os.makedirs(buildfolder, exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
def manifest_creation(folder):
|
def manifest_creation(folder, create_hashes=False):
|
||||||
|
# Since the setup is now split into components and the manifest is not,
|
||||||
|
# it makes most sense to just remove the hashes for now. Not aware of anyone using them.
|
||||||
hashes = {}
|
hashes = {}
|
||||||
manifestpath = os.path.join(folder, "manifest.json")
|
manifestpath = os.path.join(folder, "manifest.json")
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
if create_hashes:
|
||||||
pool = ThreadPoolExecutor()
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
for dirpath, dirnames, filenames in os.walk(folder):
|
pool = ThreadPoolExecutor()
|
||||||
for filename in filenames:
|
for dirpath, dirnames, filenames in os.walk(folder):
|
||||||
path = os.path.join(dirpath, filename)
|
for filename in filenames:
|
||||||
hashes[os.path.relpath(path, start=folder)] = pool.submit(_threaded_hash, path)
|
path = os.path.join(dirpath, filename)
|
||||||
|
hashes[os.path.relpath(path, start=folder)] = pool.submit(_threaded_hash, path)
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from Utils import version_tuple
|
manifest = {
|
||||||
manifest = {"buildtime": buildtime.isoformat(sep=" ", timespec="seconds"),
|
"buildtime": buildtime.isoformat(sep=" ", timespec="seconds"),
|
||||||
"hashes": {path: hash.result() for path, hash in hashes.items()},
|
"hashes": {path: hash.result() for path, hash in hashes.items()},
|
||||||
"version": version_tuple}
|
"version": version_tuple}
|
||||||
|
|
||||||
json.dump(manifest, open(manifestpath, "wt"), indent=4)
|
json.dump(manifest, open(manifestpath, "wt"), indent=4)
|
||||||
print("Created Manifest")
|
print("Created Manifest")
|
||||||
|
|
||||||
|
@ -90,7 +96,7 @@ buildtime = datetime.datetime.utcnow()
|
||||||
|
|
||||||
cx_Freeze.setup(
|
cx_Freeze.setup(
|
||||||
name="Archipelago",
|
name="Archipelago",
|
||||||
version=f"{buildtime.year}.{buildtime.month}.{buildtime.day}.{buildtime.hour}",
|
version=f"{version_tuple.major}.{version_tuple.minor}.{version_tuple.build}",
|
||||||
description="Archipelago",
|
description="Archipelago",
|
||||||
executables=exes,
|
executables=exes,
|
||||||
options={
|
options={
|
||||||
|
@ -124,7 +130,8 @@ def installfile(path, keep_content=False):
|
||||||
else:
|
else:
|
||||||
print('Warning,', path, 'not found')
|
print('Warning,', path, 'not found')
|
||||||
|
|
||||||
for folder in sdl2.dep_bins+glew.dep_bins:
|
|
||||||
|
for folder in sdl2.dep_bins + glew.dep_bins:
|
||||||
shutil.copytree(folder, libfolder, dirs_exist_ok=True)
|
shutil.copytree(folder, libfolder, dirs_exist_ok=True)
|
||||||
print('copying', folder, '->', libfolder)
|
print('copying', folder, '->', libfolder)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue