Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417

    Application path difference between "File.Run" and "FileRunAs"

    Has anyone else experienced a problem with FileRunAs not being able to find the file pointed to in the args section of the action.

    Here is an example of my problem.

    This code works correctly running from a CD (D: drive on my test system).
    Code:
    File.Run("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);
    Yet, this code does NOT work. (also D: drive on my test system).
    Code:
    File.RunAs("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    You would think there would be no difference between the way File.Run and File.RunAs would handle this same string but AMS cannot locate the MSI when using File.RunAs. It almost seems like a bug.

    If I hardcode the CD drive letter to the string such as below...It works.
    Code:
    File.RunAs("MsiExec.exe", "/I \"D:\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    Any help would be greatly appreciated.
    TIA!

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by mwreyf1 View Post
    Has anyone else experienced a problem with FileRunAs not being able to find the file pointed to in the args section of the action.

    Here is an example of my problem.

    This code works correctly running from a CD (D: drive on my test system).
    Code:
    File.Run("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);
    Yet, this code does NOT work. (also D: drive on my test system).
    Code:
    File.RunAs("MsiExec.exe", "/I \"AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    You would think there would be no difference between the way File.Run and File.RunAs would handle this same string but AMS cannot locate the MSI when using File.RunAs. It almost seems like a bug.

    If I hardcode the CD drive letter to the string such as below...It works.
    Code:
    File.RunAs("MsiExec.exe", "/I \"D:\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true, "username", "passwd", "", LOGON_NO_OPTION, nil, nil);
    Any help would be greatly appreciated.
    TIA!
    Code:
    File.Run("MsiExec.exe", "/I \"".._SourceDrive.."\\AppFolder\\My.msi\"/qn", "", SW_SHOWNORMAL, true);

  3. #3
    Join Date
    Aug 2004
    Location
    Somewhere in Texas, USA
    Posts
    417
    @ShadowUK

    Thanks!

    That worked.

    I had tried using the _SourceDrive with no success. Helps having a new set of eyes.

    Wish AMS had a MSI.RunMsiexecAs action.

Posting Permissions

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