Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

dir_create_recurse and Vista

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    dir_create_recurse and Vista

    I don't have a Vista machine available to test this on but have suspicions that it may be a problem.

    Can anybody verify whether or not there are issues using Dir_create_recurse() to build a new folder under C:\Users\<UserName>\Application Data\Alpha Software\Alpha Five Version 8?

    Note: I'm not sure that the path defined above is exactly correct for Vista. I get the base path from the registry and just tack on the A5 stuff. I presume the path I use should be correct because it works on XP and the registry key is the same in both systems. Wherever the A5 files go in Vista is what I'm looking for. I want to add a new folder under the "Alpha Five Version 8" folder but it doesn't seem to be working. However, I'm not sure if the problem is with creating the folder, adding the file to the folder, or something else.

    #2
    Re: dir_create_recurse and Vista

    Cal, I believe the path you are looking for is:

    C:\Users\<user name>\AppData\Roaming\Alpha Software\Alpha Five Version 8

    Vistas Application Data directory is accessible via the AppData directory.

    Comment


      #3
      Re: dir_create_recurse and Vista

      Yes. I had the path wrong in my message but that path name isn't the problem. (It was a bit hard for me to verify the exact path when I don't have a Vista machine but I do get the path from the registry at: HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData)

      Can anybody verify whether or not there are issues using Dir_create_recurse() to build a new folder? (It works fine in XP so I'm wondering if there is some security issue that's keeping this from being created in Vista.)

      In other words, assuming that the AppData path is correct, can the autoexec script add "MyTestFolder" as shown here:

      C:\Users\<user name>\AppData\Roaming\Alpha Software\Alpha Five Version 8\MyTestFolder

      HMMM, now that I look at that, is it possible that the value in the AppData key doesn't include the "Roaming" folder? If not, how do I know for sure that "Roaming" is needed?

      Comment


        #4
        Re: dir_create_recurse and Vista

        Yup the key does have it:

        F:\Users\Clyde Tilley\AppData\Roaming

        straight from the registry on my machine.

        Might be a UAC issue. I have it turned off, so I have no problem creating. I would turn it back on to test it for you, but when I tried that once before it scr**ed up a my backup app, so I'm hesitant to try it again.

        Maybe someone else with UAC turned on can try it. Since this should be an allowable directory (apps need to write here) I wouldn't think it would be UAC, bit can't think of any other reason why it wouldn't work.

        Comment


          #5
          Re: dir_create_recurse and Vista

          Hi Cal,

          Originally posted by CALocklin View Post
          I don't have a Vista machine available to test this on but have suspicions that it may be a problem.

          Can anybody verify whether or not there are issues using Dir_create_recurse() to build a new folder under C:\Users\<UserName>\Application Data\Alpha Software\Alpha Five Version 8?

          Note: I'm not sure that the path defined above is exactly correct for Vista. I get the base path from the registry and just tack on the A5 stuff. I presume the path I use should be correct because it works on XP and the registry key is the same in both systems. Wherever the A5 files go in Vista is what I'm looking for. I want to add a new folder under the "Alpha Five Version 8" folder but it doesn't seem to be working. However, I'm not sure if the problem is with creating the folder, adding the file to the folder, or something else.
          I don't know if going to the registry key is the right way in A5 to do this. To get some key directories and path (independent of version), I use code like this, which should work always to the future (essentially putting path issues in Alpha Software's court). However, for older version code, you might be forced to getting registry keys, but that would always be my last resort.

          Code:
          dim a5ver as n
          a5ver=version()
          dim addinsys as c
          dim addinusr as c
          dim exenam as c
          dim apppth as c
          dim addinlib as c
          IF (a5ver)>=8
              addinsys=a5_getaddinsinstalledfolder()
              addinusr=a5_getaddinsinstalledfolder("user")
              exenam=a5.get_exe_name()
              apppth=a5_getapplicationdatafolder()
              addinlib=a5_getaddinlibraryfilename()
          ELSE
              addinsys=A5.GET_EXE_PATH()+chr(92)+"addins_installed"
              addinusr=addinsys
              exenam="Alpha5.exe"
              apppth=A5.GET_EXE_PATH()
              addinlib=A5.GET_EXE_PATH()+chr(92)+"addin_library.aex"
          END IF
          As to the Vista issue, I have a Vista machine, but no A5V8 on it, so I can't check that issue out for you.
          Regards,

          Ira J. Perlow
          Computer Systems Design


          CSDA A5 Products
          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
          CSDA Barcode Functions

          CSDA Code Utility
          CSDA Screen Capture


          Comment


            #6
            Re: dir_create_recurse and Vista

            Well, here's what I found out tonight. The path is NOT the issue. (But thanks Ira, I wasn't aware of those a5v8 commands for getting the A5 folders.)

            I got access to a Vista machine which had the folder:
            C:\Users\<UserName>\AppData\Roaming\Alpha Software\Alpha Five Version 8

            It did NOT have a "toolboxes" folder.

            My autoexec included the following script section:
            Code:
            base_fname = "\MyFileName.txt"
            appdata = registry.sys_get("HKey_Current_User\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData")
            addin_root = appdata + "\Alpha Software\Alpha Five Version " + ltrim(str(version()))
            toolbox_path = addin_root + "\toolboxes"
            file_name = toolbox_path + base_fname
            IF .not. file.exists( toolbox_path + "\." )
               dir_create_recurse( toolbox_path )
            END IF
            THIS ROUTINE CREATES THE SPECIFIED FOLDER PATH PERFECTLY EVERY TIME IN XP.

            The folder was NOT created on the Vista machine after running the autoexec.

            I got an error message which was probably not a direct result of the Dir_Create_Recurse() command. The error message said the PATH "C:\Users\<UserName>\AppData\Roaming\Alpha Software\Alpha Five Version 8\toolboxes\MyFileName.txt" could not be found. Note that the error referred to the path but it actually showed the full path and file name.

            Shortly after attempting to create the folder, the script tests to see if the file is there (obviously the file should be there after the first time the app runs) with another complicated line of code:

            file_there = file.exists( file_name )

            Although this would seem to match with the error message, the "file.exists()" function normally doesn't (and shouldn't) cause an error message when the file isn't found. After all, that's the purpose of the command!

            Since the Dir_Create_Recurse() command knows nothing about the actual filename, I have to assume that the error message occurred when the script attempted to create the file a bit later using:

            fp = file.create( file_name, FILE_RW_EXCLUSIVE )

            No attempt is ever made to actually read the file from the autoexec. (At least, not unless File.Exists() returns .T.)

            I was able to open Explorer in Vista and create the "toolboxes" folder with no problem. (In other words, it doesn't appear to be an access/security problem.) After creating the folder manually and running the routine again, the file was placed in the folder by the autoexec routine as it should have been. This indicates to me that everything was working correctly, including getting the path correct, except that the folder was not able to be created with the Dir_Create_Recurse() command.

            My conclusion: The Dir_Create_Recurse() function can't be relied on in Vista because it doesn't work there as expected. This seems like a major issue to me.

            So, back to my original question - Can anybody verify whether or not there are issues using Dir_create_recurse() to build a new folder on a VISTA machine under C:\Users\....\Alpha Software\Alpha Five Version 8?

            Edit: Or possibly the problem is in the original File.Exists() function and Vista doesn't like the 'structure' I used for checking for the existence of the "toolboxes" folder by checking for the "." file? (Who knows how many long time standards have been changed in Vista?)

            If you do it in the Interactive Editor and it works, I suggest trying it in the autoexec and restarting the app to check it in "real life" - just in case.

            Yes, there are workarounds to my problem. Since I've already created one, please don't waste time telling me how to work around this issue. I only want to find out if this problem can be confirmed by another developer.

            Comment


              #7
              Re: dir_create_recurse and Vista

              I received a private message from someone who ran a similar test on his machine and it worked fine for him.

              So, I'm baffled but can't run any additional tests at this time because I don't have a Vista machine readily available. If I ever get more info about what caused this problem, I'll post it here.

              Comment


                #8
                Re: dir_create_recurse and Vista

                Sorry Cal, I forgot to mention that I had tested it & it worked - but again I have UAC turned off. We would really need for someone with UAC turned ON to test it to see if there is a problem. However, since this is in the user directory, it shouldn't be a problem. (that's why it's there)

                Comment


                  #9
                  Re: dir_create_recurse and Vista

                  I believe the other guy did have UAC turned on.

                  I wish I had a Vista machine because I'd really like to know why it didn't work for me (my client) on at least 2 machines but it seems to be working for others. There has to be something different about what I was doing but I can't figure out what it would be. Oh well, one of these days I will be forced to update to Vista and then maybe I'll figure it out.

                  "However, since this is in the user directory, it shouldn't be a problem. (that's why it's there)"
                  I agree. That's why it seems so baffling to me. The fact that it works in XP makes it even more baffling.

                  Grasping at straws, maybe it has something to do with the fact that it's actually part of a function in an aex file that's loaded with Load_Library() early in the autoexec then the function is also called from the autoexec?? On the other hand, I keep coming back to the fact that it works in XP.

                  Comment


                    #10
                    Re: dir_create_recurse and Vista

                    The following was done with a non-admin local Vista account:

                    Code:
                    ?osversion()
                    = "6.0"
                    
                    ?osname()
                    = "Microsoft Windows Vista"
                    
                    ?registry.sys_get("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA")
                    = "1"	'UAC enabled
                    
                    dn = a5_getapplicationdatafolder() + "\folder1"
                    ?dn
                    = "C:\Users\TestUserNA\AppData\Roaming\Alpha Software\Alpha Five Version 8\folder1"
                    
                    ?a5_is_path_valid(dn1)
                    = .F.
                    
                    ?dir_create_recurse(dn)
                    = .T.
                    
                    ?a5_is_path_valid(dn1)
                    = .T.

                    Lenny Forziati
                    Vice President, Internet Products and Technical Services
                    Alpha Software Corporation

                    Comment

                    Working...
                    X