<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>BeL Lab</title>
	<link>http://www.bellaboratories.altervista.org</link>
	<description>BeL Lab is THE BEST, FUCK THE REST!</description>
	<pubDate>Thu, 30 Jul 2009 17:28:01 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>A Bug&#8217;s World</title>
		<link>http://www.bellaboratories.altervista.org/?p=85</link>
		<comments>http://www.bellaboratories.altervista.org/?p=85#comments</comments>
		<pubDate>Wed, 29 Jul 2009 15:38:30 +0000</pubDate>
		<dc:creator>president</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[LNX/UNX]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=85</guid>
		<description><![CDATA[  Hi,
here I am to speak about a great problem with my lovely laptop Asus M51se-AP0042c and Ubuntu 9.04 Jaunty Jackalope . This notebook has an ATI video card but it&#8217;s not the primary problem. it seems that there is a &#8220;little&#8221; bug in the bios mobo like we can see here. So after reading [...] ]]></description>
			<content:encoded><![CDATA[<p> Hi,<br />
here I am to speak about a great problem with my lovely laptop Asus M51se-AP0042c and Ubuntu 9.04 Jaunty Jackalope . This notebook has an ATI video card but it&#8217;s not the primary problem. it seems that there is a &#8220;little&#8221; bug in the bios mobo like we can see <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/316079/">here</a>. So after reading the solution, I&#8217;ve made a little guide to compile the kernel with the right patch.</p>
<p>The steps are easy but long, take your time.</p>
<p>1) Install needed toolsi:<br />
<font color=#00ff00><code># sudo apt-get install kernel-package libncurses5-dev fakeroot wget bzip2</code></font></p>
<p>2) Download  kernel source of the version you like (I&#8217;m using Jaunty Jackalope one):<br />
<font color=#00ff00><code># sudo apt-get install linux-source-2.6.28</code></font><br />
It&#8217;s better takes the source code of the running kernel version on your machine.  Change the numbers with that of you version.</p>
<p>3)Now locate in the directory of the downloaded archive and extract the files:<br />
<font color=#00ff00><code># cd /usr/src<br />
# bzip2 -d linux-source-2.6.28.tar.bz2<br />
# tar xvf linux-source-2.6.28.tar<br />
</code></font></p>
<p>As result there&#8217;s a directory named as the archive, ex. linux-source-2.6.28</p>
<p>4) create a symbolic link to this directory and name it linux. Now enter it:<br />
<font color=#00ff00><code># ln -s linux-source-2.6.28 linux<br />
# cd linux<br />
</code></font></p>
<p>5) Now, to save time on the determination of your hardware configuration, you can copy the configuration file of the kernel you are using to run the penguin:<br />
<font color=#00ff00><code># cp /boot/config-`uname -r` ./.config</code></font></p>
<p>6) Now go <a href="http://bugs.launchpad.net/ubuntu/+source/linux/+bug/316079">here</a> and download the patch file that supports DMI (browse the posts and you will find it).</p>
<p>7) After downloading the patch, apply the change to the file  fixup.c in the directory content arch/x86/pci/ copying the text from the patch file and pasting it at the end of fixup.c and save it:</p>
<p>If you are under GUI<br />
<font color=#00ff00><code>gedit arch/x86/pci/fixup.c</code></font></p>
<p>If you are under cli<br />
<font color=#00ff00><code>vi arch/x86/pci/fixup.c</code></font></p>
<p>I&#8217;m using Ubu 32-bit on intel so I changed the file in the directory fixup.c belonging pci x86 architecture. If you have other types of laptops in this series with other features, and you have the same bug, you can edit the same file in a directory other than x86. For example for 64-bit version you have to access the file arch/ia64/pci/fixup.c and paste the contents of the file to patch.</p>
<p>8)We can dedicate ourselves to the specific change in the configuration file according to our preferences if we want something optimized for our machine, otherwise you can leave as is (both are already the choice of configuration files that are currently used to boot linux ) and skip to step 9. For perfectionists, however this is the command to access the configuration menu<br />
<font color=#00ff00><code># make menuconfig</code></font></p>
<p>9)Now we carry out thorough cleaning of the code (useful if you happen to have to start over from scratch even if errors occur during compilation)<br />
<font color=#00ff00><code># make-kpkg clean</code></font></p>
<p>10) Now is the most annoying: the compilation itself. on my machine has made us almost an hour<br />
<font color=#00ff00><code># CONCURRENCY_LEVEL=2 fakeroot make-kpkg  --initrd --append-to-version=-asus kernel_image kernel_headers</code></font></p>
<p>After &#8211;append-to-version=  you have to write a string that will serve to distinguish the customized version of the kernel. This string must begin with dash &#8220;-&#8221; and must not contain white spaces. I wrote down &#8220;-asus&#8221; then do as you like, you choose a name what you like.</p>
<p>11) Now go and make a turn. Go to the gym, go to crush a nap, do whatever you want so we can see in an hour  <img src='http://www.bellaboratories.altervista.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>12) At the end of compilation in the directory can find the newly created deb packages. All that remains is to install</p>
<p><font color=#00ff00><code># sudo dpkg -i linux-image-2.6.28.9-asus_2.6.28.9-asus-10.00.Custom_i386<br />
# sudo dpkg -i linux-headers-2.6.28.9-asus_2.6.28.9-asus-10.00.Custom_i386 </code></font></p>
<p>Et voilà. Now you have to do is restart and select the kernel you have just completed to start ubuntu without having to change the line in the grub with the usual restriction of memory: the three are all jig! After that you can use the proprietary fglrx driver of the ATC. I put the 9.5. Happy to have been of help ;D</p>
<p>BL - President</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=85</wfw:commentRss>
		</item>
		<item>
		<title>Custom Kernel compiling bug in debian mode</title>
		<link>http://www.bellaboratories.altervista.org/?p=86</link>
		<comments>http://www.bellaboratories.altervista.org/?p=86#comments</comments>
		<pubDate>Thu, 11 Jun 2009 21:24:13 +0000</pubDate>
		<dc:creator>president</dc:creator>
		
		<category><![CDATA[LNX/UNX]]></category>

		<category><![CDATA[Debian]]></category>

		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=86</guid>
		<description><![CDATA[  Hello people, another small adventure I was involved in the linux world, on my notebook with Ubuntu 9.04: it appears that in recent kernels, starting from version 2.6.27.x, there is a problem that prevents the proper installation of the customized versions . At the end of the compilation mode debian, at the time of [...] ]]></description>
			<content:encoded><![CDATA[<p> Hello people, another small adventure I was involved in the linux world, on my notebook with Ubuntu 9.04: it appears that in recent kernels, starting from version 2.6.27.x, there is a problem that prevents the proper installation of the customized versions . At the end of the compilation mode debian, at the time of installation, dpkg fails to load the nvidia-common package. The thing is not serious even if it were not for the continuous signal at the end of installation of any package.</p>
<p><code><font color=#00ff00><br />
Configure linux-image-2.6.28.9-m51se (2.6.28.9-m51se-10.00.Custom) &#8230;<br />
Running depmod.<br />
Finding valid ramdisk creators.<br />
Using mkinitramfs-kpkg to build the ramdisk.<br />
initrd.img(/boot/initrd.img-2.6.28.9-m51se<br />
) points to /boot/initrd.img-2.6.28.9-m51se<br />
 (/boot/initrd.img-2.6.28.9-m51se) &#8212; doing nothing at /var/lib/dpkg/info/linux-image-2.6.28.9-m51se.postinst line 588.<br />
vmlinuz(/boot/vmlinuz-2.6.28.9-m51se<br />
) points to /boot/vmlinuz-2.6.28.9-m51se<br />
 (/boot/vmlinuz-2.6.28.9-m51se) &#8212; doing nothing at /var/lib/dpkg/info/linux-image-2.6.28.9-m51se.postinst line 588.<br />
Running postinst hook script update-grub.<br />
Searching for GRUB installation directory &#8230; found: /boot/grub<br />
Searching for default file &#8230; found: /boot/grub/default<br />
Testing for an existing GRUB menu.lst file &#8230; found: /boot/grub/menu.lst<br />
Searching for splash image &#8230; none found, skipping &#8230;<br />
Found kernel: /boot/vmlinuz-2.6.28.9-m51se<br />
Found kernel: /boot/vmlinuz-2.6.28-11-generic<br />
Found kernel: /boot/vmlinuz-2.6.24-24-generic<br />
Found kernel: /boot/memtest86+.bin<br />
Updating /boot/grub/menu.lst &#8230; done</p>
<p>Examining /etc/kernel/postinst.d.<br />
run-parts: executing /etc/kernel/postinst.d/dkms<br />
run-parts: executing /etc/kernel/postinst.d/nvidia-common<br />
run-parts: /etc/kernel/postinst.d/nvidia-common exited with return code 20<br />
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.28.9-m51se.postinst line 1186.<br />
dpkg: error processing linux-image-2.6.28.9-m51se (&#8211;configure):<br />
 subprocess post-installation script returned error exit status 2<br />
Errors were encountered while processing:<br />
 linux-image-2.6.28.9-m51se<br />
E: Sub-process /usr/bin/dpkg returned an error code (1)</p>
<p></font></code></p>
<p>To resolve I had to do the following:<br />
<code><font color=#00ff00><br />
sudo chmod -x /etc/kernel/postinst.d/nvidia-common<br />
sudo apt-get remove nvidia-common<br />
</font></code><br />
This completes the installation of the custom kernel. However, the /etc/kernel/postinst.d/nvidia-common is still there. So, I, reinstalled it and then purged:<br />
<code><font color=#00ff00><br />
sudo apt-get install nvidia-common<br />
sudo apt-get purge nvidia-common<br />
</font></code><br />
After that, the file is gone and the problem is solved.<br />
Bye!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=86</wfw:commentRss>
		</item>
		<item>
		<title>Free IP SWITCHER: switch between different networks&#8230;</title>
		<link>http://www.bellaboratories.altervista.org/?p=84</link>
		<comments>http://www.bellaboratories.altervista.org/?p=84#comments</comments>
		<pubDate>Fri, 21 Mar 2008 20:59:40 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=84</guid>
		<description><![CDATA[  How many times you have to change your network settings? Every time you change your connection location (RCOST, HOME, STREET, UNI…  ). Many friends tell me about this problem: every time you had to change proxy, ip settings, protection etc…
Free IP Switcher  is the perfect tool for this situation. It offers a [...] ]]></description>
			<content:encoded><![CDATA[<p> How many times you have to change your network settings? Every time you change your connection location (RCOST, HOME, STREET, UNI… <img src='http://www.bellaboratories.altervista.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). Many friends tell me about this problem: every time you had to change proxy, ip settings, protection etc…</p>
<p><a href="http://www.eusing.com/ipswitch/free_ip_switcher.htm">Free IP Switcher</a>  is the perfect tool for this situation. It offers a one click change of the network settings that require no reboot. Probably the fastest solution if you connect to different networks regularly.<br />
What I really like is the feature to import the current network settings which spares you from the hassle to add them to the IP Changer as well. Different IP settings are available in tabs in the program and it only takes two clicks to activate another configuration.</p>
<p><img src= "/imgs/is.jpg" /></p>
<p>The program offers several additional settings that can be added if needed besides the obvious ones like IP, DNS and Proxy. The computer name and the Workgroup can be changed as well as the default printer of the system. Last but not least it is possible to set the DNS Domain and a Wins server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=84</wfw:commentRss>
		</item>
		<item>
		<title>Sun: an hidden Ftp Client class</title>
		<link>http://www.bellaboratories.altervista.org/?p=83</link>
		<comments>http://www.bellaboratories.altervista.org/?p=83#comments</comments>
		<pubDate>Tue, 08 Jan 2008 20:13:08 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Tips/Tricks]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=83</guid>
		<description><![CDATA[  During my studies in Computer Networks when I was searching an example about FTP, I&#8217;ve found a very important information about the previous protocol: in  JRE there&#8217;s sun.net.ftp.FtpClient, a class that implements the FTP protocol, but there isn&#8217;t any trace of the relative documentation. So I did a little search on Sun official [...] ]]></description>
			<content:encoded><![CDATA[<p> During my studies in Computer Networks when I was searching an example about FTP, I&#8217;ve found a very important information about the previous protocol: in <a href="http://java.sun.com/javase/6/docs/technotes/guides/index.html#jre-jdk"> JRE</a> there&#8217;s <font color=#00ff00>sun.net.ftp.FtpClient</font>, a class that implements the FTP protocol, but there isn&#8217;t any trace of the relative documentation. So I did a little search on Sun official site and now you can see what I&#8217;ve found.<br />
<a href="http://sunsolve.sun.com/search/document.do?assetkey=1-25-14474-1"> http://sunsolve.sun.com/search/document.do?assetkey=1-25-14474-1</a></p>
<p>by President</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=83</wfw:commentRss>
		</item>
		<item>
		<title>Save Desktop&#8217;s Icons Layout in Win 2000/Xp in a couple of seconds</title>
		<link>http://www.bellaboratories.altervista.org/?p=82</link>
		<comments>http://www.bellaboratories.altervista.org/?p=82#comments</comments>
		<pubDate>Mon, 07 Jan 2008 21:56:37 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=82</guid>
		<description><![CDATA[  How many of us always (maybe) ask and look for a method to save Desktop&#8217;s Icons Layout with a simple program. Why? Because when our os crashes or when we change monitor resolution, we LOOSE our layout! Is it a problem? IMHO It&#8217;s a great problem.
Fortunately I have just found this software!
 ]]></description>
			<content:encoded><![CDATA[<p> How many of us always (maybe) ask and look for a method to save Desktop&#8217;s Icons Layout with a simple program. Why? Because when our os crashes or when we change monitor resolution, we LOOSE our layout! Is it a problem? IMHO It&#8217;s a great problem.<br />
Fortunately I have just found <a href="http://users.rcn.com/taylotr/icon_restore.html">this software!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=82</wfw:commentRss>
		</item>
		<item>
		<title>How to Fuck University&#8217;s LAB (BC, FC etc&#8230;)</title>
		<link>http://www.bellaboratories.altervista.org/?p=81</link>
		<comments>http://www.bellaboratories.altervista.org/?p=81#comments</comments>
		<pubDate>Fri, 04 Jan 2008 10:27:09 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Security]]></category>

		<category><![CDATA[Various]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[Video]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=81</guid>
		<description><![CDATA[  I don&#8217;t know if you agree with me, but I hate university&#8217;s lab workers(so called &#8220;experts&#8221;) and their restrictions. When you want to surf the net (in our University) you must logging in again with another password when you open Firefox or IE; then you can only visit some sites otherwise your account will [...] ]]></description>
			<content:encoded><![CDATA[<p> I don&#8217;t know if you agree with me, but I hate university&#8217;s lab workers(so called &#8220;experts&#8221;) and their restrictions. When you want to surf the net (in our University) you must logging in again with another password when you open Firefox or IE; then you can only visit some sites otherwise your account will be blocked&#8230; So try this. Open Windows Calculator(Accessories&#8211;> Calculator) then right click on the window&#8217;s border and hit <font color=#00ff00>PASS TO URL</font>: now you can visit all you want without loggin in!<br />
If you don&#8217;t understand look at these videos:</p>
<p><embed src="http://www.gofish.com/player/fwplayer.swf" width="448" height="336" align="middle" quality="high" bgcolor="#000000" name="fwplayer" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="&#038;loc=blog_blog&amp;gf=false&amp;ns=false&amp;fs=true&amp;gfid=30-1060480&amp;c=grey&amp;autoPlay=false&amp;getAd=false&amp;wm=true&amp;ct=true&amp;tb=false"></embed><br />
</p>
<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/lHEaCKCICvA&#038;rel=0&#038;border=0"></param>
<param name="wmode" value="transparent"></param>
<p><embed src="http://www.youtube.com/v/lHEaCKCICvA&#038;rel=0&#038;border=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>
<p>
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=81</wfw:commentRss>
		</item>
		<item>
		<title>Get a Free Unix Shell access (YEAH!)</title>
		<link>http://www.bellaboratories.altervista.org/?p=79</link>
		<comments>http://www.bellaboratories.altervista.org/?p=79#comments</comments>
		<pubDate>Wed, 02 Jan 2008 17:38:06 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Engineering]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[LNX/UNX]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=79</guid>
		<description><![CDATA[  From my mail bag:
Where can I get free interactive access to HP-UX or Linux distro or UNIX shell access? Here!

You can simply grab and try out any Linux / BSD / Solaris Live CD. However, some time you cannot install and use particular UNIX like os. So, if you want to try the latest [...] ]]></description>
			<content:encoded><![CDATA[<p> From my mail bag:</p>
<p>Where can I get free interactive access to HP-UX or Linux distro or UNIX shell access? <a href="http://www.testdrive.hp.com/">Here!</a></p>
<p><img src="/imgs/terminal.png" alt="" /></p>
<p>You can simply grab and try out any Linux / BSD / Solaris Live CD. However, some time you cannot install and use particular UNIX like os. So, if you want to try the latest technologies over the Internet? Try HP TestDrive program:</p>
<blockquote><p><em>This program allows you to testdrive some of the hottest hardware and operating systems available today. Have you ever wanted to try out HP’s exciting 64-bit Integrity and PA-RISC technology? Get time on SMP x86 and Opteron ProLiant servers? Try out a Blade server. Try different Open Source operating systems such as FreeBSD, Suse, Redhat, Debian and other Linux distributions. </em>
</p></blockquote>
<p>This program is perfect for students and new users to try out and learn basis of UNIX. You can also try and test your C/C++ programs using latest Intel compilers. It is intended for those users who want to sample the 32- and 64-bit servers running a variety of HP, UNIX, Linux and third-party operating systems and applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=79</wfw:commentRss>
		</item>
		<item>
		<title>RSS updates via SMS</title>
		<link>http://www.bellaboratories.altervista.org/?p=78</link>
		<comments>http://www.bellaboratories.altervista.org/?p=78#comments</comments>
		<pubDate>Wed, 02 Jan 2008 17:30:20 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Various]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<category><![CDATA[Mobile]]></category>

		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=78</guid>
		<description><![CDATA[  When I open my Firefox Web Browser I see hundreds of RSS feeds&#8230; RSS feeds are always a great method to stay tuned on your preferred sites. But if I wanna have updates on my mobile phone? Here is the key!
Web-alerts.com, a free web service that forwards RSS updates to your mobile phone by [...] ]]></description>
			<content:encoded><![CDATA[<p> When I open my Firefox Web Browser I see hundreds of RSS feeds&#8230; RSS feeds are always a great method to stay tuned on your preferred sites. But if I wanna have updates on my mobile phone? <a href="http://www.web-alerts.com">Here</a> is the key!<br />
Web-alerts.com, a free web service that forwards RSS updates to your mobile phone by SMS message, offers a helpful way to stay on top of important-but-infrequently-updated web sites. </p>
<p><img src="/imgs/webalerts.jpg" alt="" /></p>
<p>Type in a site&#8217;s URL or feed address, then your mobile phone number, and you&#8217;re on your way to mobile updates. You can also preview your feed messages and have only updates with certain keywords sent along.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=78</wfw:commentRss>
		</item>
		<item>
		<title>Happy new Year! 2008!</title>
		<link>http://www.bellaboratories.altervista.org/?p=77</link>
		<comments>http://www.bellaboratories.altervista.org/?p=77#comments</comments>
		<pubDate>Tue, 01 Jan 2008 10:34:10 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[n/d]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=77</guid>
		<description><![CDATA[  Happy new year to all BL&#8217;s readers. Have a great, nice, lightning year. Have the best year in 2008!
We promise new articles, more tricks, more info, more technology in this new year.
Bye and Thanks to all for your attention!
Continue to read US!
 ]]></description>
			<content:encoded><![CDATA[<p> Happy new year to all BL&#8217;s readers. Have a great, nice, lightning year. Have the best year in 2008!<br />
We promise new articles, more tricks, more info, more technology in this new year.</p>
<p>Bye and Thanks to all for your attention!<br />
Continue to read US!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=77</wfw:commentRss>
		</item>
		<item>
		<title>Jar? No, It&#8217;s Better an Exe FILE!</title>
		<link>http://www.bellaboratories.altervista.org/?p=76</link>
		<comments>http://www.bellaboratories.altervista.org/?p=76#comments</comments>
		<pubDate>Mon, 24 Dec 2007 11:19:39 +0000</pubDate>
		<dc:creator>BeL Lab Vice President</dc:creator>
		
		<category><![CDATA[Engineering]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Tips/Tricks]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.bellaboratories.altervista.org/?p=76</guid>
		<description><![CDATA[  This article is a tribute for my friend &#8220;DDP&#8221;(we can call him &#8220;The king of Computer and Bayesan Networks&#8221;, he just got last title on 2007/19/12). He always explained me a problem about java releases: &#8220;How can I create an installation file? What can I do when the final user doesn&#8217;t have a JRE? [...] ]]></description>
			<content:encoded><![CDATA[<p> This article is a tribute for my friend &#8220;DDP&#8221;(we can call him &#8220;The king of Computer and Bayesan Networks&#8221;, he just got last title on 2007/19/12). He always explained me a problem about java releases: <em>&#8220;How can I create an installation file? What can I do when the final user doesn&#8217;t have a JRE? Is it a method? Can You explain me how to do this?&#8221;</em>.<br />
Of course, one can distribute a plain JAR file, but not all users will be able to start it successfully.<br />
It is better to give them a normal plain installer package that they know how to run through the wizard. You may also want to bundle a JRE with your application so your program will run on every machine with no JRE installed. I would also advise obfuscate your code, thus, no evil hacker could get your code too easily. It also makes sense to wrap your Java application in a regular windows executable (EXE) file.</p>
<p>You will need the following tools and libraries that are distributed free of charge:</p>
<p>1. <a href="http://ant.apache.org/">Ant tool.</a><br />
2. <a href="http://nsis.sourceforge.net/">NSIS: a scriptable win32 installer/uninstaller system.</a><br />
3. <a href="http://proguard.sourceforge.net/">ProGuard: java shrinker, optimizer, and obfuscator.</a><br />
4. <a href="http://launch4j.sourceforge.net/">Launch4j: Cross-platform Java executable wrapper for creating lightweight Windows native EXEs.</a><br />
5. <a href="http://nsisant.sourceforge.net/">NSIS Ant task: to compile NSIS scripts.</a></p>
<p>The goal is to create a single build.xml file that will compile (JAVAC), obfuscate, shrink, optimize (ProGuard) our code, create an EXE file (Launch4j) and pack it all including other files (like license text file) to an installer package (NSIS).</p>
<p>The ant build file consists of a number of targets that can depend upon other targets in the same build file. That means before the target does something useful it will run the targets it depends upon:</p>
<p>Now download <a href="http://bellaboratories.altervista.org/code/build.xml">build.xml</a> file and we&#8217;ll comment it together&#8230;</p>
<h1>Initialization Target</h1>
<p>First, let’s define a number of properties:</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;property name=<span class="st0">&quot;src&quot;</span> location=<span class="st0">&quot;d:<span class="es0">\m</span>yproggy<span class="es0">\s</span>rc&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;lib&quot;</span> location=<span class="st0">&quot;lib&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;images&quot;</span> location=<span class="st0">&quot;images&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;nsis&quot;</span> location=<span class="st0">&quot;nsis&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;dist&quot;</span> location=<span class="st0">&quot;dist&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;html&quot;</span> location=<span class="st0">&quot;html&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;build&quot;</span> location=<span class="st0">&quot;build&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;launch4j.dir&quot;</span> location=<span class="st0">&quot;../..&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span class="st0">&quot;original.dir&quot;</span> location=<span class="st0">&quot;d:<span class="es0">\m</span>yproggy&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>You may want to justify the paths according to your system.</p>
<p>The target init will depend upon target ‘clean’ – we want to clean everything before the build starts:</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;target name=<span class="st0">&quot;clean&quot;</span> description=<span class="st0">&quot;clean up&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${build}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${html}&quot;</span>/&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${images}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${lib}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${dist}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>After it is over, the target ‘init’ will run.</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;target name=<span class="st0">&quot;init&quot;</span> depends=<span class="st0">&quot;clean&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tstamp /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mkdir <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${build}&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mkdir <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${html}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mkdir <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${images}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mkdir <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${lib}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mkdir <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${dist}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;copy todir=<span class="st0">&quot;${html}&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${original.dir}/html/&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/copy&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;copy todir=<span class="st0">&quot;${images}&quot;</span>&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${original.dir}/images/&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/copy&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;copy todir=<span class="st0">&quot;${lib}&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${original.dir}/lib&quot;</span>/&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/copy&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>We create a number of folders, copy source code, libraries, html, and image files.</p>
<h1>Compile Target</h1>
<p>Compile the classes and copy the required files, such as Velocity templates and property files to the folder with the freshly compiled classes.</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;target name=<span class="st0">&quot;compile&quot;</span> depends=<span class="st0">&quot;init&quot;</span> description=<span class="st0">&quot;compile the source&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;javac srcdir=<span class="st0">&quot;${src}&quot;</span> destdir=<span class="st0">&quot;${build}&quot;</span> classpathref=<span class="st0">&quot;dist.classpath&quot;</span> source=<span class="st0">&quot;1.5&quot;</span> debug=<span class="st0">&quot;on&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;copy todir=<span class="st0">&quot;${build}&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${src}&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=<span class="st0">&quot;*.vm&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=<span class="st0">&quot;*.properties&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/copy&gt;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<h1>JAR Target</h1>
<p>Next step is to create a JAR file and feed it to ProGuard that will “obfuscate, shrink, optimize” our code. ProGuard task has a number of limitations and requirements, so while my example is pretty clear you may want to read the ProGuard documentation. In a few words you name the libraries that are used by your application, specify you jar file name, and the name of the jar that will be the result of ProGuard’s work. ProGuard modifies the names of classes, so you need to keep the name of your Main-Class untouched. Anyway, consult the docs or you may run into some issues here.</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;target name=<span class="st0">&quot;jar&quot;</span> depends=<span class="st0">&quot;compile&quot;</span> description=<span class="st0">&quot;create the jar&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${lib}&quot;</span> id=<span class="st0">&quot;lib.dist.fileset&quot;</span>&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;include name=<span class="st0">&quot;**/*.jar&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/fileset&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;pathconvert pathsep=<span class="st0">&quot; &quot;</span> property=<span class="st0">&quot;dist.classpath&quot;</span> refid=<span class="st0">&quot;lib.dist.fileset&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;map from=<span class="st0">&quot;${lib}&quot;</span> to=<span class="st0">&quot;.<span class="es0">\l</span>ib&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/pathconvert&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; Put everything in $<span class="br0">&#123;</span>build<span class="br0">&#125;</span> into a jar <a href="http://www.php.net/file"><span class="kw3">file</span></a> &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;jar jarfile=<span class="st0">&quot;${ant.project.name}.jar&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;fileset <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${build}&quot;</span> includes=<span class="st0">&quot;**/*&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;manifest&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; SET YOUR MAIN <span class="kw2">CLASS</span> HERE &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;attribute name=<span class="st0">&quot;Main-Class&quot;</span> value=<span class="st0">&quot;com.javazing.MyProggyLauncher&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;attribute name=<span class="st0">&quot;Class-Path&quot;</span> value=<span class="st0">&quot;. ${dist.classpath}&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/manifest&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/jar&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; obfuscate and optimize by ProGuard &#8211;&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;taskdef resource=<span class="st0">&quot;proguard/ant/task.properties&quot;</span> classpath=<span class="st0">&quot;${launch4j.dir}/lib/proguard.jar&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;proguard&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars jre/lib/rt.jar </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/commons-collections<span class="nu0">-3.1</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/commons-io<span class="nu0">-1.2</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/commons-lang<span class="nu0">-2.1</span>.jar</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/commons-logging.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/hsqldb.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/jdom<span class="nu0">-1.0</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/log4j.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/lucene-core<span class="nu0">-1.9</span><span class="nu0">.1</span>.jar</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.core.commands_3<span class="nu0">.2</span><span class="nu0">.0</span>.I20060511-0800a.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.equinox.common_3<span class="nu0">.2</span><span class="nu0">.0</span>.v20060512.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.jface.text_3<span class="nu0">.2</span><span class="nu0">.0</span>.v20060518<span class="nu0">-0800</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.jface_3<span class="nu0">.2</span><span class="nu0">.0</span>.I20060511-0800a.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.osgi_3<span class="nu0">.2</span><span class="nu0">.0</span>.v20060510.jar</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.swt.win32.win32.x86_3<span class="nu0">.2</span><span class="nu0">.0</span>.v3224.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/org.eclipse.text_3<span class="nu0">.2</span><span class="nu0">.0</span>.v20060518<span class="nu0">-0800</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/rome<span class="nu0">-0.8</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -libraryjars lib/velocity<span class="nu0">-1.4</span>.jar&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -injars &nbsp; &nbsp; &nbsp;$<span class="br0">&#123;</span>ant.project.name<span class="br0">&#125;</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -outjars &nbsp; &nbsp; obfuscated_$<span class="br0">&#123;</span>ant.project.name<span class="br0">&#125;</span>.jar</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -keepclasseswithmembers <span class="kw2">public</span> <span class="kw2">class</span> * <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">public</span> <a href="http://www.php.net/static"><span class="kw3">static</span></a> void main<span class="br0">&#40;</span>java.lang.String<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -dontskipnonpubliclibraryclasses</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -keep <span class="kw2">public</span> <span class="kw2">class</span> com.javazing.MyProggyLauncher</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -keep <span class="kw2">class</span> * implements java.sql.Driver</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/proguard&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<h1>EXE Target</h1>
<p>After the JAR target, we have a jar file that needs to be wrapped to become a native Windows executable file. We use Launch4j tool here. Launch4j needs an xml file with the settings:</p>
<p><font color=#00ff00>XML, proggy.xml</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;launch4jConfig&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;dontWrapJar&gt;false&lt;/dontWrapJar&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;headerType&gt;<span class="nu0">0</span>&lt;/headerType&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;jar&gt;..\obfuscated_my_cool_proggy.jar&lt;/jar&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;outfile&gt;..\my_cool_proggy.exe&lt;/outfile&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;errTitle&gt;MyProggy&lt;/errTitle&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;jarArgs&gt;&lt;/jarArgs&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;chdir&gt;.&lt;/chdir&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;customProcName&gt;false&lt;/customProcName&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;stayAlive&gt;false&lt;/stayAlive&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;icon&gt;proggy.ico&lt;/icon&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;jre&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;path&gt;jre&lt;/path&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;minVersion&gt;<span class="nu0">1.5</span><span class="nu0">.0</span>&lt;/minVersion&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;maxVersion&gt;&lt;/maxVersion&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;initialHeapSize&gt;<span class="nu0">0</span>&lt;/initialHeapSize&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;maxHeapSize&gt;<span class="nu0">0</span>&lt;/maxHeapSize&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;args&gt;&lt;/args&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&lt;/jre&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&lt;splash&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;file&gt;proggy.bmp&lt;/file&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;waitForWindow&gt;true&lt;/waitForWindow&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;timeout&gt;<span class="nu0">60</span>&lt;/timeout&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;timeoutErr&gt;true&lt;/timeoutErr&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/splash&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;/launch4jConfig&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>You may want to get an ICO &#038; BMP images for your application. The icon file is the image to be rendered at the left top corner of every Windows application. The BMP file will be displayed as a splash file when the proggy starts. Java 1.6 has built-in splash functionality, so you may want to use it along with some nice PNG image with shadows and other alpha tricks, and not the Launch4J’s ugly bmp file.</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;target name=<span class="st0">&quot;exe&quot;</span> depends=<span class="st0">&quot;jar&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;taskdef name=<span class="st0">&quot;launch4j&quot;</span> classname=<span class="st0">&quot;net.sf.launch4j.ant.Launch4jTask&quot;</span> classpath=<span class="st0">&quot;${launch4j.dir}/launch4j.jar</span></div>
</li>
<li class="li1">
<div class="de1"><span class="st0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :${launch4j.dir}/lib/xstream.jar&quot;</span> /&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;launch4j configFile=<span class="st0">&quot;./l4j/proggy.xml&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<h1>Distibution Target</h1>
<p>NSIS comes with a number of templates, samples, some nice graphics and GUI application. Therefore, you will definitely want to see its samples. my_proggy.nsi is the name of the script that will guide you installation and deinstallation processes: create folders, copy files, create menu group, create desktop icons etc.</p>
<p>NSIS script:</p>
<p><font color=#00ff00>XML</font></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; !<span class="kw1">include</span> <span class="st0">&quot;MUI.nsh&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_ICON <span class="st0">&quot;proggy.ico&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_UNICON <span class="st0">&quot;proggy.ico&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw2">Function</span> .onInit</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co2"># the plugins dir is automatically deleted when the installer exits</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitPluginsDir</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">File</span></a> /oname=<span class="re0">$PLUGINSDIR</span>\splash.bmp <span class="st0">&quot;D:<span class="es0">\m</span>yproggy<span class="es0">\s</span>plash.bmp&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co2">#optional</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co2">#File /oname=$PLUGINSDIR\splash.wav &quot;C:\myprog\sound.wav&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; splash::<span class="me2">show</span> <span class="nu0">1000</span> <span class="re0">$PLUGINSDIR</span>\splash</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Pop $<span class="nu0">0</span> ; $<span class="nu0">0</span> has <span class="st0">&#8216;1&#8242;</span> <span class="kw1">if</span> the user closed the splash screen early,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; <span class="st0">&#8216;0&#8242;</span> <span class="kw1">if</span> everything closed normally, and <span class="st0">&#8216;-1&#8242;</span> <span class="kw1">if</span> some error occurred.</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; FunctionEnd</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;General</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;;Name and <a href="http://www.php.net/file"><span class="kw3">file</span></a></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Name <span class="st0">&quot;${PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; OutFile <span class="st0">&quot;${EXE_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ;Default installation folder</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; InstallDir <span class="st0">&quot;$PROGRAMFILES<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; ;Get installation folder from registry <span class="kw1">if</span> available</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; InstallDirRegKey HKCU <span class="st0">&quot;Software<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span> <span class="st0">&quot;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Interface Configuration</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_HEADERIMAGE</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_HEADERIMAGE_BITMAP <span class="st0">&quot;proggy_header.bmp&quot;</span> ; optional</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; ;Variables</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">Var</span> MUI_TEMP</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">Var</span> STARTMENU_FOLDER</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Interface Settings</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_ABORTWARNING</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Pages</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_PAGE_LICENSE <span class="st0">&quot;license.rtf&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_PAGE_DIRECTORY</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; ;Start Menu Folder Page Configuration</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_STARTMENUPAGE_REGISTRY_ROOT <span class="st0">&quot;HKCU&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_STARTMENUPAGE_REGISTRY_KEY <span class="st0">&quot;Software<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !<a href="http://www.php.net/define"><span class="kw3">define</span></a> MUI_STARTMENUPAGE_REGISTRY_VALUENAME <span class="st0">&quot;Start Menu Folder&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_PAGE_STARTMENU Application <span class="re0">$STARTMENU_FOLDER</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_PAGE_INSTFILES</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_UNPAGE_CONFIRM</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_UNPAGE_INSTFILES</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Languages</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_LANGUAGE <span class="st0">&quot;English&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Installer Sections &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; Section <span class="st0">&quot;install&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; ;Add files</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; SetOutPath <span class="st0">&quot;$INSTDIR&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">File</span></a> <span class="st0">&quot;${FOLDER}<span class="es0">\$</span>{EXE_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">File</span></a> <span class="st0">&quot;${FOLDER}<span class="es0">\s</span>ettings.ini&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; SetOutPath <span class="st0">&quot;$INSTDIR&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> /r $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\images</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> /r $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\html</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> /r $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\jre</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> /r $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\lib</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\evaluation_license.txt</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/file"><span class="kw3">file</span></a> $<span class="br0">&#123;</span>FOLDER<span class="br0">&#125;</span>\license.rtf</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;create desktop shortcut</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; CreateShortCut <span class="st0">&quot;$DESKTOP<span class="es0">\$</span>{PRODUCT_NAME}.lnk&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\$</span>{EXE_NAME}&quot;</span> <span class="st0">&quot;&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;create start-menu items</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; CreateDirectory <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; CreateShortCut <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>{PRODUCT_NAME}<span class="es0">\U</span>ninstall.lnk&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\U</span>ninstall.exe&quot;</span> <span class="st0">&quot;&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\U</span>ninstall.exe&quot;</span> <span class="nu0">0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; CreateShortCut <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>{PRODUCT_NAME}<span class="es0">\$</span>{PRODUCT_NAME}.lnk&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\$</span>{EXE_NAME}&quot;</span> <span class="st0">&quot;&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\$</span>{EXE_NAME}&quot;</span> <span class="nu0">0</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;write uninstall information to the registry</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; WriteRegStr HKLM <span class="st0">&quot;Software<span class="es0">\M</span>icrosoft<span class="es0">\W</span>indows<span class="es0">\C</span>urrentVersion<span class="es0">\U</span>ninstall<span class="es0">\$</span>{SHORT_NAME}&quot;</span> <span class="st0">&quot;DisplayName&quot;</span> <span class="st0">&quot;${SHORT_NAME} (remove only)&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; WriteRegStr HKLM <span class="st0">&quot;Software<span class="es0">\M</span>icrosoft<span class="es0">\W</span>indows<span class="es0">\C</span>urrentVersion<span class="es0">\U</span>ninstall<span class="es0">\$</span>{SHORT_NAME}&quot;</span> <span class="st0">&quot;UninstallString&quot;</span> <span class="st0">&quot;$INSTDIR<span class="es0">\U</span>ninstall.exe&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; WriteUninstaller <span class="st0">&quot;$INSTDIR<span class="es0">\U</span>ninstall.exe&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; SectionEnd</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; ;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Uninstaller Section</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; Section <span class="st0">&quot;Uninstall&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; ;ADD YOUR OWN FILES HERE&#8230;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Delete Files</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/rmdir"><span class="kw3">RMDir</span></a> /r <span class="st0">&quot;$INSTDIR<span class="es0">\*</span>.*&quot;</span> &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Remove the installation directory</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/rmdir"><span class="kw3">RMDir</span></a> <span class="st0">&quot;$INSTDIR&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Delete Start Menu Shortcuts</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Delete <span class="st0">&quot;$DESKTOP<span class="es0">\$</span>{PRODUCT_NAME}.lnk&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Delete <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>{PRODUCT_NAME}<span class="es0">\*</span>.*&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/rmdir"><span class="kw3">RmDir</span></a> &nbsp;<span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; ;Delete Uninstaller And Unistall Registry Entries</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; DeleteRegKey HKEY_LOCAL_MACHINE <span class="st0">&quot;SOFTWARE<span class="es0">\$</span>{SHORT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; DeleteRegKey HKEY_LOCAL_MACHINE <span class="st0">&quot;SOFTWARE<span class="es0">\M</span>icrosoft<span class="es0">\W</span>indows<span class="es0">\C</span>urrentVersion<span class="es0">\U</span>ninstall<span class="es0">\$</span>{SHORT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; Delete <span class="st0">&quot;$INSTDIR<span class="es0">\U</span>ninstall.exe&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/rmdir"><span class="kw3">RMDir</span></a> <span class="st0">&quot;$INSTDIR&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; !insertmacro MUI_STARTMENU_GETFOLDER Application <span class="re0">$MUI_TEMP</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; Delete <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>MUI_TEMP<span class="es0">\U</span>ninstall.lnk&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ;Delete <a href="http://www.php.net/empty"><span class="kw3">empty</span></a> start menu parent diretories</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; StrCpy <span class="re0">$MUI_TEMP</span> <span class="st0">&quot;$SMPROGRAMS<span class="es0">\$</span>MUI_TEMP&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; startMenuDeleteLoop:</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ClearErrors</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/rmdir"><span class="kw3">RMDir</span></a> <span class="re0">$MUI_TEMP</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GetFullPathName <span class="re0">$MUI_TEMP</span> <span class="st0">&quot;$MUI_TEMP<span class="es0">\.</span>.&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IfErrors startMenuDeleteLoopDone</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/strcmp"><span class="kw3">StrCmp</span></a> <span class="re0">$MUI_TEMP</span> <span class="re0">$SMPROGRAMS</span> startMenuDeleteLoopDone startMenuDeleteLoop</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; startMenuDeleteLoopDone:</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; DeleteRegKey /ifempty HKCU <span class="st0">&quot;Software<span class="es0">\$</span>{PRODUCT_NAME}&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; SectionEnd</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; ;Function that calls a messagebox when installation finished correctly</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw2">Function</span> .onInstSuccess</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; MessageBox MB_OK <span class="st0">&quot;You have successfully installed ${PRODUCT_NAME}. Use the desktop icon to start the program.&quot;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; FunctionEnd</div>
</li>
<li class="li1">
<div class="de1">&nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw2">Function</span> un.onUninstSuccess</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; MessageBox MB_OK <span class="st0">&quot;You have successfully uninstalled ${PRODUCT_NAME}.&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; FunctionEnd</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>NSIS script And the appropriate target.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&lt;target name=<span class="st0">&quot;dist&quot;</span> &nbsp;depends=<span class="st0">&quot;exe&quot;</span> description=<span class="st0">&quot;make installation package for distribution&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;taskdef name=<span class="st0">&quot;nsis&quot;</span> classname=<span class="st0">&quot;net.sf.nsisant.Task&quot;</span>&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;classpath location=<span class="st0">&quot;nsisant-1.2.jar&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/taskdef&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;nsis script=<span class="st0">&quot;nsis/my_proggy.nsi&quot;</span> verbosity=<span class="st0">&quot;4&quot;</span> out=<span class="st0">&quot;nsis_build.log&quot;</span> noconfig=<span class="st0">&quot;yes&quot;</span>&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;define name=<span class="st0">&quot;VERSION&quot;</span> value=<span class="st0">&quot;1.0&quot;</span>/&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;define name=<span class="st0">&quot;PRODUCT_NAME&quot;</span> value=<span class="st0">&quot;My Proggy&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;define name=<span class="st0">&quot;EXE_NAME&quot;</span> value=<span class="st0">&quot;${ant.project.name}.exe&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;define name=<span class="st0">&quot;SHORT_NAME&quot;</span> value=<span class="st0">&quot;MyCoolProggy&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;define name=<span class="st0">&quot;FOLDER&quot;</span> value=<span class="st0">&quot;D:<span class="es0">\l</span>aunch4j<span class="es0">\M</span>yProggy&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/nsis&gt;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;copy <a href="http://www.php.net/file"><span class="kw3">file</span></a>=<span class="st0">&quot;${nsis}/${ant.project.name}.exe&quot;</span> tofile=<span class="st0">&quot;${dist}/${ant.project.name}.exe&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/file"><span class="kw3">file</span></a>=<span class="st0">&quot;${nsis}/${ant.project.name}.exe&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${build}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${html}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${images}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/dir"><span class="kw3">dir</span></a>=<span class="st0">&quot;${lib}&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/file"><span class="kw3">file</span></a>=<span class="st0">&quot;${ant.project.name}.jar&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/file"><span class="kw3">file</span></a>=<span class="st0">&quot;${ant.project.name}.exe&quot;</span>/&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;delete <a href="http://www.php.net/file"><span class="kw3">file</span></a>=<span class="st0">&quot;obfuscated_${ant.project.name}.jar&quot;</span> /&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/target&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>It is really convenient. After you make some changes in the code, you run a single file and have an installer package ready.</p>
<p>By the way, it also makes sense to check for the required system paths before the build process. Create a .BAT file:</p>
<p>DOS:<br />
<code><font color=#00ff00><br />
   1.<br />
      @echo off<br />
   2.<br />
      if &#8220;%ANT_HOME%&#8221;==&#8221;" goto noAntHome<br />
   3.<br />
      if &#8220;%JAVA_HOME%&#8221;==&#8221;" goto noJavaHome<br />
   4.</p>
<p>   5.<br />
      call &#8220;%ANT_HOME%\bin\ant.bat&#8221; dist<br />
   6.<br />
      goto end<br />
   7.</p>
<p>   8.<br />
      :noAntHome<br />
   9.<br />
      echo ANT_HOME environment variable is not set<br />
  10.<br />
      goto end<br />
  11.</p>
<p>  12.<br />
      :noJavaHome<br />
  13.<br />
      echo JAVA_HOME environment variable is not set<br />
  14.</p>
<p>  15.<br />
      :end<br />
</font></code></p>
<p>Good luck @ all, especially to my friend &#8220;The King of All&#8221;!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bellaboratories.altervista.org/?feed=rss2&amp;p=76</wfw:commentRss>
		</item>
	</channel>
</rss>
