-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-19: Replaced _acquire_pluginapi.bat with _get_nsis_sdk.py
- Loading branch information
Showing
4 changed files
with
34 additions
and
30 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
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,28 @@ | ||
# Download NSIS SDK files from GitHub | ||
|
||
from pathlib import Path | ||
from urllib import request | ||
|
||
cd = Path(__file__).parent | ||
files = { | ||
cd.joinpath('nsis', 'api.h') : "https://raw.githubusercontent.com/kichik/nsis/master/Source/exehead/api.h", | ||
cd.joinpath('nsis', 'nsis_tchar.h') : "https://raw.githubusercontent.com/kichik/nsis/master/Contrib/ExDLL/nsis_tchar.h", | ||
cd.joinpath('nsis', 'pluginapi.c') : "https://raw.githubusercontent.com/kichik/nsis/master/Contrib/ExDLL/pluginapi.c", | ||
cd.joinpath('nsis', 'pluginapi.h') : "https://raw.githubusercontent.com/kichik/nsis/master/Contrib/ExDLL/pluginapi.h", | ||
} | ||
|
||
download = False | ||
for file in files: | ||
if not file.exists(): download = True | ||
|
||
if download: | ||
print("Downloading NSIS SDK ...") | ||
for file, url in files.items(): | ||
print(file.name) | ||
with request.urlopen(url) as http: | ||
file.parent.mkdir(parents=True, exist_ok=True) | ||
with open(file, 'wb') as outfile: | ||
outfile.write(http.read()) | ||
print(f" {http.status} {http.reason}, {http.getheader('Content-Length')} bytes") | ||
else: | ||
print("Use existing NSIS SDK ...") |