belowaverage-org/SuperGrate

Check if working directory exists before creating it.

Closed this issue · 4 comments

Discussed in #99

Originally posted by bobbintb October 3, 2023
I am using USMT for Windows 11 and the latest SuperGrate. I was attempting a test back up of a different user. The executable for SuperGrate was in my downloads folder so I set the SuperGratePayloadPath to it. When I started it, almost everything in my downloads folder disappeared. I think I got an error but do be honest, I wasn't really sure because I frantically clicked to stop the process when all my files vanished. I have no idea what happened to the files nor why they were moved. I have included my log. Please tell me they didn't get deleted.

https://pastebin.com/JPLkk1cD

New behavior:

2:14:13 AM> Welcome to Super Grate! v1.4.1.0
2:14:13 AM> Enter some information to get started!
2:14:25 AM> Listing users from ....
2:14:25 AM> Users listed successfully from ..
2:14:28 AM> Gathering OS architecture on ....
2:14:28 AM> The OS architecture on . is X64.
2:14:28 AM> Uploading USMT to ....
2:14:28 AM> Failed to find USMT folder at .\USMT\X64.
2:14:28 AM> Downloading USMT X64 from the web...
2:14:29 AM> Decompressing USMT...
2:14:29 AM> Cleaning up USMT...
2:14:29 AM> USMT uploaded successfully.
2:14:29 AM> Capturing user state BELOWAVERAGE\dylan.bickerstaff on .....
2:14:37 AM> Canceling current task...
2:14:37 AM> Stopping USMT process on ..
2:14:37 AM> USMT process stopped on ..
2:14:40 AM> Removing USMT from ....
2:14:40 AM> USMT removed successfully.
2:14:40 AM> Done.

Manually created folder at C:\SuperGrate to test the new folder exists check:

2:14:54 AM> Gathering OS architecture on ....
2:14:54 AM> The OS architecture on . is X64.
2:14:54 AM> Uploading USMT to ....
2:14:54 AM> Could not generate a working directory for USMT at: C:\SuperGrate. The folder already exists.
2:14:54 AM> Done.