Help - Search - Members - Calendar
Full Version: Problem A Java App's Installer
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Personal Java/Jeode/J2ME Personal Profile
Mongoosefred
I've got a real dilema, I've got QuackNews installing, but I want to install a number of configuration files, such as templates, basic config file, etc and they have to be ableto be modified by the application. This is fine on OZ, which is what I'm using, because I run as root and have permissions to write in /opt/Qtopia/, however my friend uses the CRACKO ROM and he is having problems.
What I thought was I'd install the config files into the /opt/Qtopia folder then move them using post install into $HOME and the app can find that using the Runtime properties. However I just can't get that working. mad.gif
What I need is either some really good details of writing move advanced ipk files, or I move the files when I first run the application... Which is just a little to much like a hack for my liking sad.gif
I would appriciate any surgestions.

-MF
lardman
I'm pretty sure that the installer runs as root on all ROMs (otherwise it'd have troubles installing some things).

Let's see the postinst script you're proposing.


Si
tovarish
i had problems with QuackNews and cacko too. The configuration file at /opt/QtPalmtop/QuackNews was not writable by user zaurus so I had to make it as well as the directory writable for quacknews to work.
It works fine now.

tovarish
Mongoosefred
Sorry about the lack of detail in the first post... it was a late last night. Heres what I've tried:

I've read the the IPKG Tutorial on uk-dave.com and I think I've done it right.
I created a folder called CONTROL in the ipk's root, in it was a file called control (which used to be tar'd and gz'd into control.tar.gz and works there) and a postinst file that include a single line
CODE
cp /opt/Qtopia/QuackNews $HOME

I'm a little new to Unix scripting so I'm not sure if I need
CODE
#!/bin/sh

as the first command in the file.
I tar'd and gz'd the CONTROL folder as control.tar.gz and then created the ipk as per usual. When I came to install it on my Zaurus (OpenZaurus 3.5.2 - Hentges) the package manager says that it fails to create sym-links and does not list it as installed. However QuackNews appears on the Jeode tab when the icons are reloaded and runs correctly, therefore the sym-links are correct.
The QuackNews folder is not copied.
I am assuming (I know, never make assumptions) the the sym-link failure is because the script is failing.
The tutorial says a script must return 0, how do you do this?
I think it might be because I have either got the case wrong for the folder name, the script is wrong or both... smile.gif

Is there a way of finding where the files are actually installed into rather than where I think they are, for instance on OZ - Hentges installing into /opt/Qtopia actually installs into /mnt/card/opt/Qtopia.

If anyone has some examples of post and pre install scripts I would be VERY greatful.
Thanks in advance.
-MF
lardman
QUOTE
I am assuming (I know, never make assumptions) the the sym-link failure is because the script is failing.


Some symlink failures always occur as ipkg tries to symlink all the way down to / (some of which will obviously exist already). So this is normal, not a problem, ignore it.

QUOTE
a postinst file that include a single line
CODE
cp /opt/Qtopia/QuackNews $HOME

I'm a little new to Unix scripting so I'm not sure if I need
CODE
#!/bin/sh

as the first command in the file.


You do need this as otherwise the script won't be run.

QUOTE
Is there a way of finding where the files are actually installed into rather than where I think they are, for instance on OZ - Hentges installing into /opt/Qtopia actually installs into /mnt/card/opt/Qtopia.


ipkg files <package-name>

The reason it ends up on the card is that the hentages ROM has opt symlinked there.


Now I really don't understand what you're trying to do. Why are you trying to move this QuackNews file (what is it? a binary, a directory, etc.?) to $HOME? Does $HOME even exist (as in the variable rather than the location)?

The next thing is that you probably shouldn't use /opt/Qtopia/QuackNews, but rather /opt/QtPalmtop/QuackNews (it just offends my sensibilities to use the symlink rather than the actual directory). I also think it's probably bad form to place temporary files in /opt/Qt*, you might try placing them in /tmp as that's what it's there for (unless someone can give me a reason not to do this).


Si
Mongoosefred
Thanks for the help lardman.
After thinking it through I really don't think I need to do this. I was just over complicating the solution.
-MF
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.