Alpha Video Training
Results 1 to 3 of 3

Thread: Launching as another user works with Developer(Full) but not Runtime

  1. #1
    Member ahope86's Avatar
    Real Name
    Amanda Hope
    Join Date
    Mar 2017
    Location
    New Hampshire
    Posts
    18

    Default Launching as another user works with Developer(Full) but not Runtime

    Good Afternoon,

    Due to the need to lock down the database directory, we need to run alpha as another user (a service account specifically for this purpose), and deny access to standard users.

    We had this working perfectly on our Developer versions, but when we adjusted the path to launch the Runtime version for our users, it no longer works properly.

    The Alpha application still launches and is running as the correct user, however it does not open to the specified database.

    The only difference being the path to the program, "C:\Program Files (x86)\a5V12" for Developer and "C:\Program Files (x86)\a5V12 Runtime" for runtime.

    We have narrowed down the issue to being the autoexec file failing to play, but are unable figure out why.

    The issue occurs when launching from command line using runas or via the below powershell.

    Both commands work to launch the Developer version, but neither work to launch Runtime.

    The error displayed by alpha upon loading is:
    Code:
    Script:a5_dictionary_read() line:149
    Table is encrypted using a different key
    Works
    Code:
    Start-Process -Credential $credential -FilePath "C:\Program Files (x86)\a5V12\alpha5.exe" -WorkingDirectory "C:\Program Files (x86)\a5V12\" -ArgumentList $path,$start
    Does NOT Work
    Code:
    Start-Process -Credential $credential -FilePath "C:\Program Files (x86)\a5V12 Runtime\alpha5.exe" -WorkingDirectory "C:\Program Files (x86)\a5V12 Runtime\" -ArgumentList $path,$start
    Works
    Code:
    DIM path      AS C
    DIM startup AS C
    DIM cmd      AS C
    
    path = "\\server\alpha\data base.adb"
    
    startup = stritran(path,".adb",".startup")
    
    'chr(92) = backslash which is needed to format the cmd string as needed by runas.exe due to spaces in paths
    'the following line generates this string:
    'runas.exe /user:swc\alpha /savecred "\"C:\Program Files (x86)\a5V12\alpha5.exe\" \"\\server\alpha\data base.adb\" \"-INCLUDE=\"\\server\alpha\data base.startup\"\""
    
    cmd = "runas.exe /user:swc\alpha /savecred \"" + chr(92) + "\"C:\Program Files (x86)\a5V12\alpha5.exe" + chr(92) + "\" " + chr(92) + "\"" + path + chr(92) + "\" " + chr(92) + "\"-INCLUDE=" + chr(92) + "\"" + startup + chr(92) + "\"" + chr(92) + "\"\""
    
    run(cmd,.F.)
    Does NOT Work
    Code:
    DIM path      AS C
    DIM startup AS C
    DIM cmd      AS C
    
    path = "\\server\alpha\data base.adb"
    
    startup = stritran(path,".adb",".startup")
    
    'chr(92) = backslash which is needed to format the cmd string as needed by runas.exe due to spaces in paths
    'the following line generates this string:
    'runas.exe /user:swc\alpha /savecred "\"C:\Program Files (x86)\a5V12 Runtime\alpha5.exe\" \"\\server\alpha\data base.adb\" \"-INCLUDE=\"\\server\alpha\data base.startup\"\""
    
    cmd = "runas.exe /user:swc\alpha /savecred \"" + chr(92) + "\"C:\Program Files (x86)\a5V12 Runtime\alpha5.exe" + chr(92) + "\" " + chr(92) + "\"" + path + chr(92) + "\" " + chr(92) + "\"-INCLUDE=" + chr(92) + "\"" + startup + chr(92) + "\"" + chr(92) + "\"\""
    
    run(cmd,.F.)

  2. #2
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,626

    Default Re: Launching as another user works with Developer(Full) but not Runtime

    I've never like having a space in an objectname.

    data base.adb

    rename to

    database.adb

    along with the the other associated files. .alm, alx, .alb (my fav)
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  3. #3
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,698

    Default Re: Launching as another user works with Developer(Full) but not Runtime

    Another good example of why I don't ever put Alpha in the Program files directory...

    If the developer files are in A5v12, is the path to the runtime another directory or a subdirectory? Ex: A5v12\Runtime and not A5v12 Runtime? If the latter, try getting rid of the space or include an underscore, or perhaps shorten the directory name to A5v12RT.

    And then you will either need to reinstall the runtime or edit the registry.
    Last edited by MoGrace; 08-02-2019 at 01:03 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Help Wanted - Full time Alpha Developer
    By VWitter001 in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 03-05-2017, 07:16 AM
  2. Import does not work in runtime but works in full development version
    By jorgecardenas1 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 1
    Last Post: 12-02-2009, 11:24 AM
  3. Launching Default Runtime
    By John Psihos in forum Alpha Five Version 5
    Replies: 2
    Last Post: 07-29-2003, 04:59 PM
  4. ShortCut works with Full version, not runtime
    By Jim Chapman in forum Alpha Five Version 5
    Replies: 9
    Last Post: 03-12-2003, 06:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •