[GH-ISSUE #454] Crash when recording in computer with different user account #374

Closed
opened 2026-02-26 09:31:12 +03:00 by kerem · 4 comments
Owner

Originally created by @duarteframos on GitHub (Feb 25, 2019).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/454

This one should be easy to solve with just a new default.

I use ScreenTo Gif portably in different computers, and each has different user accounts. When recording on a new computer different from the one it was originally set up, ScreenToGif crashes with the following message.

Oh No, the app crashed :(
Access to the path 'C:\Users\UserName\Appdata\Local\Temp\ScreenToGif\Recording\2019-02-25' is denied

This is because under the path set under Settings > Temporary Files > Location Folder uses an absolute path for the current user account appdata folder, which may not exist in a another computer with a different user account name.

Proposed Solution
Since environment variables are apparently already supported out of the box, I found out using %appdata%\Local\Temp\ instead of an absolute path works well.
If a generic path using %appdata% environment variable was used by default instead, it would make using ScreenToGif across different environments more robust and resilient to changes in user account names and even across different languages or operating systems that store them differently.

Originally created by @duarteframos on GitHub (Feb 25, 2019). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/454 This one should be easy to solve with just a new default. I use ScreenTo Gif portably in different computers, and each has different user accounts. When recording on a new computer different from the one it was originally set up, ScreenToGif crashes with the following message. > Oh No, the app crashed :( > Access to the path 'C:\Users\UserName\Appdata\Local\Temp\ScreenToGif\Recording\2019-02-25\' is denied This is because under the path set under _Settings > Temporary Files > Location Folder_ uses an absolute path for the current user account appdata folder, which may not exist in a another computer with a different user account name. **Proposed Solution** Since environment variables are apparently already supported out of the box, I found out using `%appdata%\Local\Temp\` instead of an absolute path works well. If a generic path using `%appdata%` environment variable was used by default instead, it would make using ScreenToGif across different environments more robust and resilient to changes in user account names and even across different languages or operating systems that store them differently.
kerem closed this issue 2026-02-26 09:31:12 +03:00
Author
Owner

@vatterspun commented on GitHub (Feb 26, 2019):

Portablefreeware has a workaround: under "Settings", click on "Options", then "Temporary files" and replace the path in the "Location folder" with a single period: "." Then files will be saved to the local directory.

<!-- gh-comment-id:467277202 --> @vatterspun commented on GitHub (Feb 26, 2019): Portablefreeware has a workaround: under "Settings", click on "Options", then "Temporary files" and replace the path in the "Location folder" with a single period: "." Then files will be saved to the local directory.
Author
Owner

@duarteframos commented on GitHub (Feb 26, 2019):

That work well too.
Only downside is that if you are running from a slow thumbdrive recording may lag and editing may likely also be slower.
On the plus side it will be stealthier, since temporary files won't be left behind in the host computer.

<!-- gh-comment-id:467400894 --> @duarteframos commented on GitHub (Feb 26, 2019): That work well too. Only downside is that if you are running from a slow thumbdrive recording may lag and editing may likely also be slower. On the plus side it will be stealthier, since temporary files won't be left behind in the host computer.
Author
Owner

@vatterspun commented on GitHub (Feb 27, 2019):

Only downside is that if you are running from a slow thumbdrive recording may lag and editing may likely also be slower.

Agreed.

I would say that even fairly cheap thumbdrives are by and large pretty darn fast nowadays, especially with bi-directional transfers in USB 3.0, but I haven't benchmarked anything on that. There might be a bottleneck on larger recordings as the images that ScreenToGif generates aren't pre-compressed unlike most video streams.

<!-- gh-comment-id:467714572 --> @vatterspun commented on GitHub (Feb 27, 2019): > Only downside is that if you are running from a slow thumbdrive recording may lag and editing may likely also be slower. Agreed. I would say that even fairly cheap thumbdrives are by and large pretty darn fast nowadays, especially with bi-directional transfers in USB 3.0, but I haven't benchmarked anything on that. There might be a bottleneck on larger recordings as the images that ScreenToGif generates aren't pre-compressed unlike most video streams.
Author
Owner

@NickeManarin commented on GitHub (Mar 9, 2019):

The problem starts with the first run of ScreenToGif.

 if (string.IsNullOrWhiteSpace(UserSettings.All.TemporaryFolder))
    UserSettings.All.TemporaryFolder = Path.GetTempPath();

Since there's probably no temporary folder set, the app uses this path:

C:\Users\nicke\AppData\Local\Temp

But %appdata% is translated to:

C:\Users\nicke\AppData\Roaming

However %temp% translates to:

C:\Users\nicke\AppData\Local\Temp

So, I when there's no folder set as the location for the frames, %temp% will be used.
(the support for environment variables in that property needed to be manually implemented)

<!-- gh-comment-id:471180807 --> @NickeManarin commented on GitHub (Mar 9, 2019): The problem starts with the first run of ScreenToGif. ``` if (string.IsNullOrWhiteSpace(UserSettings.All.TemporaryFolder)) UserSettings.All.TemporaryFolder = Path.GetTempPath(); ``` Since there's probably no temporary folder set, the app uses this path: `C:\Users\nicke\AppData\Local\Temp` But **%appdata%** is translated to: `C:\Users\nicke\AppData\Roaming` However **%temp%** translates to: `C:\Users\nicke\AppData\Local\Temp` So, I when there's no folder set as the location for the frames, **%temp%** will be used. (the support for environment variables in that property needed to be manually implemented)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#374
No description provided.