Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added file check & downloader. updated to simpler license
- Loading branch information
1 parent
bdd4e90
commit 29d6909
Showing
9 changed files
with
162 additions
and
676 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 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,13 @@ | ||
@ECHO OFF | ||
:: Check for bsarch.exe installation | ||
IF NOT EXIST "%TOOLKIT_PATH%Utilities\archive.exe" GOTO notFound | ||
ECHO archive.exe exists in Utilites path >CON | ||
|
||
EXIT /B 0 | ||
|
||
:notFound | ||
ECHO archive.exe not found >CON | ||
ECHO you need to install the Bethesda Launcher, and from that, the Skyrim Construction Kit >CON | ||
ECHO Then put the archive.exe in your "Utilities" folder >CON | ||
|
||
EXIT /B 1 |
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,13 @@ | ||
@ECHO OFF | ||
:: Check for bsarch.exe installation | ||
IF NOT EXIST "%TOOLKIT_PATH%Utilities\bsarch.exe" GOTO notFound | ||
ECHO bsarch.exe exists in Utilites path >CON | ||
|
||
EXIT /B 0 | ||
|
||
:notFound | ||
ECHO bsarch.exe not found >CON | ||
ECHO you need to download it from Nexus at https://www.nexusmods.com/newvegas/mods/64745?tab=files >CON | ||
ECHO And put it in your "Utilities" folder >CON | ||
|
||
EXIT /B 1 |
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,16 @@ | ||
@ECHO OFF | ||
:: Check for nvddsinfo.exe installation | ||
IF NOT EXIST "%TOOLKIT_PATH%Utilities\nvddsinfo.exe" GOTO download | ||
ECHO nvddsinfo.exe exists in Utilites path >CON | ||
|
||
EXIT /B 0 | ||
|
||
:download | ||
ECHO nvddsinfo.exe not found >CON | ||
|
||
py -3 "%SCRIPTS_PATH%\download_file.py" https://github.com/castano/nvidia-texture-tools/releases/download/2.1.1/nvidia-texture-tools-2.1.1-win64.zip "%TOOLKIT_PATH%Utilities\temp.zip" | ||
py -3 "%SCRIPTS_PATH%\unzip_file.py" "%TOOLKIT_PATH%Utilities\temp.zip" "%TOOLKIT_PATH%Utilities\nvddsinfo.exe" | ||
ERASE "%TOOLKIT_PATH%Utilities\temp.zip" | ||
|
||
IF EXIST "%TOOLKIT_PATH%Utilities\nvddsinfo.exe" EXIT /B 0 | ||
EXIT /B 1 |
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,14 @@ | ||
@ECHO OFF | ||
:: Check for texconv.exe installation | ||
IF NOT EXIST "%TOOLKIT_PATH%Utilities\texconv.exe" GOTO download | ||
ECHO texconv.exe exists in Utilites path >CON | ||
|
||
EXIT /B 0 | ||
|
||
:download | ||
ECHO texconv.exe not found >CON | ||
|
||
py -3 "%SCRIPTS_PATH%\download_file.py" https://github.com/Microsoft/DirectXTex/releases/download/aug2018/texconv.exe "%TOOLKIT_PATH%Utilities\texconv.exe" | ||
|
||
IF EXIST "%TOOLKIT_PATH%Utilities\texconv.exe" EXIT /B 0 | ||
EXIT /B 1 |
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,14 @@ | ||
@ECHO OFF | ||
:: Check for texdiag.exe installation | ||
IF NOT EXIST "%TOOLKIT_PATH%Utilities\texdiag.exe" GOTO download | ||
ECHO texdiag.exe exists in Utilites path >CON | ||
|
||
EXIT /B 0 | ||
|
||
:download | ||
ECHO texdiag.exe not found >CON | ||
|
||
py -3 "%SCRIPTS_PATH%\download_file.py" https://github.com/Microsoft/DirectXTex/releases/download/aug2018/texdiag.exe "%TOOLKIT_PATH%Utilities\texdiag.exe" | ||
|
||
IF EXIST "%TOOLKIT_PATH%Utilities\texdiag.exe" EXIT /B 0 | ||
EXIT /B 1 |
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,22 @@ | ||
#! python3 | ||
|
||
import sys | ||
import urllib.request | ||
import shutil | ||
import zipfile | ||
|
||
def DownloadFile(origin, target): | ||
|
||
print("Downloading from : " + origin) | ||
print("Downloading to: " + target) | ||
|
||
# Download the file from `url` and save it locally under `file_name`: | ||
with urllib.request.urlopen(origin) as response, open(target, 'wb') as out_file: | ||
shutil.copyfileobj(response, out_file) | ||
|
||
print("Download Complete") | ||
|
||
if __name__ == '__main__': | ||
origin = sys.argv[1] | ||
target = sys.argv[2] | ||
DownloadFile(origin, target) |
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,33 @@ | ||
#! python3 | ||
|
||
import os | ||
import sys | ||
import zipfile | ||
|
||
def UnzipFile(origin, target): | ||
|
||
print("Zip file: " + origin) | ||
print("Target File: " + target) | ||
target_filename = os.path.basename(target) | ||
target_path = os.path.dirname(target) | ||
cwd = os.getcwd() | ||
os.chdir(target_path) | ||
print("Target Folder: " + target_path) | ||
print("Target Filename: " + target_filename) | ||
|
||
with zipfile.ZipFile(origin) as myzip: | ||
for filename in myzip.namelist(): | ||
if filename.endswith(target_filename): | ||
final_path = myzip.extract(filename, target_path) | ||
if final_path != target: | ||
endPath = os.path.dirname(final_path) | ||
os.rename(final_path, target) | ||
os.rmdir(endPath) | ||
|
||
print("Unzip Complete") | ||
os.chdir(cwd) | ||
|
||
if __name__ == '__main__': | ||
origin = sys.argv[1] | ||
target = sys.argv[2] | ||
UnzipFile(origin, target) |