Arduino Libraries

Advert

Arduino Libraries

Home Forums Electronics in the Workshop Arduino Libraries

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #31904
    duncan webster 1
    Participant
      @duncanwebster1
      Advert
      #319078
      duncan webster 1
      Participant
        @duncanwebster1

        I've been learning how to use the TM1637 displays, and having sorted it out how to display 4 characters in one line of code I've written a word doc as an aide memoire. The obvious place to file this is in

        Program Files(x86)/Arduino/libaries/TM1637-1.1.0/docs

        but it won't let me. It keeps asking for admin status. I've tried changing the permissions , but it just reverts back straight away. Any gurus out there who know how to do it? I'm on W7

        The chap who helped me sort out the code is a Linux man, won't touch Windows!

        #319120
        Neil Wyatt
        Moderator
          @neilwyatt

          Your computer is trying to protect you.

          Keep your own user libraries separate, otherwise if you have to reinstall you will lose all your own custom libraries.

          Neil

          #319128
          SillyOldDuffer
          Moderator
            @sillyoldduffer

            I agree with Neil about the wisdom of keeping user, system and application files separate. But I also agree with Duncan that keeping the documentation with the library is a good idea as is keeping user libraries with the Arduino libraries. (The problem with creating separate user library folders is telling the Arduino IDE where they are.) Keep separate copies of your libraries as well!

            One way of adding the files is to:

            • As yourself copy the library and word.doc to a USB stick
            • log out and back in again as administrator
            • As administrator create the directory and copy the doc file from the USB stick into it
            • Check the permissions on the directory and file are the same as those of the genuine Arduino libraries.
            • log out as adminstrator
            • log in as yourself and check you can read the document. If it's not visible and readable, it will be a permissions problem: ask again.

            Dave

            #319143
            duncan webster 1
            Participant
              @duncanwebster1

              The library is a standard Arduino, and the folder

              Program Files(x86)/Arduino/libaries/TM1637-1.1.0/docs

              already exists, downloaded from Github I think, but wouldn't swear to it. If I go to 'manage accounts' there is just me as administrator, no-one else, so I presume I am the administrator. I tried creating a new folder

              Program Files(x86)/Arduino/libaries/TM1637-1.1.0/More Docs

              which it let me do, but then it wouldn't let me paste in the .doc. If I click on security for the More Docs file, and then on Administrators and Edit, all the sensible boxes are ticked, but greyed out

              I then tried going up a level into Arduino/libraries, I can create a folder but not put anything into it. If I had any hair I'd tear it out!

              #319155
              SillyOldDuffer
              Moderator
                @sillyoldduffer

                Bear with while I switch to Windows and have a look at the gory details.

                Nothing whatever to do with the Arduino problem but it's not a good idea to operate Windows as a user with admin privileges. If you catch anything nasty off the web it will have full access to your machine. Safer to use Windows as an ordinary user to stop any intruders getting full privileges and use the admin account just for admin.

                Dave

                #319165
                SillyOldDuffer
                Moderator
                  @sillyoldduffer

                  Hmmm. I've not been able to replicate the fault yet.

                  There are two download types available on the Arduino website.

                  The first is a Windows Installer. It installs the Arduino application and files under ProgramFiles(x86), which is what you have Duncan. I ran the install as an ordinary user; it asks for the admin password and then does it's stuff. Then, I can create folders and copy files to them even though they're under ProgramFiles(x86); again I'm asked for the admin password.

                  The second is a plain zip file. You can unpack this anywhere in your user folder space. The Arduino IDE is activated by navigating to the app file and double clicking it. This install method does not need admin privilege and you have full access to all the folders. (This is how I would install and use it.)

                  I think what's happened is that a permission is mis-set somewhere in your ProgramFiles(x86)/Arduino file strructure. Note that being administator does not automatically ignore permissions; rather it allows you to change them as necessary to allow files to be modified. Trouble is you have to search for the one (or more) permissions that are wrong. The easiest way to fix it might be to Uninstall and re-install the IDE (perhaps using the zip method). I recommend creating an ordinary user account and doing the work from there.

                  Off to try a direct install as admin next; I'll shout if that lets me recreate your problem!

                  Dave

                   

                  Edited By SillyOldDuffer on 28/09/2017 21:40:44

                  #319171
                  duncan webster 1
                  Participant
                    @duncanwebster1

                    I can't remember how I installed the main IDE, but this latest library was downloaded as a zip, extracted and pasted into Program Files(x86)/Arduino/libaries. This is bizarre, if I can paste in a whole directory why can't I paste a file into that directory?

                    Program Files(86) says read only (only applies to files in folder

                    dittoProgram Files(86)/Arduino

                    and the same for Program Files(x86)/Arduino/libaries

                    #319172
                    Enough!
                    Participant
                      @enough
                      Posted by duncan webster on 28/09/2017 10:58:18:

                      The obvious place to file this is in

                      Program Files(x86)/Arduino/libaries/TM1637-1.1.0/docs

                      but it won't let me. It keeps asking for admin status.

                      Windows post XP considers The Program Files trees protected locations. You can install there but it won't normally allow you or anything/one else to write data there.

                      Data should be written in the appropriate location under c:users. In fact, if the Arduino IDE is properly written it should placing user-generated data, after the initial install, under c:users.

                      The protection of this area can (I believe) be bypassed temporarily but frankly you'd be making a rod for your own back.

                      #319174
                      duncan webster 1
                      Participant
                        @duncanwebster1

                        All my sketches go into

                        C:UsersDadDocumentsArduino

                        should I just open a docs folder in that and put the extra info in there?

                        #319175
                        duncan webster 1
                        Participant
                          @duncanwebster1

                          Ah, the penny is beginning to drop, and I think this might be what SOD was trying to tell me before. If I open the version of the library that is still sat on my desktop from when I unzipped it I can paste stuff in, so if I delete the one in program files (x86) and copy this modified one in it should work? Time to take the dog out now, so I'll try it tomorrow and let you know.

                          #319180
                          Enough!
                          Participant
                            @enough
                            Posted by duncan webster on 28/09/2017 23:19:56:

                            All my sketches go into

                            C:UsersDadDocumentsArduino

                            should I just open a docs folder in that and put the extra info in there?

                            If it's a Word document you can put it more or less wherever you like outside the Program Files trees. For instance "My Documents" if you use that in Word. But if you want to keep it with your other Arduino stuff, then where you suggest would make sense.

                            [ This whole topic of data in Program Files directories comes up regularly in the Eudora mailing list. Being an old (but very clever) email client, it defaults to putting data files (mailboxes) in the same directory as the program – as was common in the old days. These days, Windows will allow the Eudora installer to write the initial files there but won't allow further writes when you run the program. Fortunately the Eudora installation only defaults to that location if you don't tell it otherwise. It's more than happy if you want them somewhere else (and gives you the opportunity to so specify).

                            Incidentally Eudora was written in Windows 9x days and has been "obsolete" since about 15 years ago when Qualcom stopped developing it and released it into the public domain. It continues to work on all subsequent versions of Windows up to and including Win-10. It still has many users. Including DC1 here iirc. ]

                            #319207
                            duncan webster 1
                            Participant
                              @duncanwebster1
                              Posted by duncan webster on 28/09/2017 23:30:27:

                              Ah, the penny is beginning to drop, and I think this might be what SOD was trying to tell me before. If I open the version of the library that is still sat on my desktop from when I unzipped it I can paste stuff in, so if I delete the one in program files (x86) and copy this modified one in it should work? Time to take the dog out now, so I'll try it tomorrow and let you know.

                              Well that worked, thanks chaps. If I'd filed it somewhere else, I'd have forgotten where I'd put it, or perhaps that it even existed. Been there, done that

                              thanks again

                              #319212
                              SillyOldDuffer
                              Moderator
                                @sillyoldduffer

                                Ah Duncan, you've been too clever for your own good. You've manually plonked a user program into system space.

                                Bit of explanation:

                                Operating systems take considerable care to protect sensitive parts of the system from the user, and users from other users. For example, a user is never allowed to write to someone else's memory. There are quite a few different 'users' on most systems other than real people, for example there's one to handle printing. One of the true negatives of MS-Windows is that domestic versions allow ordinary users to set themselves up as administrators. One bad effect is that warning messages are suppressed and the user isn't warned he's doing anything unwise. Admin privileges make life very easy until you make a mistake. Then most people discover they don't have the admin training needed to fix admin mistakes. This is why Windows has restore points; with luck it's possible to undo the mistake, though a restore will also throw away all your good changes.

                                When you run a Windows Installer it does more than unpack files and copy them on to the hard drive. It also knows what permissions are required and sets them appropriately. By installing into the shared system folders, it can make the program available to all users on the computer. The installer likely does a lot of other clever stuff too, such as dependency checks, creating icons and setting the Registry etc.

                                It happens that the Arduino IDE can also be 'installed' by a single user copying it into one of his private folders . This 'install' is a simple copy. When done that way, the permissions don't need any special treatment. It just works. The down side is that the installation is private to the user who installed it, not shared. (This probably doesn't matter.)

                                Sounds as if Duncan's installation created a hybrid. The IDE was manually copied into system space without making the necessary changes to the permissions. The IDE works anyway, but there's an unexpected permissions problem when Duncan tries to write a file.

                                Fixing this manually is certainly possible but it might require a lot of detective work. Instead I'd delete the Arduino folder, and re-install the IDE using the Windows Installer Option. That should rebuild the IDE under ProgramFiles with the right permissions.

                                Once that's done the problem should disappear. Fingers crossed and don't forget to sacrifice a virgin first.

                                Dave

                                 

                                 

                                 

                                Edited By SillyOldDuffer on 29/09/2017 11:22:39

                                Edited By SillyOldDuffer on 29/09/2017 11:24:38

                              Viewing 14 posts - 1 through 14 (of 14 total)
                              • Please log in to reply to this topic. Registering is free and easy using the links on the menu at the top of this page.

                              Advert

                              Latest Replies

                              Viewing 25 topics - 1 through 25 (of 25 total)
                              Viewing 25 topics - 1 through 25 (of 25 total)

                              View full reply list.

                              Advert

                              Newsletter Sign-up