Author Topic: Problem A Java App's Installer  (Read 3311 times)

Mongoosefred

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • http://www.xlevel.org.uk
Problem A Java App's Installer
« on: April 01, 2005, 04:01:56 pm »
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.  
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  
I would appriciate any surgestions.

-MF
[span style=\'font-size:8pt;line-height:100%\']
QuackNews RSS Reader
----------
Zaurus SL-5600 (Watapon ROM 1.6)
Zaurus SL-5500 (On load to a friend)
512 MB SD-Card
PNY 64MB CF-Card
VIKING 256MB CF-Card
Sharp Digital Camera (On load to a friend)
NL-2511CF WiFi Card
[/font][/span]

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Problem A Java App's Installer
« Reply #1 on: April 02, 2005, 04:37:07 am »
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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

tovarish

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Problem A Java App's Installer
« Reply #2 on: April 02, 2005, 04:46:20 am »
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

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • http://www.xlevel.org.uk
Problem A Java App's Installer
« Reply #3 on: April 02, 2005, 07:46:26 am »
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: [Select]
cp /opt/Qtopia/QuackNews $HOMEI'm a little new to Unix scripting so I'm not sure if I need
Code: [Select]
#!/bin/shas 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...  

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
[span style=\'font-size:8pt;line-height:100%\']
QuackNews RSS Reader
----------
Zaurus SL-5600 (Watapon ROM 1.6)
Zaurus SL-5500 (On load to a friend)
512 MB SD-Card
PNY 64MB CF-Card
VIKING 256MB CF-Card
Sharp Digital Camera (On load to a friend)
NL-2511CF WiFi Card
[/font][/span]

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Problem A Java App's Installer
« Reply #4 on: April 02, 2005, 08:00:29 am »
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: [Select]
cp /opt/Qtopia/QuackNews $HOMEI'm a little new to Unix scripting so I'm not sure if I need
Code: [Select]
#!/bin/shas 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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Mongoosefred

  • Newbie
  • *
  • Posts: 31
    • View Profile
    • http://www.xlevel.org.uk
Problem A Java App's Installer
« Reply #5 on: April 02, 2005, 12:45:31 pm »
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
[span style=\'font-size:8pt;line-height:100%\']
QuackNews RSS Reader
----------
Zaurus SL-5600 (Watapon ROM 1.6)
Zaurus SL-5500 (On load to a friend)
512 MB SD-Card
PNY 64MB CF-Card
VIKING 256MB CF-Card
Sharp Digital Camera (On load to a friend)
NL-2511CF WiFi Card
[/font][/span]