PDA

Click to See Complete Forum and Search --> : native methods or FindWindow, PostMessage, and Get/WriteProfile* (Registry stuff)


VirtuallyVB
Jul 11th, 2001, 05:50 PM
First I suppose I should ask if there is a Java equivalent to FindWindow, PostMessage, and Get/WriteProfile* (Registry stuff). I think someone in the past asked about the registry and I replied that I thought it would make Java non-portable.

If there is no equivalent, I suppose that native methods would be the solution, but apparently I'm not passing the correct datatypes.

For "LPCTSTR a pointer to a null-terminated string"
I've tried Java's String, byte[], and char[] (with 0 as the last value of the byte and char arrays).

I get java.lang.UnsatisfiedLinkError.

Of course "HWND" may not be acceptable as a Java long either.

Asside: Is it possible to obtain registry information from dos batch commands (within a batch file)? Perhaps even by calling a windows function from dos running in a window.

Dillinger4
Jul 18th, 2001, 02:23 PM
That's a hard one.Any luck so far? What are you trying to do exactly save program settings into the system Registry ?

VirtuallyVB
Jul 19th, 2001, 11:49 AM
It's really about deployment. My confusion is going to come out in my explanation.

I have a Java app that I'm ready to deploy. But I'm finding out that the package will be huge. I think even bigger than a VB deployment. I'm really getting disappointed now due to speed as well. What I need is a sweet API like Java, with C++'s speed and free development with free (to me) commercial distribution (that I can get paid for). Do you know of such a language?

Basically my deployment solution is to package the complete JRE executable along with my custom classes.

Remember, we have to assume that the user has no Java support. I'm deploying to Windows (and various flavors of windows may also be a concern).

I burned a cd with autorun of a dos batch file. The file runs the JRE executable, but I thought the dos "call" command was supposed to wait until the call returned before executing the next dos batch command. It does not wait.

Also, I'm trying to write my own Setup program like Install Shield. It's just that it runs slowly (since I'm using the JRE from the cd).

Let me try again:
1)CD autoruns batch file
2)Batch file runs JRE installation program
3)Wanted to run my java installation program after JRE is installed from step 2. But I don't like the fact that the first installation screen (from step 2) does not introduce my app, but instead introduces the Java JRE. So if I ran my app from an installed JRE on my CD (I don't even know if this is within the license agreement) it runs very slow (but I could display my app's welcome screen and then run the JRE install executable--but this is way slow). But dos' batch command "call" doesn't wait to return from the JRE installation before attempting to run my java app from the JRE installed on the user's pc in step 2 which should run faster than the JRE on the CD.
4)Give option to run my developed app (not the setup program which is an app in itself) and then exit my custom java setup app.

NOTE: If the dos batch file will wait for the JRE installation in step 2 to succeed and notify the batch file of success, then I'll live with this solution to proceed with step 3 but running from the newly installed JRE on the user's machine.

Also, I suppose I could develop my own Install app from a distributable C/C++ (GNU) and that could wait for valid return before continuing each install step. I guess it pisses me off that I should be able to do this rather than pay another company.

I need to read the registry to detect the version of the JRE. I don't know if Java's JRE installation handles not overwriting a newer JRE. I noticed that it creates a new folder for the version. Also, although I think I can run from the jre on my cd, I don't really know if it is really using only the cd resources because some documentation on java.exe (javaw.exe) says that the application launcher checks the registry for the location of the jre. And using the cd jre/app launcher is too slow anyway, so I want to wait until the jre is installed onto the user's machine from step 2.

If I went with the batch file approach, I'd like my setup program to "find its window" and close it when my setup app is complete. I'd need to post the "close" message to the dos shell window. I think that is the normal solution to close a dos window.

So, what is your deployment solution? This is the first time I actually have to get it working (I referred to the old post from Sun, but didn't know the JRE was that huge). I was also thinking of native methods, but they need to be recompiled (from what I understand). I was about to write Sun to ask why they can't call the dll like VB calls a C/C++ dll.

Does any of this make sense? Have you handled a deployment?

Dillinger4
Jul 19th, 2001, 06:27 PM
I have yet to write a distributed app in Java. Ive coded one app with a friend which we were paid about 5 grand for, but it was in VB so the installation process was a snap. I called a friend of mine who works in the city as a programmer and he said he would e mail me later on tonight and give me some feedback.

"But dos' batch command "call" doesn't wait to return from the JRE installation before attempting to run my java app."

so what is actually happening, your program is being run before the JRE is actually finished being installed? That's one of my biggest gripes. If i distribute an app i have to load the JRE on the clients pc in addition to my app.

Im looking into it as we speak.... Ill get right back.

Dillinger4
Jul 19th, 2001, 06:39 PM
Here is a response i just recieved from one of my friends.


http://www.zerog.com/


Their InstallAnywhere Now! product is free and quite handy (you can specify install with or without JVM. I'm not sure about distributing a commercial product using Now! They also leave out quite a few features (to customize installation, JVM command-line arguments, etc) so that it makes you want to go buy their InstallAnywhere (full version).

Either way, it's nice and clean once you get the hang of it.


Im still looking into do it on your own. ill get Back.............

Dillinger4
Jul 19th, 2001, 06:58 PM
I just checked out: http://www.zerog.com/products_ia_01.html#seven
and what i read about the product i liked....... but i think if your going to spend 1 to 2 thousand dollars the only thing that would justify paying that amount is if your going to distribute your app on multiplatforms. ie......... Windows 95, 98, Me, NT, 2000
Linux: RedHat, Caldera, TurboLinux, SuSE
Mac OS 8.x, 9.x, X Server
HP-UX 10.20 & 11.x, FreeBSD, Tru64


Enterprise Edition (v4) US$ 2495
Standard Edition (v4) US$ 995
Now! (v4) Free of charge

Heres the comparison between InstallAnywhere
Enterprise and InstallShield MultiPlatform
http://www.zerog.com/products_ia_05.html

Im going to download the free version and check it out........

VirtuallyVB
Jul 20th, 2001, 11:30 AM
Yes, that price wasn't appealing to me especially since I have no buyers lined up yet for my app.

Yes, I read that the use of "call anExe.exe" would wait until that anExe.exe returned before proceeding to the next line in a batch file. Maybe there is another way. I have to run now, but let's discuss this some more. Thanks.