Skip to content

Commit

Permalink
postinstall: Launch PDFWriter Utility with launchctl so that it has a…
Browse files Browse the repository at this point in the history
… current working directory. Otherwise showing the panel causes a crash.

Utilitiy: Remove the redundant State variable from ContentView
  • Loading branch information
rodyager committed Jan 14, 2023
1 parent cb5eb9d commit b23de86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion PDFWriter Utility/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import SwiftUI

struct ContentView: View {
@State var filename = "Filename"
var body: some View {
VStack{
Spacer()
Expand Down
5 changes: 3 additions & 2 deletions build/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
# install printer
lpadmin -p PDFwriter -E -v pdfwriter:/ -P /Library/Printers/PPDs/Contents/Resources/RWTS\ PDFwriter.gz -o printer-is-shared=false

# open the Utility
su "$USER" -c "/Library/Printers/RWTS/Utilities/PDFWriter\ Utility.app/Contents/MacOS/PDFWriter\ Utility&"
# open the Utility with correct environment
uid=$(id -u "$USER")
launchctl asuser $uid su "$USER" -c "/Library/Printers/RWTS/Utilities/PDFWriter\ Utility.app/Contents/MacOS/PDFWriter\ Utility"

0 comments on commit b23de86

Please sign in to comment.