Andrew,
Fixing:
https://qcad.org/rsforum/viewtopic.php?t=8688
https://qcad.org/rsforum/viewtopic.php?t=7726
https://www.ribbonsoft.com/bugtracker/i ... sk_id=2128
What are the differences between RSettings.getApplicationPath() and RSettings.getLaunchPath()?
When can these values be different from each other?
On a windows system I get twice the same value pointing to the 'C:/Program Files' folder.
Regards,
CVH
Difference between getApplicationPath() and getLaunchPath()
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: Difference between getApplicationPath() and getLaunchPath()
The difference is mostly relevant for command line tools.
If QCAD is started for example like this:
The launch path would be /home/user
The application path would be /home/user/opt/qcad-3.26.4-pro-linux-x86_64
The launch path is relevant for command line arguments. Consider:
myfile.dxf would have to be under:
And not:
If QCAD is started for example like this:
Code: Select all
cd /home/user
./opt/qcad-3.26.4-pro-linux-x86_64/qcad
The application path would be /home/user/opt/qcad-3.26.4-pro-linux-x86_64
The launch path is relevant for command line arguments. Consider:
Code: Select all
cd /home/user
./opt/qcad-3.26.4-pro-linux-x86_64/qcad myfile.dxf
Code: Select all
/home/user/myfile.dxf
Code: Select all
/home/user/opt/qcad-3.26.4-pro-linux-x86_64/myfile.dxf
Re: Difference between getApplicationPath() and getLaunchPath()
Thanks,
makes sense in the explained example.
It doesn't on a Windows system there C:/Program Files/QCAD/qcad.exe as command returns:
'C:/Program' is not recognized as an internal or external command, operable program or batch file.
There I start QCAD from a link on my destop shouldn't the launch path then be the user desktop folder?
Related to the use:
I presume CreateLibraryItem.js is not run as a command line tool as it requires a document, a selection and an export file name.
I tweaked it so that it retrieves the last used path or the user data location folder or finally revert to the launch path as original.
The launch path under Program Files on a Windows system is of no use as one can't write to it.
Regards,
CVH
makes sense in the explained example.
It doesn't on a Windows system there C:/Program Files/QCAD/qcad.exe as command returns:
'C:/Program' is not recognized as an internal or external command, operable program or batch file.
There I start QCAD from a link on my destop shouldn't the launch path then be the user desktop folder?
Related to the use:
I presume CreateLibraryItem.js is not run as a command line tool as it requires a document, a selection and an export file name.
I tweaked it so that it retrieves the last used path or the user data location folder or finally revert to the launch path as original.
The launch path under Program Files on a Windows system is of no use as one can't write to it.
Regards,
CVH
Re: Difference between getApplicationPath() and getLaunchPath()
You'd have to escape the space, presumably with a backslash (or slash) or use quotes around the path.
Re: Difference between getApplicationPath() and getLaunchPath()
Andrew,
With quotes it works, thanks, but that is not the point.
The topic here is that CreateLibraryItem.js writes new items to the launch path. Hard coded.
https://www.ribbonsoft.com/bugtracker/i ... sk_id=2128
I tweaked a copy of the script. Functional, not that I use library items.
Regards,
CVH
With quotes it works, thanks, but that is not the point.
The topic here is that CreateLibraryItem.js writes new items to the launch path. Hard coded.
https://www.ribbonsoft.com/bugtracker/i ... sk_id=2128
I tweaked a copy of the script. Functional, not that I use library items.
Regards,
CVH