rimai wrote:
I think the biggest issue on the RAGen crashing is the wrong path picked up on installation.
I'm guessing if the RAGen can't figure out or doesn't have access to the correct folders, it puts default values that makes it crash.
I've seen first hand where the sketch folder was assigned the path of the preferences.txt including the file.
So, my thinking is that sketch folder and libraries folder, don't even need to be an option to choose.
It should always be assigned "Documents/Arduino" and "Documents/Arduino/libraries"
There are no reasons I can see now we need to choose those paths. I understand there was some early confusion when we started in the beginning, but I think those paths are pretty solid.
The installer defaults to using Documents/Arduino and Documents/Arduino/libraries. I looked into things more with what RAGen does and unless the registry keys exist telling where the folders reside, it starts off by doing this:
For the Sketchbook Folder:
- If registry location is empty:
- Check for the arduino prefs file for the sketchbook location.
- if that location exists, use it
- otherwise use the current directory
- If registry location is not empty, use that folder
For the Arduino Folder (for locating arduino.exe):
- If registry location is not empty, use the registry
- check if Prog Files\Reef Angel Controller exists, use it if exists
- check if Documents\Arduino exists, use if exists
- otherwise use the current directory
For the Libraries Folder:
- If registry location is not empty, use the registry
- check Documents\Arduino\libraries, use if exists
- check ARDUINO FOLDER (from above)\libraries, use if exists
- otherwise use the current directory
So that's the logic with the folder checks. Initially, I have the folders to be configured because of my testing and like you said, some early on confusion. Then, the problem was amplified when I created my installer and I wasn't having the installer set the folder locations that it used.
But I think it is safe to assume that this path should also be defaulted back to "Program Files/Reef Angel Controller". I know my installer picked the wrong folder and it should've been (x86), but it's too late now and many users already have it installed on the 64-bit folder. So, lets just keep using it even though it is placed wrong.
Thoughts?
I use the standard windows functions to query the Program Files folder. It's a special folder for windows and they have a function to query it and I just use that result for Program Files. I'm not sure why it wouldn't return the Program Files (x86) when running on a 64bit machine.
With all of this discussion and comments (all very, very helpful by the way), I'm going to "hopefully" put an end to all the confusion and do what Roberto has suggested. I'm going to have RAGen, use the following as default locations:
- Sketchbook - Documents\Arduino
- Libraries - Documents\Arduino\libraries
- Arduino (for the executable) - Program Files\Reef Angel Controller
If any of those folders do not exist, RAGen will automatically create them.
Also, the registry overrides for those folders will be cleared out if they exist to further prevent any accidental changes.
Be on the lookout for an update to RAGen soon with these changes.
curt