1. Christian Breu
  2. Other Discussions
  3. Donnerstag, Dezember 22 2016, 07:17 AM
  4.  Abonnieren via E-Mail
To run an Application built by XOJO I had to install V4RB on the targetmachine because of a runtime error (about cannot open V4RB dylib).
Is it reallly needed or ist it just because I installed the plugin in my XOJO while building the Application?

The Application connects to a VServer.
Platform Mac OS X.
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
0
Votes
Undo
Hi Chrisitan,

most probably you have miss step "PREPARE FOR DEPLOY"

Please read here
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Thank you Ruslan.
Indeed I overlooked that. :o

So as I understand in fact it does not matter to have V4RB installed on the machine!?
I will change it with the next App version.
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
0
Votes
Undo
Of course.

You cannot require from your users to install V4RB on their computer, as a separate step.
V4RB installer is for developers. It installs e.g. examples. Your users do not need that.
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Another question about this topic.
In /usr/local/lib on my computer there are two folders – vcomponents and vcomponents_x64.

If I build 64-Bit Applications, do I need the x64 compnents then?
Cause in the Script V4RB_v5 SCRIPT I cannot see anything about x64!?
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
0
Votes
Undo
Hi Christian,

Please try attached script.
Use it as
> script app 64

i.e. exists new 64 bit param of script.

if any errors, copy paste them here.
Anhänge
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Hello Ruslan

Thank you for reply.

Even I did not face any problem yet, when I was working on a solution to put a XOJO build step to my project to do this work automatic while building the app, I was thinking this might be a problem.

So to clearify, for my project with VServer, Applications, VSP, I have to take care, all of the involved parts use the same version of valentina components, right? How problematic is it, if there are different versions used?

I think it could be difficult, if you have two apps, one is updated and with that the components while the second one is still the last version but uses the same newest components... Is this not problematic?
Would it not be better to have own components, fitting the apps version for each app?


Best Regards

Chris
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Maybe this part of your script is not correct!?

#####################################
# PREPARE variables:
#
# NOTE that "app"/Contents specify slash.
# this is not a problem even if app itself have slash at end.
# We will get something as http://gg.app//Contents and this still works fine.
#
if [ "$arch" = "64" ] ; then
app_vcomp="$app"/Contents/vcomponents_x64
sys_vcomp=/usr/local/lib/vcomponents_x64
dllsuff="_x64"
else
app_vcomp="$app"/Contents/vcomponents
sys_vcomp=/usr/local/lib/vcomponents_x64 <<<---------- !!!!!
dllsuff=""
fi

# YOU can change this to 0 to skip VREPORT.dll
install_vreports=1
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
0
Votes
Undo
Hi Christian,

Thank you, script with this fix and few other attached.
Anhänge
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Hello Sergey

Thank you.
How can I simulate/make sure it works correct?

Trying to do it as a XOJO build step.
Before launching the Testapp, I remove the components from /usr/local/bin
App cannot launch – an error occured.

Same problem with your script.
Before I used the old version of script but never tested with removed components.
On my customers Machines it worked.
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
0
Votes
Undo
Last change wasn't saved, sorry.
It should be Ok now.

You're right, that is how we usually test if everything is copied right
Anhänge
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
0
Votes
Undo
About vcomponents - you're right, and that is how it works now.

Valentina Server and Valentina Studio have their own versions of vcomponents included into application bundle.
And deployed Xojo application will be with own version of vcomponents.
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Thank you Sergey

The Script works now. Hope my build step too soon... ;)

About the components, I meant because of
If you develop and deploy a family of applications that can/should be installed on the same user computer, then it is a good idea to put vcomponents only once. It is possible if this folder is at path “/usr/local/lib/vcomponents”, where any V4RB(UB) application can find it.

Are the components not related to the version of Valentina?

