Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility crashes when creating destination folder on system that had Lisanet PDFWriter installed earlier #25

Closed
emendelson opened this issue Jan 13, 2023 · 14 comments

Comments

@emendelson
Copy link

emendelson commented Jan 13, 2023

This project is exactly what I've been hoping for, but I can't create the destination folder under macOS 13.1 on an M1 machine. The utility shuts down unexpectedly when I try to select a location for the folder, and the folder doesn't get created. I tried creating the folder in ~/Documents by hand but the printer wouldn't print anything to it. Is this a known problem? Is there any way to set it up manually?

Here's a crash report, if it helps...

DestinationReport.txt

EDIT: It installs correctly on another 13.1 setup that I have on the same disk. My guess is that the problem is that I tried to install the old Lisanet PDFwriter on the same system earlier. I tried to fix it by running the uninstall script and moving to the trash everything that Find Any File showed me had the name PDFWriter in it (except for your installer), but that didn't work.

EDIT 2: I got it working by restarting after removing every trace of anything named PDFWriter, then installing the printer, then using sudo to create the folder /private/var/spool/pdfwriter/<MyUserName>, then using sudo to create a shortcut pointing to that folder, and inside the same folder, named PDFWriter Files; and then copying that shortcut to ~/Documents and renaming the copy PDFWriter. Does this sound like the right procedure? I can't imagine why this didn't work when I ran the installer, but I hope it may help sort it out for the next user who may encounter the same problem.

As I said, the installer worked perfectly on a Ventura system that did NOT have the old PDFWriter installed, and only failed on a system where I had installed and removed the old PDFWriter.

And thank you for this elegant solution.

EDIT 3: I also had to use sudo chmod -R a+rwx /private/var/spool/pdfwriter/<myusername> so that I could manage output files. Presumably the installer does this for me when it works correctly?

@emendelson emendelson changed the title Utility crashes when creating destination folder under Ventura Utility crashes when creating destination folder on system that had Lisanet PDFWriter installed earlier Jan 13, 2023
@rodyager
Copy link
Owner

Thanks for this. There was enough information here to reproduce the crash even on an Intel machine.
The problem arises because the Utility is attempting to create an alias to a folder that doesn't exist yet. The folders /private/var/spool/pdfwriter and /private/var/spool/pdfwriter/ are created by the printer driver when you print if they don't already exist.

The easy work around until I fix it is to "Print" a document using the pdfwriter printer driver first, and then open the Utility to create your Destination folder. [The document you printed will be available there].

@emendelson
Copy link
Author

emendelson commented Jan 13, 2023

I'm glad to be able to help. As I said, I do have it working here after those manual fixes but of course I would prefer to have my system set up the "official way." Could you possibly let me know if there's anything I should do (chown? chmod?) to make my setup match the official one?

I was grateful to have your driver because I needed to test the printing in an AppleScript app that I'm working on, and I'm on the road with no physical printer. Your driver let me do all the testing I needed.

EDIT: I don't pretend to know what I'm doing, but I wonder if a simple lpr command in your installation procedure could print a "Welcome to PDFwriter" before offering the user to create the Destination folder?

@rodyager
Copy link
Owner

rodyager commented Jan 13, 2023 via email

@kbernhagen
Copy link
Contributor

Wouldn’t it be better to just create a symlink instead of a macOS alias?

@rodyager
Copy link
Owner

rodyager commented Jan 14, 2023 via email

@emendelson
Copy link
Author

To get the “official way” from where you are: 1. move any pdfwriter printed documents you want to keep to a new location. 2. sudo rm -r /var/spool/pdfwriter - this will remove everything that you did. 3. Print something using the PDFwriter printer driver. This will recreate /var/spool/pdfwriter/ and /var/spool/pdfwriter/emendelson/ with correct permissions and the Icon for the inner folder. 4. Open the utility (open the Printer, click on the settings gear, choose Utility and click the button) and create your destination so you can easily access the printed documents. I hope that makes sense. Step 3 is the key to avoiding the crash in Step 4. Rod

That was exactly what was needed. Thank you!

@rodyager
Copy link
Owner

This is now fixed in the latest release.
Thanks

@emendelson
Copy link
Author

Just a quick FYI: I ran the new installer without removing the old version, and it crashed at the point where it said that the destination already existed, and did I want to replace it, and I answered Yes. No harm done, but maybe worth looking into?

@rodyager
Copy link
Owner

rodyager commented Jan 14, 2023 via email

@rodyager
Copy link
Owner

And it is fixed now (and the v.2.0.1 installer has been updated to also include this fix).

@emendelson
Copy link
Author

Fixed. Thank you.

@kbernhagen
Copy link
Contributor

I think there should be a version bump even if you are only updating the installer.

@kbernhagen
Copy link
Contributor

kbernhagen commented Jan 15, 2023

I found this very useful: https://keepachangelog.com/

And, of course: https://semver.org/

@rodyager
Copy link
Owner

rodyager commented Jan 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants