This is an old revision of the document!


Howto

...use the listed scripts

written by Thomas_H 2011/12/16 12:50

Welcome to the wiki, initiated by users using opsi very proudly and successful. If you want to use Opsi (Open PC Server Integration) be aware, that this system is - like many other servers - none “out of the box”. So get rid of any illusion, that you simply install opsi and right after installing you can install every software and operating system. Some work has to be done before you can do this! And nevertheless there are very(!) good instructions and manuals for opsi it's your's to create the most contents and packages for future installations.

This wiki shall help to avoid much work to be done twice, because once a package is created successfully, the scripts can - and should - be published here. Remember: others invested lots of time to create these scripts, they spended time to publish them here and you save lots of time by using these scripts. So help others by publishing your own scripts, if you have to create some.

This Howto is for the newbies in first line, starting with opsi, trying out the features. With this little Howto they should have the first success by creating a package, without knowing the “why” or “what” in the scripts. The “why” and “what” is something, you will have to learn later and let me say, yes you'll have to learn it, otherwise you always will need the help of other users.

Of course: best is at last to get some training, you can get informations about training on opsi here. Commercial support is also avail.

Some words before beginning...

  • Read the manuals! We expect that you already have installed and configured your opsi-server on the manual named "Getting Started"
  • The published scripts are tested and they all work
  • If software, which should be installed is free, so you should find links above the scripts where to get it. If a software is free, and there is no link, so you can add it as a member of the forum (register yourself)
  • Commercial software has to be bought from the manufacturer and has not to be asked for in the forum ;)
  • If a script don't work, so ask politely in the forum. The error often is to be found between the screen and the chair.
  • If you need changes, so don't expect that others do this for you (except you pay UIB for doing this ;) ) Try it first for your own, and if it don't work ask the forum.

And of course I expect, that you know how to open a terminal, or using putty and how to copy and paste some text to a terminal, depending on the way you choose to create a new package. If you work on a Windows-Machine via remote on the opsi-server you might use putty, if you use a VM, you might copy and paste directly to the VM… however, I will not describe the way how to do all these things. I think, if you are going to use a remote installation server, you'll have to know the basics.
(And don't blame me on my english, because it's not my native language :) )

The "tree"-View

Sometimes in the description of the scripts you will find something like this:

Tree:

TightVNC.jpg
TightVNC.reg
Tightvnc_win7.reg
delsub.ins
setup.ins
tightvnc_*version*-setup.exe
uninstall.ins

This shows the tree, so you can see, where to place the files. It always show the content of the CLIENT_DATA folder.

Using the scripts...

For easily creating packages you better install 2 tools on the opsi-server:

  • joe (an easy-to-use editor)
  • wget (if not installed)

Me for myself use the folder named “opsiproducts” in the home-directory for creating the packages. My account is a member of opsi-admin and the folder has rwx-rights for group opsi-admin course. Such a folder has many advantages and after creating your packages, you should keep it! Software is changing nearly every day and it's much easier to change the setup.exe and to repack, than to start again and again creating folders, calling the opsi-newprod, etc.

A remark from bell: “I think, it's easier to pack by using a share, so you can mount it on a testclient. I am usually programming on Windows-Client, because it's easier for me and I can test the packets directly. I have installed Notepad++ with syntaxhiglighting for opsi on the client I am creating the packets and I've linked the .ins-files with winst. So I have an entry in the contextmenu for the .ins-files, linked to Notepad++ that enables me to open these files by a doubleclick. By this you can test the scripts until they function and create at last the packet.”
(Of course this is more a solution for experienced users, who knows, what “shares” are, what synthaxhighlighning and winst are)

First follow the instructions on the manual “Getting Started”, chapter 4.2 “Creating an opsi package”. On the example of TightVNC (a remote-control-software) we will create a localboot-package. Localboot means, the pc starts from it's own HDD.

For creating a new packet we start by changing to our directory, where we want to store our builds in future. If our directory should be “/home/opsiproducts” (like my example) so we first create this directory and change to it.

mkdir /home/opsiproducts
cd /home/opsiproducts

Remark from the forum, added by d.oertel:

“pack opsi products in /home/opsiproducts only. The three most important reasons are:
1. because of the rights on this foilder diffrent persons (if not root) can work in this folder.
2. The command

opsi-setup --set-rights

