diff --git a/setup.py b/setup.py index a72f18f4..8525dfa9 100755 --- a/setup.py +++ b/setup.py @@ -251,19 +251,22 @@ def makeMinimalPackage(targetOS): print("") print("Building Minimal ZIP File") print("=========================") - print("") if not os.path.isdir("dist"): os.mkdir("dist") if targetOS == OS_LINUX: targName = "-linux" + print("Target OS: Linux") elif targetOS == OS_DARWIN: targName = "-darwin" + print("Target OS: Darwin") elif targetOS == OS_WIN: targName = "-win" + print("Target OS: Windows") else: targName = "" + print("") zipFile = f"novelWriter-{__version__}-minimal{targName}.zip" outFile = os.path.join("dist", zipFile) @@ -295,7 +298,7 @@ def makeMinimalPackage(targetOS): if targetOS == OS_WIN: zipObj.write("novelWriter.py", "novelWriter.pyw") print("Adding File: novelWriter.pyw") - zipObj.write("setup_windows.bat") + zipObj.write(os.path.join("setup", "setup_windows.bat"), "setup_windows.bat") print("Adding File: setup_windows.bat") else: zipObj.write("novelWriter.py") diff --git a/setup/README.md b/setup/README.md index a2c3f163..4d819e5c 100644 --- a/setup/README.md +++ b/setup/README.md @@ -49,3 +49,4 @@ or with sudo for system-wide install, or as user for single user install. Running `xdg-uninstall` will remove the icons. `win-install` – Install desktop and start menu icons for Windows systems. +Running `win-uninstall` will remove the icons. diff --git a/setup_windows.bat b/setup/setup_windows.bat similarity index 67% rename from setup_windows.bat rename to setup/setup_windows.bat index 12a8cc3f..eeb88fcf 100644 --- a/setup_windows.bat +++ b/setup/setup_windows.bat @@ -8,6 +8,12 @@ if errorlevel 1 goto errorNoPython echo Python found. OK. echo. +if exist setup.py ( + echo setup.py found. OK. +) else ( + goto errorNoSetup +) + :: Install the PyQt5, lxml and pyenchant dependencies python setup.py pip @@ -24,5 +30,13 @@ echo. echo Please download and install it from https://www.python.org/downloads/ echo Also make sure the "Add Python to PATH" option is selected during installation. echo. +goto:eof + +:errorNoSetup +echo. +echo ERROR^: Could not find the setup.py script. +echo. +echo Make sure you run setup.py from the novelWriter root folder. +echo. pause diff --git a/setup/uninstall_windows.bat b/setup/uninstall_windows.bat new file mode 100644 index 00000000..70ec59b0 --- /dev/null +++ b/setup/uninstall_windows.bat @@ -0,0 +1,42 @@ +@echo off + +:: Check for Python Installation +echo. +echo Looking for Python +python --version 2>NUL +if errorlevel 1 goto errorNoPython +echo Python found. OK. + +if exist setup.py ( + echo setup.py found. OK. +) else ( + goto errorNoSetup +) +echo. + +:: Remove the PyQt5, lxml and pyenchant dependencies +pip uninstall -r requirements.txt + +:: Remove the desktop and start menu icons +python setup.py win-uninstall + +pause +goto:eof + +:errorNoPython +echo. +echo ERROR^: Python is not installed on your system, or cannot be found. +echo. +echo Please download and install it from https://www.python.org/downloads/ +echo Also make sure the "Add Python to PATH" option is selected during installation. +echo. +goto:eof + +:errorNoSetup +echo. +echo ERROR^: Could not find the setup.py script. +echo. +echo Make sure you run setup.py from the novelWriter root folder. +echo. + +pause