Last Edited: 01 May 2008 by superuser
Importered from old WiKi -- 30/04-08 17:04.

Another Excellent list on making DotPups
One more guide

How To Make a DotPup

A DotPup file is simply a zip file. You put whatever files you like in it. There should be a file called dotpup.sh, which will be executed when the DotPup is automatically unzipped. There should be a file called md5sum.txt, which should contain the md5sums of any files you want to be automatically checked by the DotPup system.

When the DotPup file is clicked, the DotPup system should

  • test the file integrity (unzip -t)
  • automatically unzip it
  • test the file integrity of the files listed in md5sum.txt
  • automatically run dotpup.sh

Here's a very simple step-by-step example.

  • Create a directory (folder) called helloworld
  • Create a script called dotpup.sh (set the permissions to executable)
  • Your dir should look like this:

image

  • Put these lines in dotpup.sh

#!/bin/sh
xmessage -center "Hello, World!"
  • When you click dotpup.sh, an xmessage window should pop up, like this:

image

To make your dotpup.sh file into a DotPup that is self-testing and runs automatically when it's clicked, right click the dir and Open an Xterm, and type:

md5sum dotpup.sh > md5sum.txt
zip -9 helloworld.pup dotpup.sh md5sum.txt

This will create an md5sum of your file dotpup.sh so when it's unzipped by the DotPup system, you are sure it's integrity is ok. And it will create a file called helloworld.pup, which is just dotpup.sh and md5sum.txt zipped into one file. When you click helloworld.pup, it will be checked and automatically unzipped and run ... so you should see the Hello World window popup when you click the DotPup (because it runs the dotpup.sh script, and that's what your script does).

If you change your DotPup files, for example, if you edit your dotpup.sh file, you will have to repeat the commands you typed in to make the DotPup file, so you might as well make a script to click that will make a new DotPup whenever you change any of the files. (You do not have to create a make-pup script ... but it's usually easier). In this case,

  • Create an executable script called make-pup
  • Put these lines in the script:

#!/bin/sh
md5sum dotpup.sh > md5sum.txt
rm -f helloworld.pup
zip -9 helloworld.pup dotpup.sh md5sum.txt
  • You dir should now look like this:

image

  • You can click the make-pup script anytime to make a new helloworld.pup file
  • Like this:

image

  • When you click helloworld.pup

    • it should be tested, unzipped, and run
    • and you should see the xmessage window pop up when dotpup.sh runs

image

Of course, the dotpup.sh script will execute whatever commands you put in it. The Hello World script is a trivial example.

You could have the dotpup.sh script run other file(s) in your package. For example,

  • Create an executable script called helloworld
  • Put these lines in the script:

#!/bin/sh
xmessage -center "Hello, World!"

This will do the same thing the dotpup.sh script did.

  • Edit dotpup.sh and put these lines in the script:

#!/bin/sh
cp -f helloworld /root/my-applications/bin
exec helloworld

This will copy the executable file helloworld to /root/my-applications/bin, then it will run helloworld. It should be found and run because /root/my-applications/bin is included in $PATH

If you are using the make-pup file, edit it to include the new helloworld file and click it to make a new DotPup.

#!/bin/sh
md5sum dotpup.sh helloworld > md5sum.txt
rm -f helloworld.pup
zip -9 helloworld.pup dotpup.sh helloworld md5sum.txt
  • Your dir should look like this:

image

Anyone who clicks your helloworld.pup file will install your helloworld program, so they can type helloworld in an rxvt window, and your Hello World message will pop up. The dotpup.sh script also runs the helloworld program after it installs (copies) it. You can decide what you want your dotpup.sh script to do, or not do.

Notes:

  • If you click your dotpup.sh file, it's working dir will probably be /root, and it might not do what you think it will. You can workaround this for testing purposes, for example, opening an rxvt window in your DotPup dir and typing ./dotpup.sh
  • Your files will be unzipped in a newly created dir named /root/DotPupTmpDir
  • /root/DotPupTmpDir will be deleted when DotPup finishes
  • DotPup does not check if you have enough free space to unzip your files.
  • Roxapps are a different subject ... a DotPup is not a Roxapp. A DotPup is just a zip file. You can include one or more Roxapps in a DotPup file (and write a dotpup.sh script to install them if you like.)
  • Read this discussion∞ on the forum before you decide where to put your DotPup's install files. Changes are coming with Puppy 1.0.5....



CategoryHowto