knows this folder and sets the correct rights. A /home/mydir/opsi-install would be ignored. This is important, because the opsi-mackage-manager gives the package to opsiconfd while installation and interrupts on missing rights on the folder.
3. This folder is shared as 'opsi_workbench', which makes it easier to update the products using a Windows-Client.
It's also described in the handbook: http://download.uib.de/opsi4.0/doc/html/en/opsi-getting-started/opsi-getting-started.html#opsi-getting-started-softwintegration-create-opsi-package-handling

Then we begin by entering the first command for creating an opsi-packet:

opsi-newprod

We'll have to go trough some screens. The first is the “product-information-screen”. In this screen we enter some informations, for example

product id = tightvnc
product name = TightVNC

the you follow the screens, you enter exactly the names “setup.ins” and “uninstall.ins” in the “product-scripts”-screen. Most scripts listed here have a “delsub.ins”. This is a subroutine, that will be called by setup.ins or uninstall.ins. You will not enter delsub.ins in the product-scripts-screen.

We will not create any dependencies at this moment. Dependencies are needed if a software needs another package before getting installed. For example: CDBurnerXP needs .NetFX installed. So you can define, that the package ”.NetFX“ will be installed first, before opsi install the CDBurnerXP-Software. Opsi will follow the dependencies, installing .NetFX first and then CDBurnerXP.

For TightVNC we will not define any product-properties. Go on until opsi-newprod ends and informs you, that a new folder has been created.

When done, opsi-newprod we will have a new folder in /opsi-packages named (following our example) “tightvnc”.

In folder we will find three more other folders, named CLIENT_DATA, OPSI and SERVER_DATA:

│
├ tightvnc
├ CLIENT_DATA
├ OPSI
│ ├ control
│ ├ postinst
│ └ preinst
└ SERVER_DATA

Change now to the folder “CLIENT_DATA”:

minhas-tirith:/home/opsiproducts/tightvnc # cd CLIENT_DATA

Getting the setup-program

First we need to download the setup-program, you will mostly find a link in the top-section of each script where we can get it. If not, the software might not be free. In our example we will find TightVNC at http://www.tightvnc.com/download.php
Follow the link and watch for the self-installing package for Windows. Do a rightclick on the link and copy the URL of the file.

Do a

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # wget "http://www.tightvnc.com/download/2.0.4/tightvnc-2.0.4-setup.exe"

(Attention! The Version-Number 2.0.4 might have changed, when you read this HOWTO!)

so the setup-file is stored directly in the folder CLIENT_DATA.

Now we need the setup.ins, the uninstall.ins and the delsub.ins. To get them and to fill them with content do the following:

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # touch setup.ins
minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # joe setup.ins

Now open in the wiki the page tightvnc-script Mark all inside the box under “setup.ins”, copy it and paste it into joe by doing a SHIFT-INS. Now find the line with a

Set $Inst_Prg$        = "tightvnc-x.y.z-setup.exe"

and change it to the name of the setup-program you have downloaded before.

To save the file press <CTRL-K>x

Do the same with uninstall.ins and delsub.ins:

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # touch uninstall.ins
minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # joe uninstall.ins

Mark all inside the box under “uninstall.ins”, copy it and paste it into joe by doing a SHIFT-INS. To save the file press <CTRL-K>x

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # touch delsub.ins
minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # joe delsub.ins

Mark all inside the box under “delsub.ins”, copy it and paste it into joe by doing a SHIFT-INS. To save the file press <CTRL-K>x

To avoid any errors during the automated installation also do a

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # touch Tightvnc_win7.reg

and leave it empty. This file normally contains the registry-settings of TightVNC made after a test-installation on a client. It contains the password for the administrator.

Where to get the bitmap?

Try Google, searching for TightVNC and have a look in the pictures. If you find one you like so you can copy it and resize it to 160×160 pixel. Save it as TightVNC.jpg.

Packing the package

Well done. Now leave the folder CLIENT_DATA

minhas-tirith:/home/opsiproducts/tightvnc/CLIENT_DATA # cd ..

and pack it by using opsi-makeproductfile.

minhas-tirith:/home/opsiproducts/tightvnc # opsi-makeproductfile

The software will be packed now. This takes a lil bit of time depending on the amount of files and the size which have to be put into the package. After packaging do a

minhas-tirith:/home/opsiproducts/tightvnc # opsi-package-manager -i *.opsi

to install the new created package. Do a reload on the localboot-products in the configed, if it's open during installing the new package, otherwise you will not see your new created package.

Now you can test it with an opsi-client.

Have fun!


QR Code
QR Code userspace:howto_use_the_scripts_-_a_short_description (generated for current page)