Then it could be problematic to use the same components for different Apps.
Kommentar
There are no comments made yet.
Sergey Pashkov Akzeptierte Antwort
0
Votes
Undo
vcomponents are strictly related to the Valentina version.

Possible use case - if these applications are distributed together - there should not be a problem to use /usr/local/lib/vcomponents and update all of them at once.

But if these applications are independent - it becomes impossible, so the best way is to include vcomponents into each application.
With this approach it is also possible to have multiple versions of the same application on one computer.
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Woohoo finally it works...!
Now I do not have to think about this step, it will be done automaticly while building the app.

Thanks all of you and have a nice weekend!
Kommentar
There are no comments made yet.
Ruslan Zasukhin Akzeptierte Antwort
0
Votes
Undo
Hi Christian,

1) may be you can drop here snapshot of Xojo window, where was setup of this build step?

2) thinking about central vcomponents folder, lets keep in mind, that 64-bit aps target
/usr/local/lib/vcomponents_x64


3) We thinking, but never did yet idea, to add to vcomponents folder name, yet version.
May be major only, may be complete, Something as vcomponents_x64_v669 or just vcomponents_x64_v6

This can allow keep on the same machine few central folders in the same time, e.g. v6 and v7 without conflicts.
Kommentar
There are no comments made yet.
Christian Breu Akzeptierte Antwort
0
Votes
Undo
Hello Ruslan

Yes of course...
Informations about Build Automation can be found here: XOJO Build Automation

For this case, just go to menu Insert > Build Step > Script, move it below the Build step (gearwheel) and add the code you need.

The code (based on your script):


Dim appArch As String = ""
Dim fwArch As String = ""

Dim sLineEnding As String = ";"

if CurrentBuildTarget = 16 Then
appArch = "_x64"
fwArch = "_64"
End If


Dim shellAppName As String = CurrentBuildAppName.replaceAll(" ", "\ ")
Dim vCompFolder As String = CurrentBuildLocation + "/" + shellAppName + ".app/Contents/vcomponents" + appArch
Dim vFrameWork As String = CurrentBuildLocation + "/" + shellAppName + ".app/Contents/Frameworks/v4rb_cocoa" + fwArch + ".dylib"
Dim sysVCompFolder As String = "/usr/local/lib/vcomponents" + appArch

//copy the vcomponents
Dim vCompCopy As String = "cp -Rf " + sysVCompFolder + " " + vCompFolder
call doShellCommand(vCompCopy)


//change id and paths
Dim idpVComp As String = "install_name_tool -id '@executable_path/../vcomponents" + appArch + "/libvshared_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvshared_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -id '@executable_path/../vcomponents" + appArch + "/libvkernel_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvkernel_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvshared_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvshared_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvkernel_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/VSDK.framework/Versions/A/VSDK '@executable_path/../vcomponents/VSDK.framework/Versions/A/VSDK' " + vCompFolder + "/libvkernel_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -id '@executable_path/../vcomponents" + appArch + "/libvclient_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvclient_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvshared_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvshared_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvclient_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -id '@executable_path/../vcomponents" + appArch + "/libvreport_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvreport_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvshared_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvshared_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvreport_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvkernel_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvkernel_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvreport_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvclient_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvclient_fat_release" + appArch + ".dylib' " + vCompFolder + "/libvreport_fat_release" + appArch + ".dylib" + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvshared_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvshared_fat_release" + appArch + ".dylib' " + vFrameWork + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvkernel_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvkernel_fat_release" + appArch + ".dylib' " + vFrameWork + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvclient_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvclient_fat_release" + appArch + ".dylib' " + vFrameWork + sLineEnding _
+ "install_name_tool -change " + sysVCompFolder + "/libvreport_fat_release" + appArch + ".dylib '@executable_path/../vcomponents" + appArch + "/libvreport_fat_release" + appArch + ".dylib' " + vFrameWork + sLineEnding
call doShellCommand(idpVComp)
Anhänge
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories