-
Notifications
You must be signed in to change notification settings - Fork 316
Windows Service
Tres Finocchiaro edited this page Nov 18, 2019
·
35 revisions
- ✅ 2.1 | ✅ 2.0 | ✅ 1.9 | ...
- Run QZ Tray as a Windows service
- NSSM Service Manager: https://nssm.cc/download (Important Prerelease version is required)
-
Warning: Services can NOT show the "Trusted" dialog. If not already...
a. Visit a website with the certificate that needs to be whitelisted.
b. Click "Remember this decision". This will save a file
allowed.datto%APPDATA%\qz. - Open a command prompt As Administrator
- Create a
.batfile that can launch QZ Trayecho java -Xms512M -jar "%~dp0\qz-tray.jar" %* > "%PROGRAMFILES%\QZ Tray\qz-tray.bat"
- Make a location for SYSTEM certificate whitelist
mkdir "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz"
- Copy the
allowed.datto the SYSTEM profilecopy /Y "%APPDATA%\qz\allowed.dat" "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz\allowed.dat"
- Open a command prompt As Administrator
- If not already, extract NSSM to
C:\(e.g.C:\nssm) - Change to the
win64directory within NSSM.cd C:\nssm\win64 - Install the
QZ Trayservicenssm install "QZ Tray" "%PROGRAMFILES%\QZ Tray\qz-tray.bat" nssm set "QZ Tray" Description "Browser printing utility"
- Start the service
net start "QZ Tray"
- Run QZ Tray with a custom Java version (Important: change
c:\Program Files\Java\jdk1.8.0_231\binto point to a proper JDK)echo PATH=^%PATH^%;c:\Program Files\Java\jdk1.8.0_231\bin > "%PROGRAMFILES%\QZ Tray\qz-tray.bat" echo java -Xms512M -jar "%~dp0\qz-tray.jar" %* >> "%PROGRAMFILES%\QZ Tray\qz-tray.bat"
- Open a command prompt As Administrator
- Change to the
win64directory within NSSM.cd C:\nssm\win64 - Uninstall the
QZ Trayservicenet stop "QZ Tray" nssm remove "QZ Tray"
-
Make sure you can call
javafrom a command promptjava -version
- If
javais not available, you may hardcode the path using Windows-Service#advanced section above.
- If
-
If initial connection works, but printing, listing printers, fails, make sure you've properly configured signing. Signing-Messages