ChangemakerStudios / Papercut-SMTP

Papercut SMTP -- The Simple Desktop Email Server
2.92k stars 269 forks source link

Remove Emply Directories on Exit #248

Open lwcorp opened 1 year ago

lwcorp commented 1 year ago

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):

Jaben commented 4 months ago

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.

lwcorp commented 4 months ago

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

Jaben commented 4 months ago

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 commented 4 months ago

@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

lwcorp commented 4 months ago

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?

Jaben commented 4 months ago

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.

lwcorp commented 4 months ago

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.