generated from sudara/pamplejuce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
139 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
import os | ||
import sys | ||
import subprocess | ||
from pathlib import PureWindowsPath | ||
|
||
|
||
def main(): | ||
temp_dir = "./windowstmp" | ||
subprocess.run(["mkdir", temp_dir]) | ||
|
||
project_name = os.getenv("PROJECT_NAME", "Pamplejuce") | ||
product_name = os.getenv("PRODUCT_NAME", "Pamplejuce Demo") | ||
version = os.getenv("VERSION", "0.0.0") | ||
bundle_id = os.getenv("BUNDLE_ID", "") | ||
build_dir = os.getenv("BUILD_DIR", "") | ||
artifact_name = os.getenv("ARTIFACT_NAME", "") | ||
|
||
outfile = open("packaging/installer.iss", "w") | ||
|
||
outfile.write(r''' | ||
#define Version Trim(FileRead(FileOpen("..\VERSION"))) | ||
#define ProjectName GetEnv('PROJECT_NAME') | ||
#define ProductName GetEnv('PRODUCT_NAME') | ||
#define Publisher GetEnv('COMPANY_NAME') | ||
#define Year GetDateTimeString("yyyy","","") | ||
[Setup] | ||
ArchitecturesInstallIn64BitMode=x64 | ||
ArchitecturesAllowed=x64 | ||
AppName={#ProductName} | ||
OutputBaseFilename={#ProductName}-{#Version}-Windows | ||
AppCopyright=Copyright (C) {#Year} {#Publisher} | ||
AppPublisher={#Publisher} | ||
AppVersion={#Version} | ||
DefaultDirName="{commoncf64}\VST3\{#ProductName}.vst3" | ||
DisableDirPage=yes | ||
CreateAppDir=no | ||
''') | ||
|
||
if os.path.isfile("/packaging/icon.ico"): | ||
outfile.write(r'SetupIconFile=..\packaging\icon.ico') | ||
outfile.write("UninstallDisplayIcon={uninstallexe}") | ||
if os.path.isfile("/packaging/EULA"): | ||
outfile.write(r'LicenseFile="EULA"') | ||
if os.path.isfile("/packaging/Readme.rtf"): | ||
outfile.write(r'InfoBeforeFile="Readme.rtf"') | ||
|
||
outfile.write(''' | ||
[Types] | ||
Name: "full"; Description: "Full installation" | ||
Name: "custom"; Description: "Custom installation"; Flags: iscustom | ||
''') | ||
|
||
all_install_paths = [ | ||
r'{commoncf64}\VST3', | ||
r'{commoncf64}\LV2', | ||
r'{commoncf64}\Avid\Audio\Plug-Ins', ] | ||
|
||
plugin_formats, extensions, install_paths = [], [], [] | ||
for plugin_format, extension, install_path in zip( | ||
["VST3", "LV2", "AAX"], | ||
["vst3", "lv2", "aaxplugin"], | ||
all_install_paths): | ||
if plugin_format + "_PATH" in os.environ: | ||
plugin_path = os.environ[plugin_format + "_PATH"] | ||
if os.path.exists(plugin_path): | ||
plugin_formats.append(plugin_format) | ||
extensions.append(extension) | ||
install_paths.append(install_path) | ||
|
||
outfile.write("[Components]\n") | ||
for plugin_format, extension, install_path in zip(plugin_formats, extensions, install_paths): | ||
outfile.write( | ||
'Name: "{}"; Description: {} {}; Types: full custom; Flags: checkablealone'.format( | ||
extension, product_name, plugin_format | ||
)) | ||
outfile.write("\n") | ||
|
||
outfile.write("[UninstallDelete]\n") | ||
for plugin_format, extension, install_path in zip(plugin_formats, extensions, install_paths): | ||
outfile.write( | ||
'Type: filesandordirs; Name: "{}"'.format( | ||
install_path + '\\' + product_name + 'Data' | ||
)) | ||
outfile.write("\n") | ||
|
||
outfile.write("[Files]\n") | ||
for plugin_format, extension, install_path in zip(plugin_formats, extensions, install_paths): | ||
outfile.write( | ||
'Source: "..\\{}\\*"; DestDir: "{}"; Excludes: *.ilk; Flags: ignoreversion recursesubdirs; Components: {}'.format( | ||
str(PureWindowsPath(os.environ[plugin_format + "_PATH"])), | ||
install_path + '\\' + product_name + "." + extension + "\\", | ||
extension) | ||
) | ||
outfile.write("\n") | ||
|
||
outfile.write("[Run]\n") | ||
for plugin_format, extension, install_path in zip(plugin_formats, extensions, install_paths): | ||
outfile.write('Filename: "{cmd}"; ') | ||
outfile.write('WorkingDir:"{}"; '.format(install_path)) | ||
outfile.write('Parameters: "/C mklink /D ""{}"" ""{}"""; ' | ||
.format(install_path + '\\' + product_name + 'Data', | ||
'{commonappdata}\\{#ProductName}')) | ||
outfile.write("Flags: runascurrentuser; ") | ||
outfile.write("Components: " + extension) | ||
outfile.write("\n") | ||
|
||
outfile.close() | ||
return 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters