I must preface this question with the following information: This problem only occurs when my application is wrapped with TclApp
I understand that when wrapping a Tcl program, one must lappend
to the auto_path
the location of the directory the program needs to look for files if it is not already wrapped in the internal file system. That is what I have done, but my code only works for tk_getOpenFile, not tk_getSaveFile. Rather than opening the save dialogue in the specified directory, it opens it in My Documents.
Here is essentially what I'm doing:
set root [file dirname [info script]];
if {$iswrapped} {
lappend auto_path "$root/../../../../myFolder";
set target_dir "$root/../../../../myFolder";
}
set filename [tk_getSaveFile -initialdir $target_dir -title "Save As"];
I've made sure this isn't an issue with Windows (where it saves the dialogue open location after saving/opening the first time there with the program.) When I run my program for the first time on a brand new system, tk_getSaveFile opens in My Documents, whereas tk_getOpenFile opens in the correct folder, 'myFolder.'
Any ideas?
Edit:
I now noticed a very strange issue occuring as well and I suspect it might be related. Now, whenever I save a file in any child directory under C:\, I can only see the file through my program's open and save dialogues. If I navigate to the same location in the Windows Explorer, there files are not only not visible, but not there at all! What is going on here?
Edit:
My program had to be run with administrator privileges - that's why I got that really strange error (the second one.)