folderitem.launch does not launch PDF

  1. last week

    Matthew G

    Feb 16 Pre-Release Testers, Xojo Pro Palmerston North, New Zealand

    Hi all - I have a Windows client evaluating our payroll software, and we supply various PDF documents in a man subfolder, and generate a number of PDF output files (tax certificates etc)...but at this particular site it seems that f.launch (f being the PDF) doesn't do anything - no error, just nothing.

    This is the only site I've ever seen that doesn't open a PDF in whatever viewer they use.

    If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).

    Perhaps this could be a profile security issue? Anyone encountered such weirdness (and hopefully a solution)?

    Many thanks.

  2. Dave S

    Feb 16 San Diego, California USA

    Silly question... but are you sure the path information in "F" is 100% correct?
    put a break at the Launch and examine it.... it needs to be the FULL path to the document

  3. Matthew G

    Feb 16 Pre-Release Testers, Xojo Pro Palmerston North, New Zealand

    Works in *almost* 100% of cases - this is the only time I've ever seen or heard of it not working (out of 1000's of sites).

    Function HelpThepayprocess() As Boolean
      dim f as FolderItem
      
      if Develop() then
        f=GetFolderItem("man").Child("PDF").Child("Pay Process.pdf")
      else
        f=GetFolderItem("man").Child("Pay Process.pdf")
      end
      
      if f.Exists then
        f.Launch
      else
        MsgBox("File not found"+EndOfLine+EndOfLine+"Sorry, the file Pay Process.pdf isn't where it should be"+EndOfLine+EndOfLine+"Please visit the website for the latest documentation (Help..Website)")
      end
      
      Return True
      
    End Function
  4. Dave S

    Feb 16 San Diego, California USA

    and if you do a break point at LAUNCH it does in fact stop there? but then "nothing happens"
    what is f.lasterrorcode?

  5. Jared F

    is not verified Feb 16 Pre-Release Testers, Xojo Pro Milwaukee, WI

    Is it possible that they do not have a PDF viewer installed, or don't have a default application selected for PDF files?

  6. Matthew G

    Feb 16 Pre-Release Testers, Xojo Pro Palmerston North, New Zealand

    Thanks Dave

    No idea - the site is in the Cook Islands, I'm in New Zealand. The price we sell a product for doesn't permit writing a custom build and deploying it for a problem that exists on one machine and works flawlessly everywhere but there...I could log it in the next build but I'm pretty suspicious of the machine itself or a security or profile setting somewhere...so , it'll take some time to get any in-depth info about f.lasterrorcode (good idea, I'll log it)

    If I open the man folder and double-click the PDF document it opens fine in Adobe Reader (so it seems the default file association is set up correctly).

    I'm going to suggest they try it on a different machine - if the same thing happens then I'll be sure that their security profile (or whatever) is affecting the app's ability to launch a PDF (they're on Windows 7 Service Pack 1 (Build 7601)) - and if that's the case then I still don't have a solution - maybe move them to our cloud edition (love XojoWE)

  7. Michel B

    Feb 16 Pre-Release Testers, Xojo Pro

    I would instruct them how to install PDF Reader. It's probably the problem. Windows 7 has nothing in the default system to read PDF.

  8. Have they run (or you remotely) the application as ADMIN? Maybe their security (as you say) prevents your app from launching the application from within. You could also try to shell to it, but you said creating a custom build is not an option.

  9. Matthew G

    Feb 16 Pre-Release Testers, Xojo Pro Palmerston North, New Zealand

    Thanks Michel and Langue - the user is able to install the software, but we could try running it explicitly as Admin and see what happens. They're installing a trial on a different machine to assess if it's global at their site (then it's security - it is a gov site...), otherwise just the original PC - and maybe reinstalling the reader will correct the problem (though as I've said already the association appears to work correctly - double-clicking the pdf itself opens OK in Adobe Reader - man I hate windows.

  10. Matthew G

    Feb 16 Pre-Release Testers, Xojo Pro Palmerston North, New Zealand

    Ok - Ive added this to the code and it'll log any errors (and display it). Weird.
    if f.LastErrorCode <> 0 then WriteError("Cannot open "+f.ShellPath+": error code "+str(f.LastErrorCode)) end

    Thanks - I'll report back if I find out anything useful :-)

  11. Dave S

    Feb 16 San Diego, California USA

    bit nit-picky, but I'd change that to NATIVEPATH instead of SHELLPATH.. but thats just me :)

  12. Michel B

    Feb 17 Pre-Release Testers, Xojo Pro

    @Dave S bit nit-picky, but I'd change that to NATIVEPATH instead of SHELLPATH.. but thats just me :)

    On PC, it is exactly the same thing.

  13. 7 days ago

    Matthew G

    Feb 17 Pre-Release Testers, Xojo Pro Answer Palmerston North, New Zealand
    Edited 7 days ago by Matthew G

    Definitely just that machine - another at the same site works just fine.

    IT will reinstall reader to see if that resolves the issue...ball in their court.

or Sign Up to reply!