rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 8, 2018 16:46:02 GMT
My platform
Windows 7 (64bit) Pro - patched up, 4GB, Large pagefiles, ... 2 spindles.
deskside HP hardware platform DC5700.
Installation was into Program Files (x86) for some reason using the administrator account.
When I use JB I do that in a non-administrator account with libraries to create a stack for my 'home'.
Library consists of
D:\me
C:\users\me
All files I create are on D:\me but my %UserProfile% EV is still c:\users\me
I have written many programs on the V1 environment, some I make use of the PDE (Program Development Environment) only and some I create a RTE with a token file and move it to other places. All my programs so far have run only in the execution window. They typically take input from the person in that window, then execute based on that input and output to that window and/or to other files in the computer.
Execution errors:
Open, browse to my directory (d:\me\basic) select a file.
Open a previously written V1.01 source pops a title:
"Error writing Justbasic2.ini"
with text in the OK Box of:
"
Unable to write Justbasic2.ini file. This can happen when running Just Basic from a CDROM. Other causes include restoring from a CDROM or other backup, which can cause all restored files to become write-only, or improper installation of Just Basic
"
If I OK that and open a different Basic file from the same area there is no error. Never does it
remember which file was last edited but it does remember where to look for files with another Open. If I then
create a New file (File > New) enter the program and then File > Save it remembers that it should write in D:\me\basic but also pops the above error OK box. If I OK the Error box the basic file
does get written in D:\me\basic.
I do have permissions to write in all of D:\me and the regular places like the c:\users\me\appdata\...
I don't care where this ini gets put as long as it saves my defaults and stops popping error boxes.
I expect that it is trying to write the INI file in some M$ place (c:\users\me) but can't see through the smoke and mirrors so I don't know where.
\s\Rick
|
|
|
Post by Rod on Nov 9, 2018 13:11:38 GMT
Ok, JB V2.0 is written specifically for UAC compliance so I would stick to JB V2.0 The .ini file is in the %appdata% folder. I can force the error if I click twice to open Just BASIC the first instance opens but the second overlays the first and pops the .ini error message. Be sure you don't have a hung instance of Just BASIC in the background. Either reboot or CtrlAltDel Task Manager and close all instances of Just BASIC or indeed any runtime names you have in play.
The Editor will only remember the last file opened if you have that option ticked in Preferences.
You wont see the .ini if you use the editor to search unless you click to show all files instead of .bas .lsn. tkn subset.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 16:04:34 GMT
TaskManager shows no Just* processes open (show all Users) I double click the shortcut left on the Desktop and an empty Editor Just Basic 2.0 <path> Untitled.Bas shows up. One Just* process shows up in the Task Manager I click File > Exit and the justbasic2.ini error pops.
I see no J* directories in my %Appdata% area. I can create a test directory in this area so I have permission to modify it. I can delete that test directory.
\s\Rick
|
|
|
Post by Rod on Nov 9, 2018 17:12:37 GMT
Reinstall allowing all default directories in the install process to stand. You will get the system files in Program Files (x86)\Just BASIC v2.0 and the sample files and .ini files in %appdata%\Just BASIC v 2.0. You can leave the old v1 in place but if you have set file associations you will need to amend them. So if you double click on a .bas file does it start Just BASIC or did you never bother to set any file associations. Secondary issue to your main error.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 19:32:12 GMT
Click - Light Dawns on Marble Head - no reinstall needed [maybe]! I had said installed by Administrator, run as Me. Well that was literal I login to Administrator and install. Log out, log into Me and try to run when I get the above. Well after your post I logged back into Administrator and went to %appdata% and found ALL the files, including our lovely justbasic2.ini file.
So I can assume if I just transplant all those files into my %appdata% things will be just fine for me and the Administrator (Administrator and Me so I don't sound like my grandkids) without a reinstall?
\s\Rick
|
|
|
Post by Rod on Nov 9, 2018 19:37:25 GMT
You can install as Me and the files will be available to Me. Not sure why an admin install does not make files available to all. One for Carl.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 19:54:58 GMT
I logged into Administrator, used the uninstall.exe I then logged into Me use "Run As Administrator" on jb20setup.exe and had all the stuff in my %Appdata%.
Thanks for the patience. \s\Rick PS interested in the answer from Carl.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 9, 2018 22:08:38 GMT
Hmmm I am not sure I am cured here. I think there might have been some residual benefit of the "Run As Administrator". After I looked again the ini file was not there, in fact none of this was in my %AppData%, it all goes into the Administrator's %AppData% under the benefit of the Run As.
So I did another uninstall followed by another Run As Administrator install and in fact the %AppData% was in the administrator's tree.
So can I just copy it to my %appdata% tree, take ownership of it and more forward? \s\Rick
|
|
|
Post by Rod on Nov 10, 2018 7:49:23 GMT
UAC is designed to allow individual users to instal their own apps and to have those apps protected from other users interference. So simplistic fix is to forget all about your admin account and install as ME. Then login and be ME. That’s what 99% of users do mainly because few folks have any idea what an admin account is.
I have never had the need to install as admin and offer all users access. Someone better versed in UAC would need to comment. But even if you did this I suspect that User files would still be unique to each user.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 11, 2018 0:12:10 GMT
Well I guess I must be in the 1% then. I do believe that letting He or She use a Run As install would work as each would require Administrative access to the system places but then replace all those parts of Program Files (x86) during each install and then install their files in %Appdata% to obtain their INI (an other) file(s). FYI I like using non-administrator accounts for my 'work' a it keeps me from inadvertently clicking on threatening links, suspicious emails, and other things with elevated access and compromising my system. The UAC prompt for the Administrator Password can then be a big red flag.
My workaround was to clone the %Appdata%Just BASIC V2.0\ from the Administrator to Me. That gives me access to my own INI file.
BTW there seems to be more bits and pieces in the INI file than is documented in the Help for V2.0.
thanks to all \s\Rick
|
|
|
Post by Chris Iverson on Nov 14, 2018 15:55:26 GMT
Yes, copying the AppData folder over from the Administrator account would be sufficient to let the program run.
This is the exact same issue that someone on the old LB forum ran into.
My understanding is that he CAN'T install it as himself, as the JB installer(and LB installer) automatically try to elevate to admin. If the account that JB needs to run under isn't an admin, then Windows will ask for a different account's credentials, that DOES have admin permissions.
The install then happens under THAT account.
Problem is, the appdata folders only get created ONCE, and ONLY by the user that installed it. This is fine for a single-use personal machine, but if you have multiple accounts on the system(multiple people using the machine, for example, a whole family each with individual accounts) or you have accounts that don't have admin access(far more common in a business environment), then you need to manually copy the config files around for LB/JB to run properly.
|
|
rickh
Member in Training
Posts: 27
|
Post by rickh on Nov 15, 2018 17:07:45 GMT
Couldn't JB, on first run not finding an INI file offer to create it and he path for me in my AppData? Oops, just looked and the Administrator's AppData is protected against Me (which means I don't have access to the sample .BAS files also). Well then first run [offer to] create the path and empty file, allow the compiler to fill in the file or fill in a set of defaults?
\s\Rick
|
|
|
Post by Chris Iverson on Nov 15, 2018 19:17:14 GMT
That would pretty much be my recommendation now. JB2 is based on the first version of LB that was made NT security-compatible, before we had a clear idea on where things should go.
Now, for any programs I make, I would create any configuration files fresh as defaults if they can't be found.
For LB/JB in particular, since you also have to deal with sample code, I would store the samples and the default config in a folder under either C:\ProgramData(viewable by all users, only modifiable by admins), or JB/LB's Program Files folder. Upon first launch, copy the files to the user's AppData folder.
This would ensure that every user on the system will be able to use JB/LB with no errors, and would also provide each one with a fresh set of sample files, so one person's modifying and playing with it won't affect someone else's.
This does mean taking up slightly more HD space on a single-user system, but the full set of sample and config files from any of the LB/JB installs on my computer are less than 2MB. Even small, portable machines that are available today have 128GB hard drives.
|
|
|
Post by tsh73 on Apr 4, 2019 14:19:45 GMT
Looks like I have my piece of the same.
Installing JB 2.0 on Win 10 Pro 64 bit in restricted environment (I have no administrator password, have to ask admin to enter one then needed)
Setup asked for administrator password after install JB started, I remember seeing examples list
after closing / starting again: error unable to write justbasic2.ini file No folder C:\Users\my_user_name\AppData\Roaming\Just BASIC v2.0 so no examples
no syntax coloring default system font (after creating INI it writes editfont fixedsys 11 )
I was able to create folder. JB created justbasic2.ini in it. Setting setup\preferences got written to it
(likely folder with examples got created under administrator, but I have no rights to get there and see)
I ended up copying that folder from another computer (Win 10 home 32 bit, no extra restrictions), that was installed earlier with no problems.
|
|