Index: /applications/editors/josm/nsis/INIStrNS.nsh
===================================================================
--- /applications/editors/josm/nsis/INIStrNS.nsh	(revision 3770)
+++ /applications/editors/josm/nsis/INIStrNS.nsh	(revision 3770)
@@ -0,0 +1,85 @@
+;
+; Write to INI style file with no section headings
+;
+; http://nsis.sourceforge.net/Write_to_INI_style_file_with_no_section_headings
+;
+; some more at: http://nsis.sourceforge.net/Category:INI%2C_CSV_%26_Registry_Functions
+
+Function WriteINIStrNS
+ Exch $R0 ; new value
+ Exch
+ Exch $R1 ; key
+ Exch 2
+ Exch $R2 ; ini file
+ Exch 2
+ Push $R3
+ Push $R4
+ Push $R5
+ Push $R6
+ Push $R7
+ Push $R8
+ Push $R9
+ 
+  StrCpy $R9 0
+ 
+  FileOpen $R3 $R2 r
+  GetTempFileName $R4
+  FileOpen $R5 $R4 w
+ 
+  LoopRead:
+   ClearErrors
+   FileRead $R3 $R6
+   IfErrors End
+ 
+   StrCpy $R7 -1
+   LoopGetVal:
+    IntOp $R7 $R7 + 1
+    StrCpy $R8 $R6 1 $R7
+    StrCmp $R8 "" LoopRead
+    StrCmp $R8 = 0 LoopGetVal
+ 
+     StrCpy $R8 $R6 $R7
+     StrCmp $R8 $R1 0 +4
+ 
+      FileWrite $R5 "$R1=$R0$\r$\n"
+      StrCpy $R9 1
+      Goto LoopRead
+ 
+    FileWrite $R5 $R6
+    Goto LoopRead
+ 
+  End:
+   StrCmp $R9 1 +2
+   FileWrite $R5 "$R1=$R0$\r$\n"
+ 
+  FileClose $R5
+  FileClose $R3
+ 
+  SetDetailsPrint none
+  Delete $R2
+  Rename $R4 $R2
+  SetDetailsPrint both
+ 
+ Pop $R9
+ Pop $R8
+ 
+ Pop $R7
+ Pop $R6
+ Pop $R5
+ Pop $R4
+ Pop $R3
+ Pop $R2
+ Pop $R1
+ Pop $R0
+FunctionEnd
+ 
+!define WriteINIStrNS "!insertmacro WriteINIStrNS"
+!macro WriteINIStrNS Var File Key Value
+ Push "${File}"
+ Push "${Key}"
+ Push "${Value}"
+  Call WriteINIStrNS
+ Pop "${Var}"
+!macroend
+
+
Index: /applications/editors/josm/nsis/README.txt
===================================================================
--- /applications/editors/josm/nsis/README.txt	(revision 3770)
+++ /applications/editors/josm/nsis/README.txt	(revision 3770)
@@ -0,0 +1,61 @@
+This is the Win32 installer generator for OpenStreetMap, to create a Windows 
+like installer. This should ease installation and provides a reasonable set of 
+default preferences for Windows users.
+
+Currently only josm and a small assortment of josm plugins is included in the 
+installer. Probably, other osm related applications like osmarender and mapnik 
+will be added later.
+
+
+install
+-------
+simply execute openstreetmap-setup-x.x.x.exe
+
+uninstall
+---------
+use "control panel / software" to uninstall
+
+
+current state of the art
+------------------------
+The installer will currently add:
+- josm into "C:\Program Files\OpenStreetMap" (or the corresponding international dir)
+- josm icons to the desktop and quick launch bar
+- josm file associations to .osm and .gpx files
+- some plugins to the current user profile (more to follow)
+- default preferences to the current user profile (if not already existing)
+- default bookmarks to the current user profile (if not already existing)
+
+When the installed josm.exe is executed, it should ask the user to download 
+JAVA 1.5 runtime if it's not already installed. However, I've not tested this. 
+
+build the installer
+-------------------
+1.) You will need to download and install the following on your machine:
+- cygwin bash and wget
+- launch4j - http://launch4j.sourceforge.net/
+- NSIS - http://nsis.sourceforge.net/
+
+2.) Edit the three absolute paths in the file openstreetmap-setup.sh (in the calls 
+to launch4jc and makensis)
+
+3.) Start a cygwin shell and call ./openstreetmap-setup.sh
+
+how the installer is build
+--------------------------
+First, wget will download the required files (e.g. the josm plugins) into the 
+downloads subdir. Then jaunch4j wraps the josm.jar into a josm.exe, which 
+makes registration of file extensions a lot easier. Then NSIS is called to 
+create the actual openstreetmap-setup-x.x.x.exe.
+
+known issues
+------------
+- absolute paths in openstreetmap-setup.sh
+- bookmarks are of ulfl's personal interest (should be replaced e.g. by some "well known" places)
+- version number fixed to 0.0.x (better use SVN version?)
+- localisation/internationalisation settings (currently only english supported)
+- josm should support "global settings" instead of only the personal profile
+- josm should use some defaults already instead of the installer ones
+- some way of automatic installer generation on the server (e.g. nightly build)?
+- install all josm plugins by default and only enable them according to user wishes?
+- make instalation of icons and file extensions optional?
Index: /applications/editors/josm/nsis/bookmarks
===================================================================
--- /applications/editors/josm/nsis/bookmarks	(revision 3770)
+++ /applications/editors/josm/nsis/bookmarks	(revision 3770)
@@ -0,0 +1,4 @@
+Dove und Umgebung,49.43367777015768,11.079699557163485,49.44582839788726,11.094083348208668
+Home - Work,49.35660772631428,11.06808039515584,49.454863915414435,11.184395084764125
+Nürnberg,49.35667110571924,11.005657558927313,49.50879967041986,11.185745825587757
+current,49.33521849075943,11.066530037592642,49.35391659344637,11.088664663718614
Index: /applications/editors/josm/nsis/de-streets.xml
===================================================================
--- /applications/editors/josm/nsis/de-streets.xml	(revision 3770)
+++ /applications/editors/josm/nsis/de-streets.xml	(revision 3770)
@@ -0,0 +1,67 @@
+<annotations>
+  <item name="Autobahn" type="way">
+    <label text="Autobahnen in Deutschland"/>
+
+    <text key="name" text="Autobahn (z.B. A99)"/>
+
+    <!-- Autobahns are usually oneway -->
+    <check key="oneway" text="Oneway" default="on"/>
+
+    <!-- Always setting class=Autobahn -->
+    <key key="highway" value="motorway"/>
+    <key key="class" value="Autobahn"/>
+  </item>
+
+  <item name="Bundesstrasse" type="way">
+    <label text="Bundesstrassen in Deutschland"/>
+
+    <text key="name" text="Bundesstrasse (z.B. B11)"/>
+
+    <!-- Bundesstrasses are usually not oneway -->
+    <check key="oneway" text="Oneway" default="off"/>
+
+    <!-- Always setting class=Bundesstrasse -->
+    <key key="highway" value="primary"/>
+    <key key="class" value="Bundesstrasse"/>
+  </item>
+
+  <item name="Landstrasse" type="way">
+    <label text="Landstrassen in Deutschland"/>
+
+    <text key="name" text="Name"/>
+
+    <!-- Landstrasses are usually not oneway -->
+    <check key="oneway" text="Oneway" default="off"/>
+
+    <!-- Always setting class=Landstrasse -->
+    <key key="highway" value="secondary"/>
+    <key key="class" value="Landstrasse"/>
+  </item>
+
+  <item name="Nebenstrasse" type="way">
+    <label text="Nebenstrasse in Deutschland"/>
+
+    <text key="name" text="Name"/>
+
+    <!-- Nebenstrasses are usually not oneway -->
+    <check key="oneway" text="Oneway" default="off"/>
+
+    <!-- Always setting class=Landstrasse -->
+    <key key="highway" value="unclassified"/>
+    <key key="class" value="Nebenstrasse"/>
+  </item>
+
+  <item name="Wohnstrasse" type="way">
+    <label text="Wohnstrasse in Deutschland"/>
+
+    <text key="name" text="Name"/>
+
+    <!-- Wohnstrasses are usually not oneway -->
+    <check key="oneway" text="Oneway" default="off"/>
+
+    <!-- Always setting class=Wohnstrasse -->
+    <key key="highway" value="residential"/>
+    <key key="class" value="Wohnstrasse"/>
+  </item>
+
+</annotations>
Index: /applications/editors/josm/nsis/launch4j.xml
===================================================================
--- /applications/editors/josm/nsis/launch4j.xml	(revision 3770)
+++ /applications/editors/josm/nsis/launch4j.xml	(revision 3770)
@@ -0,0 +1,20 @@
+<launch4jConfig>
+  <dontWrapJar>false</dontWrapJar>
+  <headerType>0</headerType>
+  <jar>downloads\josm-latest.jar</jar>
+  <outfile>josm.exe</outfile>
+  <errTitle></errTitle>
+  <jarArgs></jarArgs>
+  <chdir></chdir>
+  <customProcName>false</customProcName>
+  <stayAlive>true</stayAlive>
+  <icon>logo.ico</icon>
+  <jre>
+    <path></path>
+    <minVersion>1.5.0</minVersion>
+    <maxVersion></maxVersion>
+    <initialHeapSize>0</initialHeapSize>
+    <maxHeapSize>0</maxHeapSize>
+    <args></args>
+  </jre>
+</launch4jConfig>
Index: /applications/editors/josm/nsis/openstreetmap-setup.sh
===================================================================
--- /applications/editors/josm/nsis/openstreetmap-setup.sh	(revision 3770)
+++ /applications/editors/josm/nsis/openstreetmap-setup.sh	(revision 3770)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+## settings ##
+
+VERSION=0.0.8
+
+PROGRAM_FILES="/cygdrive/c/Program Files"
+
+LAUNCH4J_XML="C:\Dokumente und Einstellungen\ulfl\Eigene Dateien\proj\gps\osm\svn.openstreetmap.org\applications\nsis\launch4j.xml"
+
+
+### download required files ###
+mkdir -p downloads
+cd downloads
+
+# get latest josm version (and license)
+wget -nc http://josm.eigenheimstrasse.de/download/josm-latest.jar
+wget -nc http://josm.eigenheimstrasse.de/browser/LICENSE?format=raw
+cp LICENSE?format=raw LICENSE
+
+# get latest plugin (and supporting files) versions
+cp ../../editors/josm/plugins/mappaint/mappaint.jar .
+cp ../../editors/josm/plugins/namefinder/namefinder.jar .
+#cp ../../editors/josm/plugins/osmarender/osmarender.jar .
+#cp ../../editors/josm/plugins/annotation-tester/annotation-tester.jar .
+#cp ../../editors/josm/plugins/wmsplugin/wmsplugin.jar .
+
+# wget -nc http://svn.openstreetmap.org/applications/editors/josm/plugins/mappaint/mappaint.jar
+# wget -nc http://www.free-map.org.uk/downloads/josm/mappaint.jar
+# wget -nc http://www.free-map.org.uk/downloads/josm/elemstyles.xml
+wget -nc http://www.eigenheimstrasse.de/josm/plugins/osmarender.jar
+wget -nc http://www.eigenheimstrasse.de/josm/plugins/annotation-tester.jar
+wget -nc http://chippy2005.googlepages.com/wmsplugin.jar
+wget -nc http://personales.ya.com/frsantos/validator.jar
+
+cd ..
+
+### convert jar to exe ###
+# (makes attaching to file extensions a lot easier)
+# launch4j - http://launch4j.sourceforge.net/
+"$PROGRAM_FILES/Launch4j/launch4jc.exe" "$LAUNCH4J_XML"
+
+### create the installer exe ###
+# NSIS - http://nsis.sourceforge.net/Main_Page
+"$PROGRAM_FILES/nsis/makensis.exe" /DVERSION=$VERSION openstreetmap.nsi
Index: /applications/editors/josm/nsis/openstreetmap.nsi
===================================================================
--- /applications/editors/josm/nsis/openstreetmap.nsi	(revision 3770)
+++ /applications/editors/josm/nsis/openstreetmap.nsi	(revision 3770)
@@ -0,0 +1,518 @@
+;
+; openstreetmap.nsi
+;
+
+
+; Set the compression mechanism first.
+; As of NSIS 2.07, solid compression which makes installer about 1MB smaller
+; is no longer the default, so use the /SOLID switch.
+; This unfortunately is unknown to NSIS prior to 2.07 and creates an error.
+; So if you get an error here, please update to at least NSIS 2.07!
+SetCompressor /SOLID lzma
+
+; work with JAVA ini strings
+!include "INIStrNS.nsh"
+
+!define DEST "openstreetmap"
+
+InstType "OpenStreetMap (full install)"
+
+InstType "un.Default (keep Personal Settings and plugins)"
+InstType "un.All (remove all)"
+
+; Used to refresh the display of file association
+!define SHCNE_ASSOCCHANGED 0x08000000
+!define SHCNF_IDLIST 0
+
+; Used to add associations between file extensions and JOSM
+!define OSM_ASSOC "josm-file"
+
+; ============================================================================
+; Header configuration
+; ============================================================================
+; The name of the installer
+!define PROGRAM_NAME "OpenStreetMap"
+
+Name "${PROGRAM_NAME} ${VERSION}"
+
+; The file to write
+OutFile "${DEST}-setup-${VERSION}.exe"
+
+; Uninstall stuff (NSIS 2.08: "\r\n" don't work here)
+!define MUI_UNCONFIRMPAGE_TEXT_TOP "The following OpenStreetMap installation will be uninstalled. Click 'Next' to continue."
+
+XPStyle on
+
+
+
+; ============================================================================
+; Modern UI
+; ============================================================================
+
+!include "MUI.nsh"
+;!addplugindir ".\Plugins"
+
+; Icon of installer and uninstaller
+!define MUI_ICON "logo.ico"
+!define MUI_UNICON "logo.ico"
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of OpenStreetMap.\r\n\r\nBefore starting the installation, make sure any OpenStreetMap applications are not running.\r\n\r\nClick 'Next' to continue."
+;!define MUI_FINISHPAGE_LINK "Install WinPcap to be able to capture packets from a network!"
+;!define MUI_FINISHPAGE_LINK_LOCATION "http://www.winpcap.org"
+
+; NSIS shows Readme files by opening the Readme file with the default application for
+; the file's extension. "README.win32" won't work in most cases, because extension "win32"
+; is usually not associated with an appropriate text editor. We should use extension "txt"
+; for a text file or "html" for an html README file.
+;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt"
+;!define MUI_FINISHPAGE_SHOWREADME_TEXT "Show News"
+;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
+!define MUI_FINISHPAGE_RUN "$INSTDIR\josm.exe"
+;!define MUI_FINISHPAGE_RUN_NOTCHECKED
+
+
+
+;!define MUI_PAGE_CUSTOMFUNCTION_SHOW myShowCallback
+
+; ============================================================================
+; MUI Pages
+; ============================================================================
+
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_LICENSE "downloads\LICENSE"
+!insertmacro MUI_PAGE_COMPONENTS
+;Page custom DisplayAdditionalTasksPage
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+
+!insertmacro MUI_UNPAGE_WELCOME
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_COMPONENTS
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+
+; ============================================================================
+; MUI Languages
+; ============================================================================
+
+!insertmacro MUI_LANGUAGE "English"
+
+; ============================================================================
+; Reserve Files
+; ============================================================================
+
+  ;Things that need to be extracted on first (keep these lines before any File command!)
+  ;Only useful for BZIP2 compression
+
+;  ReserveFile "AdditionalTasksPage.ini"
+!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+
+; ============================================================================
+; Section macros
+; ============================================================================
+!include "Sections.nsh"
+
+; ========= Macro to unselect and disable a section =========
+
+!macro DisableSection SECTION
+
+  Push $0
+    SectionGetFlags "${SECTION}" $0
+    IntOp $0 $0 & ${SECTION_OFF}
+    IntOp $0 $0 | ${SF_RO}
+    SectionSetFlags "${SECTION}" $0
+  Pop $0
+
+!macroend
+
+; ========= Macro to enable (unreadonly) a section =========
+!define SECTION_ENABLE   0xFFFFFFEF
+!macro EnableSection SECTION
+
+  Push $0
+    SectionGetFlags "${SECTION}" $0
+    IntOp $0 $0 & ${SECTION_ENABLE}
+    SectionSetFlags "${SECTION}" $0
+  Pop $0
+
+!macroend
+
+; ============================================================================
+; Command Line
+; ============================================================================
+!include "FileFunc.nsh"
+
+;!insertmacro GetParameters
+;!insertmacro GetOptions
+
+; ============================================================================
+; Directory selection page configuration
+; ============================================================================
+; The text to prompt the user to enter a directory
+DirText "Choose a directory in which to install OpenStreeMap."
+
+; The default installation directory
+InstallDir $PROGRAMFILES\OpenStreetMap\
+
+; See if this is an upgrade; if so, use the old InstallDir as default
+InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\OpenStreetMap "InstallDir"
+
+
+; ============================================================================
+; Install page configuration
+; ============================================================================
+ShowInstDetails show
+ShowUninstDetails show
+
+; ============================================================================
+; Functions and macros
+; ============================================================================
+
+; update file extension icons
+!macro UpdateIcons
+	Push $R0
+  	Push $R1
+  	Push $R2
+
+	!define UPDATEICONS_UNIQUE ${__LINE__}
+
+	IfFileExists "$SYSDIR\shell32.dll" UpdateIcons.next1_${UPDATEICONS_UNIQUE} UpdateIcons.error1_${UPDATEICONS_UNIQUE}
+UpdateIcons.next1_${UPDATEICONS_UNIQUE}:
+	GetDllVersion "$SYSDIR\shell32.dll" $R0 $R1
+	IntOp $R2 $R0 / 0x00010000
+	IntCmp $R2 4 UpdateIcons.next2_${UPDATEICONS_UNIQUE} UpdateIcons.error2_${UPDATEICONS_UNIQUE}
+UpdateIcons.next2_${UPDATEICONS_UNIQUE}:
+	System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+	Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+
+UpdateIcons.error1_${UPDATEICONS_UNIQUE}:
+	MessageBox MB_OK|MB_ICONSTOP  "Can't find 'shell32.dll' library. Impossible to update icons"
+	Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+UpdateIcons.error2_${UPDATEICONS_UNIQUE}:
+	MessageBox MB_OK|MB_ICONINFORMATION "You should install the free 'Microsoft Layer for Unicode' to update OpenStreetMap file icons"
+	Goto UpdateIcons.quit_${UPDATEICONS_UNIQUE}
+UpdateIcons.quit_${UPDATEICONS_UNIQUE}:
+	!undef UPDATEICONS_UNIQUE
+	Pop $R2
+	Pop $R1
+  	Pop $R0
+
+!macroend
+
+; associate a file extension to an icon
+Function Associate
+	; $R0 should contain the prefix to associate to OpenStreetMap
+	Push $R1
+
+	ReadRegStr $R1 HKCR $R0 ""
+	StrCmp $R1 "" Associate.doRegister
+	Goto Associate.end
+Associate.doRegister:
+	;The extension is not associated to any program, we can do the link
+	WriteRegStr HKCR $R0 "" ${OSM_ASSOC}
+Associate.end:
+	pop $R1
+FunctionEnd
+
+; disassociate a file extension from an icon
+Function un.unlink
+	; $R0 should contain the prefix to unlink
+	Push $R1
+
+	ReadRegStr $R1 HKCR $R0 ""
+	StrCmp $R1 ${OSM_ASSOC} un.unlink.doUnlink
+	Goto un.unlink.end
+un.unlink.doUnlink:
+	; The extension is associated with OpenStreetMap so, we must destroy this!
+	DeleteRegKey HKCR $R0
+un.unlink.end:
+	pop $R1
+FunctionEnd
+
+Function .onInit
+  ;Extract InstallOptions INI files
+;  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "AdditionalTasksPage.ini"
+FunctionEnd
+
+;Function DisplayAdditionalTasksPage
+;  !insertmacro MUI_HEADER_TEXT "Select Additional Tasks" "Which additional tasks should be done?"
+;  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "AdditionalTasksPage.ini"
+;FunctionEnd
+
+; ============================================================================
+; Installation execution commands
+; ============================================================================
+
+Section "-Required"
+;-------------------------------------------
+
+;
+; Install for every user
+;
+SectionIn 1 2 RO
+SetShellVarContext all
+
+SetOutPath $INSTDIR
+
+; Write the uninstall keys for Windows
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayVersion" "${VERSION}"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "DisplayName" "OpenStreetMap ${VERSION}"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "UninstallString" '"$INSTDIR\uninstall.exe"'
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "Publisher" "The OpenStreetMap developer community, http://www.openstreetmap.org/"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "HelpLink" "mailto:newbies@openstreetmap.org."
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLInfoAbout" "http://www.openstreetmap.org/"
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "URLUpdateInfo" "http://www.openstreetmap.org/"
+WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoModify" 1
+WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM" "NoRepair" 1
+WriteUninstaller "uninstall.exe"
+
+; Write an entry for ShellExecute
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "" '$INSTDIR\josm.exe'
+WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe" "Path" '$INSTDIR'
+
+; Create start menu entries (depending on additional tasks page)
+;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 2" "State"
+;StrCmp $0 "0" SecRequired_skip_StartMenu
+; To qoute "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11d.asp":
+; "Do not include Readme, Help, or Uninstall entries on the Programs menu."
+CreateShortCut "$SMPROGRAMS\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
+;SecRequired_skip_StartMenu:
+
+; is command line option "/desktopicon" set?
+;${GetParameters} $R0
+;${GetOptions} $R0 "/desktopicon=" $R1
+;StrCmp $R1 "no" SecRequired_skip_DesktopIcon
+;StrCmp $R1 "yes" SecRequired_install_DesktopIcon
+
+; Create desktop icon (depending on additional tasks page and command line option)
+;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 3" "State"
+;StrCmp $0 "0" SecRequired_skip_DesktopIcon
+;SecRequired_install_DesktopIcon:
+CreateShortCut "$DESKTOP\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
+;SecRequired_skip_DesktopIcon:
+
+; is command line option "/quicklaunchicon" set?
+;${GetParameters} $R0
+;${GetOptions} $R0 "/quicklaunchicon=" $R1
+;StrCmp $R1 "no" SecRequired_skip_QuickLaunchIcon
+;StrCmp $R1 "yes" SecRequired_install_QuickLaunchIcon
+
+; Create quick launch icon (depending on additional tasks page and command line option)
+;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 4" "State"
+;StrCmp $0 "0" SecRequired_skip_QuickLaunchIcon
+;SecRequired_install_QuickLaunchIcon:
+CreateShortCut "$QUICKLAUNCH\JOSM.lnk" "$INSTDIR\josm.exe" "" "$INSTDIR\josm.exe" 0 "" "" "JAVA OpenStreetMap - Editor"
+;SecRequired_skip_QuickLaunchIcon:
+
+; Create File Extensions (depending on additional tasks page)
+;ReadINIStr $0 "$PLUGINSDIR\AdditionalTasksPage.ini" "Field 6" "State"
+;StrCmp $0 "0" SecRequired_skip_FileExtensions
+WriteRegStr HKCR ${OSM_ASSOC} "" "OpenStreetMap data"
+WriteRegStr HKCR "${OSM_ASSOC}\Shell\open\command" "" '"$INSTDIR\josm.exe" "%1"'
+WriteRegStr HKCR "${OSM_ASSOC}\DefaultIcon" "" '"$INSTDIR\josm.exe",0'
+push $R0
+	StrCpy $R0 ".osm"
+  	Call Associate
+	StrCpy $R0 ".gpx"
+  	Call Associate
+; if somethings added here, add it also to the uninstall section and the AdditionalTask page
+pop $R0
+!insertmacro UpdateIcons
+;SecRequired_skip_FileExtensions:
+
+SectionEnd ; "Required"
+
+
+Section "JOSM" SecJosm
+;-------------------------------------------
+SectionIn 1
+SetOutPath $INSTDIR
+File "josm.exe"
+SetShellVarContext current
+SetOutPath "$APPDATA\JOSM"
+
+; don't overwrite existing bookmarks
+IfFileExists preferences dont_overwrite_bookmarks
+File "bookmarks"
+dont_overwrite_bookmarks:
+
+; don't overwrite existing de_streets.xml file
+IfFileExists de-streets.xml dont_overwrite_de_streets
+File "de-streets.xml"
+dont_overwrite_de_streets:
+
+; write reasonable defaults for some preferences
+; XXX - some of this should be done in JOSM itself
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "laf" "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "download.osm" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "layerlist.visible" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "commandstack.visible" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "propertiesdialog.visible" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "validator.visible" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "draw.segment.direction" "true"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "projection" "org.openstreetmap.josm.data.projection.Epsg4326"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osm-server.url" "http://www.openstreetmap.org/api"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "annotation.sources" "$APPDATA/JOSM/de-streets.xml"
+SectionEnd
+
+
+SectionGroup /e "Plugins" SecPluginsGroup
+
+Section "mappaint" SecMappaintPlugin
+;-------------------------------------------
+SectionIn 1 2
+SetShellVarContext current
+SetOutPath $APPDATA\JOSM\plugins
+File "downloads\mappaint.jar"
+;SetOutPath $APPDATA\JOSM\plugins\mappaint
+;File "downloads\elemstyles.xml"
+SectionEnd
+
+Section "osmarender" SecOsmarenderPlugin
+;-------------------------------------------
+SectionIn 1 2
+SetShellVarContext current
+SetOutPath $APPDATA\JOSM\plugins
+File "downloads\osmarender.jar"
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "osmarender.firefox" "$PROGRAMFILES\Mozilla Firefox\firefox.exe"
+SectionEnd
+
+Section "WMS" SecWMSPlugin
+;-------------------------------------------
+SectionIn 1 2
+SetShellVarContext current
+SetOutPath $APPDATA\JOSM\plugins
+File "downloads\wmsplugin.jar"
+SectionEnd
+
+Section "namefinder" SecNamefinderPlugin
+;-------------------------------------------
+SectionIn 1 2
+SetShellVarContext current
+SetOutPath $APPDATA\JOSM\plugins
+File "downloads\namefinder.jar"
+SectionEnd
+
+Section "validator" SecValidatorPlugin
+;-------------------------------------------
+SectionIn 1 2
+SetShellVarContext current
+SetOutPath $APPDATA\JOSM\plugins
+File "downloads\validator.jar"
+SectionEnd
+
+SectionGroupEnd	; "Plugins"
+
+Section "-PluginSetting"
+;-------------------------------------------
+;MessageBox MB_OK "PluginSetting!" IDOK 0
+SetShellVarContext current
+${WriteINIStrNS} $R0 "$APPDATA\JOSM\preferences" "plugins" "mappaint,osmarender,wmsplugin,namefinder,validator"
+SectionEnd
+
+
+Section "Uninstall" un.SecUinstall
+;-------------------------------------------
+
+;
+; UnInstall for every user
+;
+SectionIn 1 2
+SetShellVarContext all
+
+Delete "$INSTDIR\josm.exe"
+Delete "$INSTDIR\uninstall.exe"
+IfErrors 0 NoJOSMErrorMsg
+	MessageBox MB_OK "Please note: josm.exe could not be removed, it's probably in use!" IDOK 0 ;skipped if josm.exe removed
+	Abort "Please note: josm.exe could not be removed, it's probably in use! Abort uninstall process!"
+NoJOSMErrorMsg:
+
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\OSM"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\josm.exe"
+DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\App Paths\josm.exe"
+
+push $R0
+	StrCpy $R0 ".osm"
+  	Call un.unlink
+	StrCpy $R0 ".gpx"
+  	Call un.unlink
+pop $R0
+
+DeleteRegKey HKCR ${OSM_ASSOC}
+DeleteRegKey HKCR "${OSM_ASSOC}\Shell\open\command"
+DeleteRegKey HKCR "${OSM_ASSOC}\DefaultIcon"
+!insertmacro UpdateIcons
+
+Delete "$SMPROGRAMS\josm.lnk"
+Delete "$DESKTOP\josm.lnk"
+Delete "$QUICKLAUNCH\josm.lnk"
+
+RMDir "$INSTDIR"
+
+SectionEnd ; "Uinstall"
+
+Section /o "Un.Personal Settings" un.SecPersonalSettings
+;-------------------------------------------
+SectionIn 2
+SetShellVarContext current
+Delete "$APPDATA\JOSM\preferences"
+Delete "$APPDATA\JOSM\bookmarks"
+Delete "$APPDATA\JOSM\de-streets.xml"
+RMDir "$APPDATA\JOSM"
+SectionEnd
+
+Section /o "Un.Plugins" un.SecPlugins
+;-------------------------------------------
+SectionIn 2
+SetShellVarContext current
+Delete "$APPDATA\JOSM\plugins\wmsplugin.jar"
+Delete "$APPDATA\JOSM\plugins\osmarender.jar"
+Delete "$APPDATA\JOSM\plugins\osmarender\*.*"
+Delete "$APPDATA\JOSM\plugins\mappaint.jar"
+Delete "$APPDATA\JOSM\plugins\namefinder.jar"
+Delete "$APPDATA\JOSM\plugins\validator.jar"
+;Delete "$APPDATA\JOSM\plugins\mappaint\elemstyles.xml"
+RMDir "$APPDATA\JOSM\plugins\osmarender"
+;RMDir "$APPDATA\JOSM\plugins\mappaint"
+RMDir "$APPDATA\JOSM\plugins"
+RMDir "$APPDATA\JOSM"
+SectionEnd
+
+
+Section "-Un.Finally"
+;-------------------------------------------
+SectionIn 1 2
+; this test must be done after all other things uninstalled (e.g. Global Settings)
+IfFileExists "$INSTDIR" 0 NoFinalErrorMsg
+    MessageBox MB_OK "Please note: The directory $INSTDIR could not be removed!" IDOK 0 ; skipped if dir doesn't exist
+NoFinalErrorMsg:
+SectionEnd
+
+
+; ============================================================================
+; PLEASE MAKE SURE, THAT THE DESCRIPTIVE TEXT FITS INTO THE DESCRIPTION FIELD!
+; ============================================================================
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecJosm} "JOSM is the JAVA OpenStreetMap editor for .osm files."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecPluginsGroup} "Various JOSM plugins."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecMappaintPlugin} "An alternative renderer for the map with colouring, line thickness, icons after tags."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecOsmarenderPlugin} "Displays the current screen as nicely rendered SVG graphics in FireFox."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecWMSPlugin} "Display background images from Web Map Service (WMS) sources."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecNamefinderPlugin} "Add a 'Find places by their name' tab to the download dialog."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecValidatorPlugin} "Validates edited data if it conforms to common suggestions."
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUinstall} "Uninstall JOSM."
+  !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPersonalSettings} "Uninstall personal settings like your preferences and bookmarks from your profile: $PROFILE."
+  !insertmacro MUI_DESCRIPTION_TEXT ${un.SecPlugins} "Uninstall all plugins."
+!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
+
+; ============================================================================
+; Callback functions
+; ============================================================================
+
