Cleanup the setup instructions and rename the windows setup scripts

This commit is contained in:
Veronica K. B. Olsen
2021-04-19 20:02:58 +02:00
parent 71f9f3d230
commit c9785bc57b
6 changed files with 84 additions and 102 deletions
+2 -2
View File
@@ -175,8 +175,8 @@ Windows doesn't by default come with Python installed. If you haven't installed
from [python.org/downloads](https://www.python.org/downloads/). Remember to select "Add Python to from [python.org/downloads](https://www.python.org/downloads/). Remember to select "Add Python to
PATH" during the installation. PATH" during the installation.
The script `setup_windows.bat` can be used to create desktop and start menu icons for novelWriter. The script `setup\windows_install.bat` can be used to create desktop and start menu icons for
The script will also install dependencies for you from PyPi. novelWriter. The script will also install dependencies for you from PyPi.
## Internationalisation ## Internationalisation
+2 -2
View File
@@ -76,7 +76,7 @@ Step 2: Dependencies and Icons
**Alternative A: By Script** **Alternative A: By Script**
Open the folder where you extracted novelWriter, and double-click the file named Open the folder where you extracted novelWriter, and double-click the file named
``setup_windows.bat``. This should open a command line window and run the setup script to install ``windows_install.bat``. This should open a command line window and run the setup script to install
dependencies, and add desktop and start menu icons. dependencies, and add desktop and start menu icons.
.. note:: .. note::
@@ -119,7 +119,7 @@ Uninstalling
**Alternative A: By Script** **Alternative A: By Script**
Open the folder where you keep the novelWriter files, and double-click the file named Open the folder where you keep the novelWriter files, and double-click the file named
``uninstall_windows.bat``. This should open a command line window and run the setup script to ``windows_uninstall.bat``. This should open a command line window and run the setup script to
remove the main dependency packages and remove desktop and start menu icons. remove the main dependency packages and remove desktop and start menu icons.
.. note:: .. note::
+60 -50
View File
@@ -367,10 +367,10 @@ def makeMinimalPackage(targetOS):
if targetOS == OS_WIN: if targetOS == OS_WIN:
zipObj.write("novelWriter.py", "novelWriter.pyw") zipObj.write("novelWriter.py", "novelWriter.pyw")
print("Adding File: novelWriter.pyw") print("Adding File: novelWriter.pyw")
zipObj.write(os.path.join("setup", "setup_windows.bat"), "setup_windows.bat") zipObj.write(os.path.join("setup", "windows_install.bat"), "windows_install.bat")
print("Adding File: setup_windows.bat") print("Adding File: windows_install.bat")
zipObj.write(os.path.join("setup", "uninstall_windows.bat"), "uninstall_windows.bat") zipObj.write(os.path.join("setup", "windows_uninstall.bat"), "windows_uninstall.bat")
print("Adding File: uninstall_windows.bat") print("Adding File: windows_uninstall.bat")
else: else:
zipObj.write("novelWriter.py") zipObj.write("novelWriter.py")
print("Adding File: novelWriter.py") print("Adding File: novelWriter.py")
@@ -1056,51 +1056,61 @@ if __name__ == "__main__":
else: else:
targetOS = hostOS targetOS = hostOS
helpMsg = ( helpMsg = [
"\n" "",
"novelWriter Setup Tool\n" "novelWriter Setup Tool",
"======================\n" "======================",
"\n" "",
"This tool provides setup and build commands for installing or distibuting novelWriter\n" "This tool provides setup and build commands for installing or distibuting",
"as a package on Linux, Mac and Windows. The available options are as follows:\n" "novelWriter as a package on Linux, Mac and Windows. The available options",
"\n" "are as follows:",
"Some of the commands can be targeted towards a different OS than the host OS. To target\n" "",
"the command, add one of '--target-linux', '--target-darwin' or '--target-win'.\n" "Some of the commands can be targeted towards a different OS than the host OS.",
"\n" "To target the command, add one of '--target-linux', '--target-darwin' or",
"General:\n" "'--target-win'.",
"\n" "",
" help Print the help message.\n" "General:",
" pip Install all package dependencies for novelWriter using pip.\n" "",
" clean Will attempt to delete the 'build' and 'dist' folders.\n" " help Print the help message.",
"\n" " pip Install all package dependencies for novelWriter using pip.",
"Additional Builds:\n" " clean Will attempt to delete the 'build' and 'dist' folders.",
"\n" "",
" qthelp Build the help documentation for use with the Qt Assistant. Run before\n" "Additional Builds:",
" install to have local help enable in the the installed version.\n" "",
" qtlupdate Update the translation files for internationalisation.\n" " qthelp Build the help documentation for use with the Qt Assistant.",
" qtlrelease Build the language files for internationalisation.\n" " qtlupdate Update the translation files for internationalisation.",
" sample Build the sample project as a zip file. Run before install to enable\n" " qtlrelease Build the language files for internationalisation.",
" creating sample projects in the in-app New Project Wizard.\n" " sample Build the sample project zip file and add it to assets.",
"\n" "",
"Python Packaging:\n" "Python Packaging:",
"\n" "",
" minimal-zip Creates a minimal zip file of the core application without all the\n" " minimal-zip Creates a minimal zip file of the core application without",
" other source files. Accepts a target OS flag.\n" " all the other source files. Defaults to tailor the zip file",
" pack-pyz Creates a pyz package in a folder with all dependencies using the\n" " for the current OS, but accepts a target OS flag to build",
" zipapp tool. On Windows, python embeddable is added to the folder.\n" " for another OS.",
" setup-pyz Build a Windows installer from a zipapp package using Inno Setup.\n" " pack-pyz Creates a .pyz package in a folder with all dependencies",
"\n" " using the zipapp tool. On Windows, python embeddable is",
"System Install:\n" " added to the folder.",
"\n" " setup-pyz Build a Windows executable installer from a zipapp package",
" install Installs novelWriter to the system's Python install location. Run as \n" " using Inno Setup. Must run 'pack-pyz' first.",
" root or with sudo for system-wide install, or as user for single user \n" "",
" install.\n" "System Install:",
" xdg-install Install launcher and icons for freedesktop systems. Run as root or \n" "",
" with sudo for system-wide install, or as user for single user install.\n" " install Installs novelWriter to the system's Python install",
" Running 'xdg-uninstall' will remove the icons.\n" " location. Run as root or with sudo for system-wide install,",
" win-install Install desktop and start menu icons for Windows systems.\n" " or as user for single user install.",
" Running 'win-uninstall' will remove the icons.\n" " xdg-install Install launcher and icons for freedesktop systems. Run as",
) " root or with sudo for system-wide install, or as user for",
" single user install.",
" xdg-uninstall Remove the launcher and icons for the current system as",
" installed by the 'xdg-install' command.",
" win-install Install desktop icon, start menu icon, and registry entries",
" for file association with .nwx files for Windows systems.",
" win-uninstall Remove desktop icon, start menu icon, and registry keys,",
" for the current system. Note that it only removes icons for",
" the version number of the package the command is run from.",
"",
]
# Flags and Variables # Flags and Variables
makeSetupPyz = False makeSetupPyz = False
@@ -1112,7 +1122,7 @@ if __name__ == "__main__":
if "help" in sys.argv: if "help" in sys.argv:
sys.argv.remove("help") sys.argv.remove("help")
print(helpMsg) print("\n".join(helpMsg))
sys.exit(0) sys.exit(0)
if "version" in sys.argv: if "version" in sys.argv:
+20 -48
View File
@@ -1,56 +1,28 @@
# Build and Install novelWriter # Build and Install novelWriter
The root folder of the repository contains two scripts for setup and install: The root folder of the repository contains a standard `setup.py` script. The `setup` folder
contains necessary files for the setup process, like icons and other files, and it also contains
additional scripts that are included in the minimal zip packages.
## Setup Script
## Script `setup.py` The `setup.py` script in the root folder has all the necessary commands for generating packages,
installing icons, launcher, and file associations on Linux and Windows (no macOS support yet).
The `setup.py` is a standard Python setup script with a couple of additional In addition, it is a wrapper for `setuptools` and accept all commands associated with this tool.
options:
Some of the commands can be targeted towards a different OS than the host OS. To list all custom package and install options in this script, run:
To target the command, add one of `--target-linux`, `--target-darwin` or ```
`--target-win`. ./setup.py help
```
## Windows Scripts
### General The `windows_install.bat` and `windows_uninstall.bat` are provided as convenience scripts for
Windows users who aren't used to running commands from command line. They are both located in the
`setup` folder in the source package, but in the minimal zip package for Windows, they can be
found in the root folder.
`help` Print the help message. These scripts are designed to be double-clicked by the user, but can also be run from the command
line tool. In either case, they will check if Python is properly installed, and then run the
`pip` Install all package dependencies for novelWriter using pip. commands to install or uninstall the core dependencies of novelWriter, and then setup or remove the
desktop icon, start menu icon and registry entries.
`clean` Will attempt to delete the `build` and `dist` folders.
### Additional Builds
`qthelp` Build the help documentation for use with the Qt Assistant. Run
before install to have local help enable in the the installed version
`qtlupdate` Update the translation files for internationalisation.
`qtlrelease` Build the language files for internationalisation.
`sample` Build the sample project as a zip file. Run before install to enable
creating sample projects in the in-app New Project Wizard.
### Python Packaging
`minimal-zip` Creates a minimal zip file of the core application without all
the other source files.
`pack-pyz` Creates a pyz package in a folder with all dependencies using the
zipapp tool. On Windows, python embeddable is added to the folder.
`setup-pyz` Build a Windows installer from a zipapp package using Inno Setup.
### System Install
`install` Installs novelWriter to the system's Python install location. Run
as root or with sudo for system-wide install, or as user for single user
install.
`xdg-install` Install launcher and icons for freedesktop systems. Run as root
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.