How do I use nw.js 'Run file' command right?

0 favourites
  • 14 posts
From the Asset Store
Voice command game
$9.50 USD
50% off
In this game you will command the character by voice command.
  • I've tried doing it like this:

    On start of layout            |  System            |Set OrgScreenWidth to Browser.ScreenWidth
                                     System           | Set OrgScreenHeight to Browser.ScreenHeight
                                     NodeWebkit       | run "qres_launcher.exe"
    [/code:he4y11st]
    ... and nothing gets run. Am I misunderstanding something here?
  • Been a while since I've used it, but doesn't NW.js require the full file path to the file?

  • Mm, I tried it and there's no difference. So weird.

  • Maybe try including the Apllication path prefix i.e. NWjs.AppFolder & "filename.exe"'.

  • Didn't help either unfortunately :/ Ah well, I'll just let it be for now I think.

  • Testing it in windows 7 it seems you can't run the exe if it's in certain locations.

    If I run:

    "c:\windows\notepad.exe"

    It works, but if I copy notepad to "c:\tmp" and try to run that:

    "c:\tmp\notepad.exe"

    It doesn't work.

    I'm guessing it may be some security block, but i'm not sure.

  • Doesn't work from NWjs.UserFolder, either. This is most bothersome.

    Most bothersome indeed.

  • KodeMonkee

    Doesn't work from NWjs.UserFolder, either. This is most bothersome.

    Most bothersome indeed.

    I just tested using latest r218 and NWjs alpha7 and it worked for me.

    Set a variable(fpath) to an mp4 file off Userfolder, then called runfile:

    On Button Clicked - NWjs Run NWjs.UserFolder&fpath[/code:vq2zeec4]
    
    It accessed the mp4 and ran it's associated launch program (Vlc).
    
    Is this the type of thing you were attempting?
  • It works for me now after swapping the NodeWebkit object for nwjs. Curious where the nwJS.UserFolder is at exactly tho. nwJS preview apparently uses its own location too.

  • you could try to run .bat files

  • It works for me now after swapping the NodeWebkit object for nwjs. Curious where the nwJS.UserFolder is at exactly tho. nwJS preview apparently uses its own location too.

    nwjs.UserFolder is usually (on Windows) C:\Users[USERNAME][/b]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello, I need to open a pdf file imported in my program both on Win and Mac.

    It opens perfectly on Windows but nothing happens on Mac.

    Does "Run file" command work on MacOS ? What are the tricks to make it work ?

    Thanks for your help !

  • Hi again, folks.

    I've been searching here and there about this problem and still have not found a solution.

    My problem :

    I've exported my project as a NWjs projector on both Mac and PC.

    when I use -> NWjs: Run "MATERIEL1.pdf" command (with MATERIEL1.pdf being a file imported in my project) :

      The windows version will open the PDF with acrobat.
      The Mac version, however, will not do anything at all.

    Any help would be greatly appreciated !

  • I'm not an expert on Mac, but I assume it is simply a permissions/security issue where Apple doesn't want to let your program to launch other programs to execute data from your project.

    Either that or the Mac didn't have a default program set to open PDF files.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)