<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eldri005</id>
	<title>NSIS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eldri005"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/Special:Contributions/Eldri005"/>
	<updated>2026-08-26T10:25:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10663</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10663"/>
		<updated>2006-06-09T17:38:18Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: Added more detail to the instructions for new users at top of page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
If this page is your first experience of NSIS, you will need the [http://nsis.sourceforge.net/Download NSIS compiler] to transform the following scripts, and any others you create, into functioning installers.  makensisw.exe in the NSIS installation folder is the actual compiler.  It has a graphical front end that explains three ways to load scripts, so it&#039;s very easy to use.  Once you have installed NSIS, to create an installer, copy a script into a text editor, save the file with a .nsi extension, and load the file into the makensisw compiler.  &lt;br /&gt;
&lt;br /&gt;
==The bare minimum==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start; every NSIS script has at least one section.&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply create a start menu item==&lt;br /&gt;
This installer creates a start menu item, nothing more&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# Name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # presently, the new shortcut doesn&#039;t call anything (the second field is blank)&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # to delete shortcut, go to start menu directory and manually delete it&lt;br /&gt;
&lt;br /&gt;
# default sec end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple installer and uninstaller with start menu item==&lt;br /&gt;
This installer will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; an uninstaller on the desktop; a shortcut in the start menu that points to the uninstaller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define name of installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define installation directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# start default section&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # set the installation directory as the destination for the following actions&lt;br /&gt;
    setOutPath $INSTDIR&lt;br /&gt;
   &lt;br /&gt;
    # create the uninstaller&lt;br /&gt;
    writeUninstaller &amp;quot;uninstall.exe&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # point the new shortcut at the program uninstaller&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;$INSTDIR\uninstall.exe&amp;quot;&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# uninstaller section start&lt;br /&gt;
section &amp;quot;uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # first, delete the uninstaller&lt;br /&gt;
    delete $INSTDIR\uninstall.exe&lt;br /&gt;
   &lt;br /&gt;
    # second, remove the link from the start menu&lt;br /&gt;
    delete &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# uninstaller section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply get current version of Java Runtime Environment==&lt;br /&gt;
This installer just checks the value of the CurrentVersion string for the JRE in the local machine registry using [http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.12 readRegStr].  If the result is blank, the JRE is probably not installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # read the value from the registry into the $0 register&lt;br /&gt;
    readRegStr $0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; CurrentVersion&lt;br /&gt;
    &lt;br /&gt;
    # print the results in a popup message box&lt;br /&gt;
    messageBox MB_OK &amp;quot;version: $0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Check if user is administrator==&lt;br /&gt;
Sometimes, it&#039;s necessary to check if an installer&#039;s user has administrative privileges.  This simple script checks for that using the &amp;quot;UserInfo&amp;quot; plugin.  There&#039;s a more sophisticated alternative at http://forums.winamp.com/showthread.php?threadid=195020, but this method seems to work fine.  Another example of UserInfo can be found  in the NSIS installation directory under \Examples\UserInfo\UserInfo.nsi.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # call userInfo plugin to get user info.  The plugin puts the result in the stack&lt;br /&gt;
    userInfo::getAccountType&lt;br /&gt;
   &lt;br /&gt;
    # pop the result from the stack into $0&lt;br /&gt;
    pop $0&lt;br /&gt;
   &lt;br /&gt;
    # compare the result with the string &amp;quot;Admin&amp;quot; to see if the user is admin. If match, jump 3 lines down.&lt;br /&gt;
    strCmp $0 &amp;quot;Admin&amp;quot; +3&lt;br /&gt;
   &lt;br /&gt;
    # if there is not a match, print message and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;not admin: $0&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
   &lt;br /&gt;
    # otherwise, confirm and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;is admin&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10650</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10650"/>
		<updated>2006-06-08T01:42:38Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: Added intro for new users and &amp;quot;The bare minimum&amp;quot; script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
If this page is your first experience of NSIS, you will need the [http://nsis.sourceforge.net/Download NSIS compiler] to transform the following scripts, and any others you create, into functioning installers.  Once you have that, copy a script into a text editor, save the file with a .nsi extension, and load it into the compiler to create the installer.&lt;br /&gt;
&lt;br /&gt;
==The bare minimum==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start; every NSIS script has at least one section.&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply create a start menu item==&lt;br /&gt;
This installer creates a start menu item, nothing more&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# Name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # presently, the new shortcut doesn&#039;t call anything (the second field is blank)&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # to delete shortcut, go to start menu directory and manually delete it&lt;br /&gt;
&lt;br /&gt;
# default sec end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple installer and uninstaller with start menu item==&lt;br /&gt;
This installer will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; an uninstaller on the desktop; a shortcut in the start menu that points to the uninstaller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define name of installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define installation directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# start default section&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # set the installation directory as the destination for the following actions&lt;br /&gt;
    setOutPath $INSTDIR&lt;br /&gt;
   &lt;br /&gt;
    # create the uninstaller&lt;br /&gt;
    writeUninstaller &amp;quot;uninstall.exe&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # point the new shortcut at the program uninstaller&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;$INSTDIR\uninstall.exe&amp;quot;&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# uninstaller section start&lt;br /&gt;
section &amp;quot;uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # first, delete the uninstaller&lt;br /&gt;
    delete $INSTDIR\uninstall.exe&lt;br /&gt;
   &lt;br /&gt;
    # second, remove the link from the start menu&lt;br /&gt;
    delete &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# uninstaller section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply get current version of Java Runtime Environment==&lt;br /&gt;
This installer just checks the value of the CurrentVersion string for the JRE in the local machine registry using [http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.12 readRegStr].  If the result is blank, the JRE is probably not installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # read the value from the registry into the $0 register&lt;br /&gt;
    readRegStr $0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; CurrentVersion&lt;br /&gt;
    &lt;br /&gt;
    # print the results in a popup message box&lt;br /&gt;
    messageBox MB_OK &amp;quot;version: $0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Check if user is administrator==&lt;br /&gt;
Sometimes, it&#039;s necessary to check if an installer&#039;s user has administrative privilages.  This simple script checks for that using the &amp;quot;UserInfo&amp;quot; plugin.  There&#039;s a more sophisticated alternative at http://forums.winamp.com/showthread.php?threadid=195020, but this method seems to work fine.  Another example of UserInfo can be found  in the NSIS installation directory under \Examples\UserInfo\UserInfo.nsi.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # call userInfo plugin to get user info.  The plugin puts the result in the stack&lt;br /&gt;
    userInfo::getAccountType&lt;br /&gt;
   &lt;br /&gt;
    # pop the result from the stack into $0&lt;br /&gt;
    pop $0&lt;br /&gt;
   &lt;br /&gt;
    # compare the result with the string &amp;quot;Admin&amp;quot; to see if the user is admin. If match, jump 3 lines down.&lt;br /&gt;
    strCmp $0 &amp;quot;Admin&amp;quot; +3&lt;br /&gt;
   &lt;br /&gt;
    # if there is not a match, print message and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;not admin: $0&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
   &lt;br /&gt;
    # otherwise, confirm and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;is admin&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10636</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10636"/>
		<updated>2006-06-04T22:05:34Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: Added section &amp;quot;Check if user is...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply create a start menu item==&lt;br /&gt;
This installer creates a start menu item, nothing more&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# Name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # presently, the new shortcut doesn&#039;t call anything (the second field is blank)&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # to delete shortcut, go to start menu directory and manually delete it&lt;br /&gt;
&lt;br /&gt;
# default sec end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple installer and uninstaller with start menu item==&lt;br /&gt;
This installer will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; an uninstaller on the desktop; a shortcut in the start menu that points to the uninstaller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define name of installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define installation directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# start default section&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # set the installation directory as the destination for the following actions&lt;br /&gt;
    setOutPath $INSTDIR&lt;br /&gt;
   &lt;br /&gt;
    # create the uninstaller&lt;br /&gt;
    writeUninstaller &amp;quot;uninstall.exe&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # point the new shortcut at the program uninstaller&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;$INSTDIR\uninstall.exe&amp;quot;&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# uninstaller section start&lt;br /&gt;
section &amp;quot;uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # first, delete the uninstaller&lt;br /&gt;
    delete $INSTDIR\uninstall.exe&lt;br /&gt;
   &lt;br /&gt;
    # second, remove the link from the start menu&lt;br /&gt;
    delete &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# uninstaller section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply get current version of Java Runtime Environment==&lt;br /&gt;
This installer just checks the value of the CurrentVersion string for the JRE in the local machine registry using [http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.12 readRegStr].  If the result is blank, the JRE is probably not installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # read the value from the registry into the $0 register&lt;br /&gt;
    readRegStr $0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; CurrentVersion&lt;br /&gt;
    &lt;br /&gt;
    # print the results in a popup message box&lt;br /&gt;
    messageBox MB_OK &amp;quot;version: $0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Check if user is administrator==&lt;br /&gt;
Sometimes, it&#039;s necessary to check if an installer&#039;s user has administrative privilages.  This simple script checks for that using the &amp;quot;UserInfo&amp;quot; plugin.  There&#039;s a more sophisticated alternative at http://forums.winamp.com/showthread.php?threadid=195020, but this method seems to work fine.  Another example of UserInfo can be found  in the NSIS installation directory under \Examples\UserInfo\UserInfo.nsi.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # call userInfo plugin to get user info.  The plugin puts the result in the stack&lt;br /&gt;
    userInfo::getAccountType&lt;br /&gt;
   &lt;br /&gt;
    # pop the result from the stack into $0&lt;br /&gt;
    pop $0&lt;br /&gt;
   &lt;br /&gt;
    # compare the result with the string &amp;quot;Admin&amp;quot; to see if the user is admin. If match, jump 3 lines down.&lt;br /&gt;
    strCmp $0 &amp;quot;Admin&amp;quot; +3&lt;br /&gt;
   &lt;br /&gt;
    # if there is not a match, print message and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;not admin: $0&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
   &lt;br /&gt;
    # otherwise, confirm and return&lt;br /&gt;
    messageBox MB_OK &amp;quot;is admin&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10545</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10545"/>
		<updated>2006-05-24T23:24:37Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: added section &amp;quot;Simply get current version...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply create a start menu item==&lt;br /&gt;
This installer creates a start menu item, nothing more&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# Name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # presently, the new shortcut doesn&#039;t call anything (the second field is blank)&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # to delete shortcut, go to start menu directory and manually delete it&lt;br /&gt;
&lt;br /&gt;
# default sec end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple installer and uninstaller with start menu item==&lt;br /&gt;
This installer will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; an uninstaller on the desktop; a shortcut in the start menu that points to the uninstaller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define name of installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define installation directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# start default section&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # set the installation directory as the destination for the following actions&lt;br /&gt;
    setOutPath $INSTDIR&lt;br /&gt;
   &lt;br /&gt;
    # create the uninstaller&lt;br /&gt;
    writeUninstaller &amp;quot;uninstall.exe&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # point the new shortcut at the program uninstaller&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;$INSTDIR\uninstall.exe&amp;quot;&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# uninstaller section start&lt;br /&gt;
section &amp;quot;uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # first, delete the uninstaller&lt;br /&gt;
    delete $INSTDIR\uninstall.exe&lt;br /&gt;
   &lt;br /&gt;
    # second, remove the link from the start menu&lt;br /&gt;
    delete &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# uninstaller section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply get current version of Java Runtime Environment==&lt;br /&gt;
This installer just checks the value of the CurrentVersion string for the JRE in the local machine registry using [http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.2.12 readRegStr].  If the result is blank, the JRE is probably not installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # read the value from the registry into the $0 register&lt;br /&gt;
    readRegStr $0 HKLM &amp;quot;SOFTWARE\JavaSoft\Java Runtime Environment&amp;quot; CurrentVersion&lt;br /&gt;
    &lt;br /&gt;
    # print the results in a popup message box&lt;br /&gt;
    messageBox MB_OK &amp;quot;version: $0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10544</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10544"/>
		<updated>2006-05-24T22:29:41Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: Added sections: &amp;quot;Simply create a start...&amp;quot; &amp;amp; &amp;quot;Simple installer and uninstaller...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply create a start menu item==&lt;br /&gt;
This installer creates a start menu item, nothing more&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# Name the installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # presently, the new shortcut doesn&#039;t call anything (the second field is blank)&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # to delete shortcut, go to start menu directory and manually delete it&lt;br /&gt;
&lt;br /&gt;
# default sec end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple installer and uninstaller with start menu item==&lt;br /&gt;
This installer will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; an uninstaller on the desktop; a shortcut in the start menu that points to the uninstaller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define name of installer&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define installation directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# start default section&lt;br /&gt;
section&lt;br /&gt;
   &lt;br /&gt;
    # set the installation directory as the destination for the following actions&lt;br /&gt;
    setOutPath $INSTDIR&lt;br /&gt;
   &lt;br /&gt;
    # create the uninstaller&lt;br /&gt;
    writeUninstaller &amp;quot;uninstall.exe&amp;quot;&lt;br /&gt;
   &lt;br /&gt;
    # create a shortcut named &amp;quot;new shortcut&amp;quot; in the start menu programs directory&lt;br /&gt;
    # point the new shortcut at the program uninstaller&lt;br /&gt;
    createShortCut &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot; &amp;quot;$INSTDIR\uninstall.exe&amp;quot;&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# uninstaller section start&lt;br /&gt;
section &amp;quot;uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # first, delete the uninstaller&lt;br /&gt;
    delete $INSTDIR\uninstall.exe&lt;br /&gt;
   &lt;br /&gt;
    # second, remove the link from the start menu&lt;br /&gt;
    delete &amp;quot;$SMPROGRAMS\new shortcut.lnk&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# uninstaller section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10543</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10543"/>
		<updated>2006-05-24T22:12:20Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: New section added: &amp;quot;Install a file and create...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install a file and create an uninstaller to remove it==&lt;br /&gt;
This script will do the following: create an installer named &amp;quot;installer.exe&amp;quot;; install a file named &amp;quot;test.txt&amp;quot; to the desktop; create an uninstaller named &amp;quot;uninstaller.exe&amp;quot; on the desktop.  The uninstaller will remove itself and the installed text file. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define installer name&lt;br /&gt;
outFile &amp;quot;installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# set desktop as install directory&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section start&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define output path&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# specify file to go in output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
# define uninstaller name&lt;br /&gt;
writeUninstaller $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# default section end&lt;br /&gt;
sectionEnd&lt;br /&gt;
&lt;br /&gt;
# create a section to define what the uninstaller does.&lt;br /&gt;
# the section will always be named &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
section &amp;quot;Uninstall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Always delete uninstaller first&lt;br /&gt;
delete $INSTDIR\uninstaller.exe&lt;br /&gt;
&lt;br /&gt;
# now delete installed file&lt;br /&gt;
delete $INSTDIR\test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10537</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10537"/>
		<updated>2006-05-22T23:36:43Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor|eldri005}}&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10536</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10536"/>
		<updated>2006-05-22T23:34:25Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10535</id>
		<title>Simple tutorials</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=Simple_tutorials&amp;diff=10535"/>
		<updated>2006-05-22T23:32:22Z</updated>

		<summary type="html">&lt;p&gt;Eldri005: creation, new -- &amp;quot;Simple tutorials&amp;quot; page in the category &amp;quot;Tutorials&amp;quot;: 3 simple tutorials added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PageAuthor:eldri005}}&lt;br /&gt;
