OutputFilePath is corrupt when greenshot.ini is used on a different system (portable or roaming)
Description
Environment
Gliffy Diagrams
Activity
Robin Krom July 13, 2016 at 5:23 PM
ah, smart
thanks, do remember that this is still not released.
Let me know if there is something else, I will close this.
Firstname Surname July 13, 2016 at 4:27 PMEdited
Have had tested the new version (get the download direct from the appveyor-link from github). Works like a charm
Thanks a lot for that fast response.
Robin Krom July 13, 2016 at 3:36 PM
2 it is.
Actually, if I did it correctly, this was not hard.
In fact there was also an issue when people were using the configuration on multiple but different PC's. Which I actually do myself, roaming on different PC's.
You can test it later, probably tomorrow... the build server is making the new build and afterwards I have to change the build status from draft to pre-release so you can see it... don't know when I have time to do the clicking
It's one version higher than last time, if I recall correctly 1.2.9.40..
Firstname Surname July 13, 2016 at 3:23 PM
I would prefer solution 2 if its not more work. Sometimes I use the desktop as target or a specific folder (group screeenshots by topic).
Solution 1 would reset also if I restart the computer (working another day). But nothing has changed...
Robin Krom July 13, 2016 at 3:15 PM
I need to think about the solution, as there are quite a lot of factors.
The location is absolute, so storing the screenshot in a location which is in the Paf tree would no longer work if the stick is moves elsewhere... This is the problem you found
The problem will also happen if you store something to e.g. C:\ (whatever is not on the USB stick), the location might not be valid on a different system.
Possible solutions that come to mind:
Do not store the OutputFilePath, in fact reset it to the default every time Greenshot starts.
Check if the path is valid, if not reset it.
I'm voting for 1, as it might be less surprising, but maybe you as a portable user can image things differently?
Hello,
after testing the software for another bugreport, I found another bug, which affects the using on portableapps platform.
On first start the config get its default OutputFilePath by CoreConfigrurations GetDefault. It use the right place if isportable, but If I change the location of the portableapps platform (like a USB-stick I put in another pc) It don't realize, that the target is changed. Now it has a corrupt value for OutputFilePath.
I think there must be a check like this (is in the MainForm.cs here). I am not a professional programmer and don't know much about your code, but I think it shows what I mean. Was a bit difficult to find the places and hope its right.
{{// Read configuration _conf = IniConfig.GetIniSection<CoreConfiguration>(); if (IniConfig.IsPortable) { IniValue outputFilePath = _conf.Values["OutputFilePath"]; if outputFilePath.Value.EndsWith(outputFilePath.ContainingIniSection.GetDefault("OutputFilePath").Substring(Application.StartupPath.Length)) { outputFilePath.UseValueOrDefault(null); } if (_conf.IsDirty) { IniConfig.Save(); } } }}