Standalone File Path Incorrect

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Standalone File Path Incorrect

Post by nicoloose » Wed Feb 03, 2016 2:16 pm

I have built a standalone app that connects to MySQL DB. When printing a report with Quartam, the standalone will not find the .qll file and display an error with a filepath that does not reflect the actual path given during testing.

Code: Select all

put defaultFolder & "/costofsales" into tLayoutFile
   put the long ID of me into tDataBroker
   put true into tShowPreview
   -- print the report
   qrtReports_PrintReport tLayoutFile, tDataBroker, tShowPreview
See attached.

Please help.
Attachments
Screen Shot 2016-02-03 at 3.10.01 PM.png

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone File Path Incorrect

Post by Klaus » Wed Feb 03, 2016 3:02 pm

Hi Nico,

well, things are different on Mac OS X in a standalone! :D
Did you use the "Copy files" tab in the standalone builder settings to add your "layout" file(s)?

If yes then you need to:
...
put specialfolderpath("resources") & "/costofsales" into tLayoutFile
...
If not, please tell us where you put your files.

Hint:
specialfolderpath("resources") does also work in the IDE!
It will return folder where the stack resides which will turn into the standalone,
so you could use this specialfolderpath thorughout!


Best

Klaus

nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Re: Standalone File Path Incorrect

Post by nicoloose » Wed Feb 03, 2016 3:14 pm

Hi Klaus,

All my files sit in the same directory as the standalone. Since this is just an internal app, I manually copy everything I need.

Nic

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone File Path Incorrect

Post by Klaus » Wed Feb 03, 2016 3:18 pm

OK, but "the defaultfolder" is not the one you are exspecting in an OS X standalone, as you now know! 8)
It is the folder where the APP package resides in and not "ManufacturingPro.app/Contents/MacOS"!

nicoloose
Posts: 99
Joined: Mon Sep 16, 2013 3:35 pm

Re: Standalone File Path Incorrect

Post by nicoloose » Thu Feb 04, 2016 1:14 pm

Could you possibly assist with a solution for rollout to both Mac and Windows? I have been testing various options all day but the Standalone version on Mac never points me to the correct path.

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Standalone File Path Incorrect

Post by Klaus » Thu Feb 04, 2016 1:29 pm

Hi Nico,

please read my first posting again, it already contains the solution! 8)

During development, put your "layout" file(s) into the same folder as your stack and access them in script(s) with
...
put specialfolderpath("resources") & "/costofsales" into tLayoutfile
...
Then add them via the "Copy files" tab in the standalone builder and the SAME script(s) will still work in the standalone!


Best

Klaus

Post Reply