==Simple hello world - popup box==&lt;br /&gt;
This hello world script will create a popup box with the words &amp;quot;hello world&amp;quot; in it and an &amp;quot;OK&amp;quot; button, when the installer is run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# set the name of the installer&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# create a default section.  Every NSIS script has at least one section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# create a popup box, with an OK button and the text &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
messageBox MB_OK &amp;quot;Hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simple hello world - writing text to a file==&lt;br /&gt;
This hello world script will write &amp;quot;hello world&amp;quot; to a text file when the installer is run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# declare name of finstaller file&lt;br /&gt;
outfile &amp;quot;hello world.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# open section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
/* open an output file called &amp;quot;helloworld.txt&amp;quot;, &lt;br /&gt;
which must exist before script is compiled, &lt;br /&gt;
on the desktop in write mode */&lt;br /&gt;
fileOpen $0 &amp;quot;$DESKTOP\helloworld.txt&amp;quot; w&lt;br /&gt;
&lt;br /&gt;
# write the string &amp;quot;hello world!&amp;quot; to the output file&lt;br /&gt;
fileWrite $0 &amp;quot;hello world!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# close the file&lt;br /&gt;
fileClose $0&lt;br /&gt;
&lt;br /&gt;
# end the section&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Simply install a file==&lt;br /&gt;
This installer script will copy the file &amp;quot;test.txt&amp;quot; to the installation directory&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
# define the name of the installer&lt;br /&gt;
outfile &amp;quot;simple installer.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# define the directory to install to, the desktop in this case as specified  &lt;br /&gt;
# by the predefined $DESKTOP variable&lt;br /&gt;
installDir $DESKTOP&lt;br /&gt;
&lt;br /&gt;
# default section&lt;br /&gt;
section&lt;br /&gt;
&lt;br /&gt;
# define the output path for this file&lt;br /&gt;
setOutPath $INSTDIR&lt;br /&gt;
&lt;br /&gt;
# define what to install and place it in the output path&lt;br /&gt;
file test.txt&lt;br /&gt;
&lt;br /&gt;
sectionEnd &lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Eldri005</name></author>
	</entry>
</feed>