Page 1 of 1

Application Distribution

Posted: Sun Nov 21, 2010 2:18 am
by maxin454
Hello,

I have created a java application, app.jar, which calls VenDLL32.dll. I'm preparing to distribute it to some users, who have installed Vensim Model Reader. I tried to create a .vpa file which contains the application file (.jar), the model file (.vpm), and some data file (.vdf). When I try to open the .vpa file using model reader, the .jar file did get extracted but did not run. Could anyone provide some suggestions to what's going on? (My guess is either the way I package those files is wrong or issues regarding to the paths written in the application file.)

Many thanks.

maxin454

Posted: Sun Nov 21, 2010 9:36 am
by Administrator
I'm not sure you are doing things correctly here.

Your users need the Vensim Model Reader installed purely to supply VenDLL32.dll. You need to give the user the .jar file and the .vpa. The user opens the .jar file, which in turn opens the .vpa.

Do not package the .jar within the .vpa.

Have a go at that and see if it works ok, report back if it works.

Tony

Posted: Sun Nov 21, 2010 10:31 am
by bob@vensim.com
Actually you have set things up correctly and if the jar file is extracted it should get launched. You should have one of the people you sent it to double click on the extracted jar file. I suspect they have not got their computers set up to have this automatically launch Java. If it does not they can probably just reinstall Java.

Posted: Mon Nov 22, 2010 4:00 am
by maxin454
Thank you, both Tony and Bob.

First, I tried Tony's method to run the java application and it did not work.

Let me try to explain my questions in more details (I apologize if it seems long, just try to record every step I did).

Step 1: I created a java application to control my model using "vensim.command("SPECIAL>LOADMODEL|MyModel.vpm");". I did not specify the directory of the model because I assume when the user receives the package file (.vpa), all the paths will be taken care of. Is "not specifying the path" correct?

Step2: I packaged four files into a .vpa file including my application (.jar), my model file (.vpm) which is referred by my java, the same model file (.vmf) since somehow I need it to publich, and a data file (.vdf). I used a machine which is installed model reader only to open the .vpa file. If the .vpa file is put in the same directory as my java project, then the .jar file got extracted and launched automatically and worked correctly. However, if I put the .vpa file in other directory, then the .jar file still got extracted but did not run (even if you double click the .jar file again). What happens here?

Besides those two questions, I just want to double check the following:

To run the java application, is it true that either Vensim DSS or Model Reader must be installed on the machine? Can the application be run just having the VenDLL32.dll on the machine?

Thanks.

Posted: Mon Nov 22, 2010 10:34 am
by bob@vensim.com
Interesting behavior on .jar - what operating system are you on?

Yes you need to have either DSS or the Model Reader installed. The DLL is part of those applications, it is not available under a separate license.

Posted: Mon Nov 22, 2010 2:16 pm
by maxin454
Thanks, Bob.

I developed the java application on Windows 7 (64 bit). And I tested both on that machine and a machine with Windows XP.

Bob, is my "not writing the path of the model in the java application" correct for the distribution purpose?

Many thanks.

Posted: Tue Nov 23, 2010 12:09 pm
by bob@vensim.com
It is true you don't need to write the path for the model, Vensim will always open the .vpa file from which the application was extracted.

But I guess I still don't understand what is happening in your case. When you say put the java files do you just mean the .jar file or are
there additional files? The expectation is that everything is in a single .jar file. If other files are necessary I would not expect it to work.