Skip to content

Commit e6fd923

Browse files
author
arch
committed
update win installer for OFS2
1 parent e3edabf commit e6fd923

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

assets/install.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"minRequiredVersion": "0.1.0"
2+
"minRequiredVersion": "0.2.0"
33
}

contrib/Installer/mtfg-ofs-extension-installer.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
VERSION = "v0.2.0"
1919
FUNSCRIPT_GENERATOR_RELEASE_URL = "https://github.com/michael-mueller-git/Python-Funscript-Editor/releases"
2020
OFS_EXTENSION_DIR = os.path.expandvars(r'%APPDATA%\OFS\OFS_data2\extensions')
21+
OFS_V1_EXTENSION_DIR = os.path.expandvars(r'%APPDATA%\OFS\OFS_data\extensions')
2122
LATEST_RELEASE_API_URL = 'https://api.github.com/repos/michael-mueller-git/Python-Funscript-Editor/releases/latest'
2223

2324

@@ -41,7 +42,10 @@ def error(msg):
4142

4243
def is_ofs_installed():
4344
if not os.path.exists(OFS_EXTENSION_DIR):
44-
error("OFS is not installed. Please download and install OFS. Befor running this installer open OFS once!")
45+
if os.path.exists(OFS_V1_EXTENSION_DIR):
46+
error("Please update your [OFS](https://github.com/OpenFunscripter/OFS/releases) Installation to V2.X.X. Then run this installer again")
47+
else:
48+
error("OFS is not installed. Please download and install [OFS](https://github.com/OpenFunscripter/OFS/releases). Befor running this installer open OFS once!")
4549

4650

4751
def get_download_urls_with_api():
@@ -82,10 +86,10 @@ def process_exists(process_name):
8286
return False
8387

8488

85-
def install_lua_scripts(extension_dir, dest_dir):
89+
def install_lua_scripts(src_dir, extension_dir):
8690
for script in ["main.lua", "json.lua"]:
87-
if os.path.exists(os.path.join(dest_dir, "OFS", script)):
88-
shutil.copy2(os.path.join(dest_dir, "OFS", script), os.path.join(extension_dir, script))
91+
if os.path.exists(os.path.join(src_dir, "OFS", script)):
92+
shutil.copy2(os.path.join(src_dir, "OFS", script), os.path.join(extension_dir, script))
8993
else:
9094
error("Installation failed (" + script + " missing)")
9195

@@ -145,7 +149,7 @@ def update(download_urls, latest, release_notes):
145149
error("min required installer version is " + str(min_required_installer_version))
146150

147151
shutil.move(mtfg_dir + "_update", mtfg_dir)
148-
install_lua_scripts(extension_dir, mtfg_dir)
152+
install_lua_scripts(mtfg_dir, extension_dir)
149153

150154

151155

0 commit comments

Comments
 (0)