Papercut-SMTP icon indicating copy to clipboard operation
Papercut-SMTP copied to clipboard

Remove Emply Directories on Exit

Open lwcorp opened this issue 2 years ago • 7 comments

Describe the bug Though there's no portable version per-se (#83), both the client and server can be run without installing anything. Problem is they leave leftovers, but it can be easily fixed.

To Reproduce Steps to reproduce the behavior:

  1. Enter the client and server.
  2. Exit both of them.
  3. See what remains behind: 1.1 %localappdata%\Changemaker_Studios 1.2 %appdata%\Changemaker Studios 1.3 %appdata%\Papercut 1.4 %ProgramData%\Changemaker Studios

Expected behavior Delete any leftovers upon exit.

Desktop (please complete the following information):

  • OS: Windows
  • Version 6.2.0

lwcorp avatar Apr 10 '23 23:04 lwcorp

Who doesn't love leftovers!? They are delicious!

Seriously you are asking for my VOLENTEER TIME here. I don't care. You care. Put some effort in -- include a screen shot at least. Closing.

Jaben avatar May 10 '24 16:05 Jaben

It's your call, but a screenshot of folders? The fact that they exist is the issue, not how they look.

lwcorp avatar May 10 '24 23:05 lwcorp

It's your call, but a screenshot of folders? The fact that they exist is the issue, not how they look.

Your request was not clear -- "leftovers" could mean many things. Now I understand you mean leaving empty directories.

Jaben avatar May 11 '24 18:05 Jaben

@lwcorp you can try the new release with this feature here: https://ci.appveyor.com/api/buildjobs/58y5ayui60iuepov/artifacts/PapercutSMTP-win-x64-dev-Portable.zip

Jaben avatar May 11 '24 23:05 Jaben

Sure, unfortunately it still leaves items 1.1, 1.2 and 1.4 above (I've retroactively added 1.4 to the OP since I've just noticed it). Why not just put them in the program's own folder and make it 100% portable? 1.3 seems to not be created in the first place anymore, which is great.

Also, why does this experimental release has many warnings in VirusTotal while the official release has just 1?

lwcorp avatar May 15 '24 22:05 lwcorp

Sure, unfortunately it still leaves items 1.1, 1.2 and 1.4 above (I've retroactively added 1.4 to the OP since I've just noticed it). Why not just put them in the program's own folder and make it 100% portable? 1.3 seems to not be created in the first place anymore, which is great.

Short answer: permission problems. Originally Papercut just created one directory in its own directory. But there were permission issues for some so I moved to system-approved locations.

Maybe a portable-friendly version that includes a modified app.config would work:

<setting name="MessagePaths" serializeAs="String">
        <value>%BaseDirectory%\Incoming</value>
</setting>

It's not a simplistic thing to get right. Many issues have been created about this over the years. Plus there are upgrading users to think of: if they upgrade and all their email (because directory search paths aren't there anymore), it's a confusing experience.

Also, why does this experimental release has many warnings in VirusTotal while the official release has just 1?

I'm using a new installation system called Velopack (https://github.com/velopack/velopack). Those are false positives as it only flags the "bootstrap exe" that Velo creates. I appreciate the heads up about this as I'll need to figure out a solution... I could code-sign it but it's expensive and time-consuming. Will need to put time into looking into options.

It may be simpler just to go "Portable Release Only" here. No more installers.

Jaben avatar May 16 '24 02:05 Jaben

Looks like a good idea, but maybe also provide an alternate way using a command line parameter like --portable. As for upgraders, if they care enough to create this file (or use a command line parameter), they probably won't care moving some files/folders if it's clear enough in the instructions.

lwcorp avatar May 16 '24 20:05 lwcorp