Help with File.Run()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dfridenour
    Indigo Rose Customer
    • Feb 2009
    • 4

    Help with File.Run()

    I'm simply trying to get File.Run to work no matter where the CD image is... Could be on you hard drive, could be on a network share... What I find is my code works on a local drive, but not when the AutoPlay is started from a UNC share... My code:

    sLaunchFolder = Folder.GetCurrent();
    sInstallFolder = sLaunchFolder.."\\XMSetup\\";
    sInstallExe = sInstallFolder.."setup.exe";
    Dialog.Message(sInstallFolder, sInstallExe);
    File.Run(sInstallExe, "", sInstallFolder, SW_SHOWNORMAL);

    The dialog contains the UNC path as expected but the setup does not run. Any help here would be fantastic. Thanks in advance.
  • Desrat
    Forum Member
    • Nov 2006
    • 240

    #2
    Try the following

    Code:
    sLaunchFolder = Folder.GetCurrent();
    sInstallFolder = sLaunchFolder.."\\XMSetup";
    sInstallExe = sInstallFolder.."[COLOR="Red"][B]\\[/B][/COLOR]setup.exe";
    Dialog.Message(sInstallFolder, sInstallExe);
    File.Run(sInstallExe, "", sInstallFolder, SW_SHOWNORMAL);

    Comment

    • dfridenour
      Indigo Rose Customer
      • Feb 2009
      • 4

      #3
      No... Sorry does not make any difference in running from a UNC.

      I must admit it's a fairly long UNC... \\rsi-midas\Product_BUs\Business Development\Prerelease\Wyvern\Dave\XMSetup\setup.e xe

      (don't know why the post editor puts a space in .exe - but I don't have one in the code)

      Runs fine from any place on local drive, but not UNC. Other ideas?

      Thanks again ! ! !

      Comment

      • mwreyf1
        Indigo Rose Customer
        • Aug 2004
        • 417

        #4
        How are you compiling it?

        It works for me compiled as a Hard Drive folder.

        Keep in mind that your compiled AMS would need to reside 1 level above the "XMSetup" folder to work.

        FYI...My UNC was even longer than yours, so that's not your problem.
        Last edited by mwreyf1; 02-26-2009, 12:59 PM.

        Comment

        • dfridenour
          Indigo Rose Customer
          • Feb 2009
          • 4

          #5
          Yeah... I'm compiling to a hard drive folder... I just have an 'Output' folder on disk. I have autoplay enabled and I build setup.exe. The 'Output' folder has an existing directory structure below it with the target setup.exe (an MSI) that clicking on the label should run. Again it works fine anywhere on the local hard drive, but not at that UNC path. I also verified that just opening the folder below the autoplay (named XMSetup), I can dbl click and run the setup.exe.

          Another point or two:
          I also have some release notes that I open with another label using the following code:
          Code:
          sLaunchFolder = Folder.GetCurrent();
          sRN = sLaunchFolder.."\\ReleaseNotes.htm";
          Dialog.Message("ReleaseNotes", sRN);
          File.Open(sRN, "", SW_SHOWNORMAL);
          That DOES work on the UNC. Launches IE with the htm file. I have another label that launches AdobeReader install - same results as my MSI. So, .Open works, but .Run does not.

          Also I am runnning Autoplay 7.1.1007.0 if that makes an diff...

          Comment

          • Desrat
            Forum Member
            • Nov 2006
            • 240

            #6
            you tried using shell.execute instead of file.run?

            Comment

            • dfridenour
              Indigo Rose Customer
              • Feb 2009
              • 4

              #7
              Shell.Execute works like a champ ! ! !

              Thanks to all... Owe you a beer!

              Comment

              Working...
              X