xiewenjie пре 3 година
родитељ
комит
9c0114749e
100 измењених фајлова са 19493 додато и 352 уклоњено
  1. 282 281
      AppCode/laser/app.nsh
  2. BIN
      AppCode/laser/app/laser_setup.nsi
  3. BIN
      AppCode/laser/app/skin.zip
  4. 1 1
      AppCode/laser/app/skin/configpage.xml
  5. BIN
      AppCode/laser/app/skin/form/bk_down2.png
  6. BIN
      AppCode/laser/app/skin/form/license_bg.png
  7. 1 1
      AppCode/laser/app/skin/installingpage.xml
  8. 5 5
      AppCode/laser/app/skin/msgBox.xml
  9. 1 1
      AppCode/laser/app/skin/uninstallingpage.xml
  10. BIN
      AppCode/laser/app/ui_laser_setup.nsh
  11. 1617 0
      AppFile/laser/mysql/fdkk_laser.sql
  12. 9 17
      AppFile/laser/env_install.bat
  13. 11 22
      AppFile/laser/reInstall.bat
  14. 36 0
      AppFile/laser/tools/service.bat
  15. 6 24
      AppFile/laser/uninstall.bat
  16. 16 0
      AppFile/laser/tools/unservice.bat
  17. BIN
      NSIS/Contrib/EnVar/EnVar.suo
  18. 666 0
      NSIS/Contrib/EnVar/EnVar.vcproj
  19. 775 0
      NSIS/Contrib/EnVar/envar.c
  20. 83 0
      NSIS/Contrib/EnVar/nsis/api.h
  21. 229 0
      NSIS/Contrib/EnVar/nsis/nsis_tchar.h
  22. BIN
      NSIS/Contrib/EnVar/nsis/pluginapi-amd64-unicode.lib
  23. BIN
      NSIS/Contrib/EnVar/nsis/pluginapi-x86-ansi.lib
  24. BIN
      NSIS/Contrib/EnVar/nsis/pluginapi-x86-unicode.lib
  25. 104 0
      NSIS/Contrib/EnVar/nsis/pluginapi.h
  26. 141 0
      NSIS/Contrib/nsJSON/ConsoleApp/ConsoleApp.vcxproj
  27. 22 0
      NSIS/Contrib/nsJSON/ConsoleApp/ConsoleApp.vcxproj.filters
  28. 30 0
      NSIS/Contrib/nsJSON/ConsoleApp/main.c
  29. 6 0
      NSIS/Contrib/nsJSON/ConsoleAppDotNet/App.config
  30. 55 0
      NSIS/Contrib/nsJSON/ConsoleAppDotNet/ConsoleAppDotNet.csproj
  31. 25 0
      NSIS/Contrib/nsJSON/ConsoleAppDotNet/Program.cs
  32. 36 0
      NSIS/Contrib/nsJSON/ConsoleAppDotNet/Properties/AssemblyInfo.cs
  33. 1538 0
      NSIS/Contrib/nsJSON/JSON.c
  34. 86 0
      NSIS/Contrib/nsJSON/JSON.h
  35. 90 0
      NSIS/Contrib/nsJSON/LinkedList.c
  36. 26 0
      NSIS/Contrib/nsJSON/LinkedList.h
  37. 83 0
      NSIS/Contrib/nsJSON/api.h
  38. 1474 0
      NSIS/Contrib/nsJSON/nsJSON.c
  39. 7 0
      NSIS/Contrib/nsJSON/nsJSON.h
  40. BIN
      NSIS/Contrib/nsJSON/nsJSON.rc
  41. 97 0
      NSIS/Contrib/nsJSON/nsJSON.sln
  42. 449 0
      NSIS/Contrib/nsJSON/nsJSON.vcxproj
  43. 56 0
      NSIS/Contrib/nsJSON/nsJSON.vcxproj.filters
  44. 229 0
      NSIS/Contrib/nsJSON/nsis_tchar.h
  45. 294 0
      NSIS/Contrib/nsJSON/pluginapi.c
  46. 104 0
      NSIS/Contrib/nsJSON/pluginapi.h
  47. BIN
      NSIS/Contrib/nsJSON/resource.h
  48. 18 0
      NSIS/Docs/EnVar/license.txt
  49. 70 0
      NSIS/Docs/EnVar/readme.txt
  50. 564 0
      NSIS/Docs/nsJSON/Readme.txt
  51. 90 0
      NSIS/Examples/EnVar/example.nsi
  52. BIN
      NSIS/Examples/nsJSON/Bin/ConsoleApp.exe
  53. BIN
      NSIS/Examples/nsJSON/Bin/ConsoleAppDotNet.exe
  54. 33 0
      NSIS/Examples/nsJSON/Bin/HttpWebRequest.php
  55. 193 0
      NSIS/Examples/nsJSON/ConsoleExec.nsi
  56. 509 0
      NSIS/Examples/nsJSON/Example.nsi
  57. 127 0
      NSIS/Examples/nsJSON/HttpWebRequest.nsi
  58. 22 0
      NSIS/Examples/nsJSON/Input/Example1.json
  59. BIN
      NSIS/Examples/nsJSON/Input/Example1_Unicode.json
  60. BIN
      NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF16BE.json
  61. BIN
      NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF16LE.json
  62. 22 0
      NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF8.json
  63. 14 0
      NSIS/Examples/nsJSON/Input/Example2.json
  64. 28 0
      NSIS/Examples/nsJSON/Input/Example3.json
  65. 99 0
      NSIS/Examples/nsJSON/Input/Example4.json
  66. 29 0
      NSIS/Examples/nsJSON/Input/Example5.json
  67. 992 0
      NSIS/Examples/nsJSON/Input/Preferences.json
  68. 988 0
      NSIS/Examples/nsJSON/Input/Preferences2.json
  69. 26 0
      NSIS/Examples/nsJSON/MultiTree.nsi
  70. 46 0
      NSIS/Examples/nsJSON/Quote.nsi
  71. 36 0
      NSIS/Examples/nsJSON/Sort.nsi
  72. 35 0
      NSIS/Examples/nsJSON/Syntax.nsi
  73. 25 0
      NSIS/Examples/nsJSON/UnicodeNSIS.nsi
  74. BIN
      NSIS/Plugins/amd64-unicode/EnVar.dll
  75. BIN
      NSIS/Plugins/amd64-unicode/SimpleSC.dll
  76. 259 0
      NSIS/Plugins/amd64-unicode/Source/LSASecurityControl.pas
  77. 36 0
      NSIS/Plugins/amd64-unicode/Source/NSIS Plugins.groupproj
  78. 209 0
      NSIS/Plugins/amd64-unicode/Source/NSIS.pas
  79. 1382 0
      NSIS/Plugins/amd64-unicode/Source/ServiceControl.pas
  80. 609 0
      NSIS/Plugins/amd64-unicode/Source/SimpleSC.dpr
  81. 910 0
      NSIS/Plugins/amd64-unicode/Source/SimpleSC.dproj
  82. BIN
      NSIS/Plugins/amd64-unicode/Source/SimpleSC.res
  83. BIN
      NSIS/Plugins/amd64-unicode/nsJSON.dll
  84. 21 0
      NSIS/Plugins/plugin.bat
  85. 3 0
      NSIS/Plugins/process_ansi.bat
  86. 3 0
      NSIS/Plugins/process_unicode.bat
  87. BIN
      NSIS/Plugins/x64-ansi/nsMySQL.dll
  88. BIN
      NSIS/Plugins/x64-unicode/nsMySQL.dll
  89. BIN
      NSIS/Plugins/x86-ansi/EnVar.dll
  90. BIN
      NSIS/Plugins/x86-ansi/nsJSON.dll
  91. BIN
      NSIS/Plugins/x86-ansi/nsMySQL.dll
  92. BIN
      NSIS/Plugins/x86-unicode/EnVar.dll
  93. BIN
      NSIS/Plugins/x86-unicode/SimpleSC.dll
  94. 259 0
      NSIS/Plugins/x86-unicode/Source/LSASecurityControl.pas
  95. 36 0
      NSIS/Plugins/x86-unicode/Source/NSIS Plugins.groupproj
  96. 209 0
      NSIS/Plugins/x86-unicode/Source/NSIS.pas
  97. 1382 0
      NSIS/Plugins/x86-unicode/Source/ServiceControl.pas
  98. 609 0
      NSIS/Plugins/x86-unicode/Source/SimpleSC.dpr
  99. 910 0
      NSIS/Plugins/x86-unicode/Source/SimpleSC.dproj
  100. 0 0
      NSIS/Plugins/x86-unicode/Source/SimpleSC.res

Разлика између датотеке није приказан због своје велике величине
+ 282 - 281
AppCode/laser/app.nsh


BIN
AppCode/laser/app/laser_setup.nsi


BIN
AppCode/laser/app/skin.zip


+ 1 - 1
AppCode/laser/app/skin/configpage.xml

@@ -17,7 +17,7 @@
       </HorizontalLayout>
 	  
 	 <HorizontalLayout height="23" padding="40,5,80,0">
-        <Label font="0" textcolor="#FF999999" width="150" text="所需空间:4.63G" />
+        <Label font="0" textcolor="#FF999999" width="150" text="所需空间:5.2GB" />
 		<Label font="0" name="local_space" width="150" textcolor="#FF999999"  />
 		<Control />
      </HorizontalLayout>

BIN
AppCode/laser/app/skin/form/bk_down2.png


BIN
AppCode/laser/app/skin/form/license_bg.png


+ 1 - 1
AppCode/laser/app/skin/installingpage.xml

@@ -9,7 +9,7 @@
 	<Control height="60" />
 	<Slider name="slrProgress" padding="30,0,30,0" height="3" mouse="false" foreimage="form\fg.png" bkimage="form\bg.png" thumbsize="0,0" bkcolor="#FFD8D8D8"  />
 	<HorizontalLayout height="20" padding="30,5,0,0">
-	<Label font="0" name="progress_tip" width="100" textcolor="#FFFFFF" text="正在安装" />
+	<Label font="0" name="progress_tip" width="100" textcolor="#FFFFFF"  />
 	<Control />
 	<Label font="0" name="progress_pos" width="60" textalign="right" textcolor="#FFFFFF" />
 	</HorizontalLayout>

+ 5 - 5
AppCode/laser/app/skin/msgBox.xml

@@ -3,9 +3,9 @@
   
   <Font id="0" name="微软雅黑" size="13" bold="false" default="true" shared="true" />
 	<Font id="1" name="微软雅黑" size="14" bold="true" shared="true" />
-  <VerticalLayout width="408" height="287" bkcolor="#FFFFFFFF" inset="1,1,1,1" bordersize="1" bordercolor="0xFFCACACA">
-  	<HorizontalLayout height="30" bkcolor="0xFFCACACA">
-  		<Label name="lblTitle" textpadding="5,0,0,0" text="警告" textcolor="0xff333333" />
+  <VerticalLayout width="408" height="287" bkimage="file='form\bk_down2.png'" inset="1,1,1,1" >
+  	<HorizontalLayout height="30"   bkimage="file='form\bk_down.png'">
+  		<Label name="lblTitle" textpadding="5,0,0,0" text="警告" textcolor="#FFFFFFFF"/>
       <HorizontalLayout width="67">
       	<Container />
 		
@@ -16,7 +16,7 @@
   	
   	<Container />
   	
-  	<HorizontalLayout height="80">
+  	<HorizontalLayout height="80" >
   		<Container width="40" />
   		<VerticalLayout width="40" >
 					<Container  />
@@ -24,7 +24,7 @@
 					<Container />
 			</VerticalLayout>
 			<Container width="10" />
-			<Text name="lblMsg" valign="vcenter" align="left" textcolor="0xFF000000" showhtml="true"/>
+			<Text name="lblMsg" valign="vcenter" align="left" textcolor="#FFFFFFFF" showhtml="true"/>
 			<Container width="20" />
   	</HorizontalLayout>
   	

+ 1 - 1
AppCode/laser/app/skin/uninstallingpage.xml

@@ -11,7 +11,7 @@
 	<Control height="60" />
 	<Slider name="slrUnInstProgress" padding="30,0,30,0" height="3" mouse="false" foreimage="form\fg.png" bkimage="form\bg.png" thumbsize="0,0" bkcolor="#FFD8D8D8"  />
 	<HorizontalLayout height="20" padding="30,5,0,0">
-	<Label font="0" name="un_progress_tip" width="100" textcolor="#FFFFFF" text="正在卸载" />
+	<Label font="0" name="un_progress_tip" width="100" textcolor="#FFFFFF" />
 	<Control />
 	<Label font="0" name="un_progress_pos" width="60" textalign="right" textcolor="#FFFFFF" />
 	</HorizontalLayout>

BIN
AppCode/laser/app/ui_laser_setup.nsh


Разлика између датотеке није приказан због своје велике величине
+ 1617 - 0
AppFile/laser/mysql/fdkk_laser.sql


+ 9 - 17
AppFile/laser/env_install.bat

@@ -4,26 +4,18 @@ title 4dmega install
 color 0a
 echo ---Installation  java completed---
 
-setx /M FDMGEA_HOME "%~dp0%\"
-setx /M JAVA_HOME "%~dp0%jdk1.8"
-setx /M MYSQL_HOME "%~dp0%mysql"
-setx /M REDIS_HOME "%~dp0%redis"
-setx /M 4DKK_HOME "%~dp0%CGAII"
-setx /M MONGODB_HOME "%~dp0%mongodb"
-setx /M CLASS_PATH  "%%JAVA_HOME%%\lib\tools.jar;%%JAVA_HOME%%\lib\dt.jar"
-setx /M PATH  "%PATH%;%%JAVA_HOME%%\bin;%%MYSQL_HOME%%\bin;%%MONGODB_HOME%%\bin;%%REDIS_HOME%%;%%4DKK_HOME%%;%%4DKK_HOME%%\lib;"
- 
+
 echo ---Installation  db start---
 
-cd /d %~dp0 
+set DATA_PATH=%1
 
-set basePath=%~dp0
-set JAVA_HOME=%~dp0%jdk1.8
-set MYSQL_HOME=%~dp0%mysql
-set REDIS_HOME=%~dp0%redis
-set MONGODB_HOME=%~dp0%mongodb
-set BIN_HOME=%~dp0%bin
-set USER_DATA=%~dp0USER_DATA
+set basePath=%DATA_PATH%\
+set JAVA_HOME=%basePath%jdk1.8
+set MYSQL_HOME=%basePath%mysql
+set REDIS_HOME=%basePath%redis
+set MONGODB_HOME=%basePath%mongodb
+set BIN_HOME=%basePath%bin
+set USER_DATA=%basePath%USER_DATA
 
 
 echo start config mysql service

+ 11 - 22
AppFile/laser/reInstall.bat

@@ -4,29 +4,18 @@ color 0a
 echo =====================================================================
 echo                  uninstall loading started  
 echo =====================================================================
-set basePath=%~dp0
 echo  %basePath%
-setx /M FDMGEA_HOME "%~dp0%\"
-setx /M JAVA_HOME "%~dp0%jdk1.8"
-setx /M MYSQL_HOME "%~dp0%mysql"
-setx /M REDIS_HOME "%~dp0%redis"
-setx /M 4DKK_HOME "%~dp0%CGAII"
-setx /M MONGODB_HOME "%~dp0%mongodb"
-setx /M CLASS_PATH  "%%JAVA_HOME%%\lib\tools.jar;%%JAVA_HOME%%\lib\dt.jar"
-setx /M PATH  "%PATH%;%%JAVA_HOME%%\bin;%%MYSQL_HOME%%\bin;%%MONGODB_HOME%%\bin;%%REDIS_HOME%%;%%4DKK_HOME%%;%%4DKK_HOME%%\lib;"
- 
-cd /d %~dp0 
-
-set DIR=%~dp0%
-set FDMGEA_HOME=%~dp0%\
-set JAVA_HOME=%~dp0%jdk1.8
-set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
-set PATH=%JAVA_HOME%\bin;%PATH%;
-set MYSQL_HOME=%~dp0%mysql
-set REDIS_HOME=%~dp0%redis
-set MONGODB_HOME=%~dp0%mongodb
-set BIN_HOME=%~dp0%bin
-set USER_DATA=%~dp0USER_DATA
+
+
+set DIR=%1
+set basePath=%DIR%\
+set FDMGEA_HOME=%basePath%\
+set JAVA_HOME=%basePath%jdk1.8
+set MYSQL_HOME=%basePath%mysql
+set REDIS_HOME=%basePath%redis
+set MONGODB_HOME=%basePath%mongodb
+set BIN_HOME=%basePath%bin
+set USER_DATA=%basePath%USER_DATA
 
 set bin=%MYSQL_HOME%\bin
 

+ 36 - 0
AppFile/laser/tools/service.bat

@@ -0,0 +1,36 @@
+
+@echo off && setlocal enabledelayedexpansion
+
+title 4dmega install
+color 0a
+echo ---Installation   completed---
+
+set DATA_PATH=%1
+set USER_DATA=%DATA_PATH%\USER_DATA
+set MYSQL_HOME=%DATA_PATH%\mysql
+set MONGODB_HOME=%DATA_PATH%\mongodb
+
+%MYSQL_HOME%\bin\mysql -P3307 -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'laser'";
+%MYSQL_HOME%\bin\mysql -P3307 -u root -plaser -e "CREATE DATABASE IF NOT EXISTS `laser` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ";
+
+echo start db tables
+
+if exist  %USER_DATA%\lite.sql ( 
+   echo "file exists"
+   %MYSQL_HOME%\bin\mysql.exe -P3307 -u root -plaser laser <    %USER_DATA%\lite.sql 
+   del  %USER_DATA%\lite.sql
+) else (  
+   echo "file no exists"
+   %MYSQL_HOME%\bin\mysql.exe -P3307 -u root -plaser laser < %MYSQL_HOME%\sqlfile\fdkk_laser.sql
+)
+
+echo ---Installation  mysql completed---
+) 
+
+if exist  %USER_DATA%\mon\ (
+   echo "file exists"
+   %MONGODB_HOME%\bin\mongorestore.exe --host 127.0.0.1 --port 29031 --gzip   %USER_DATA%\mon
+   rd /s /q %USER_DATA%\mon
+)
+rd /s /q  %USER_DATA%
+del %0

+ 6 - 24
AppFile/laser/uninstall.bat

@@ -6,14 +6,12 @@ echo                  uninstall loading started
 echo =====================================================================
 
  
-cd /d %~dp0
-set DIR=%~dp0%
-set JAVA_HOME=%~dp0%jdk1.8
-set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar
-set MYSQL_HOME=%~dp0%mysql
-set 4DKK_HOME=%~dp0%CGAII
-set REDIS_HOME=%~dp0%redis
-set MONGODB_HOME=%~dp0%mongodb
+set DIR=%1
+set JAVA_HOME=%DIR%\jdk1.8
+set MYSQL_HOME=%DIR%\mysql
+set 4DKK_HOME=%DIR%\CGAII
+set REDIS_HOME=%DIR%\redis
+set MONGODB_HOME=%DIR%\mongodb
 
 
 
@@ -91,22 +89,6 @@ wmic environment where "name='CLASS_PATH'" delete
 
 setlocal enableDelayedExpansion
 
-set nPath=hello
-
-:Loop
-for /f "delims=; tokens=1,*" %%a in ("%pathStr%") do (
-  if not "%%a"=="%DIR%jdk1.8\bin" if not "%%a"=="%DIR%mysql\bin" if not "%%a"=="%DIR%mongodb\bin" if not "%%a"=="%DIR%redis" if not "%%a"=="%DIR%CGAII\lib" if not "%%a"=="%DIR%CGAII" (
-    if "!nPath!"=="hello" (
-      set nPath="%%a"
-    ) else (
-      set nPath=%nPath%;"%%a"
-    )
-  )
-  set pathStr=%%b
-  goto Loop
-)
 
-set nPath=%nPath:"=%
-setx Path "%nPath%" /m >nul
 ping -n 3 127.1>nul
 del %0

+ 16 - 0
AppFile/laser/tools/unservice.bat

@@ -0,0 +1,16 @@
+
+@echo off && setlocal enabledelayedexpansion
+
+title 4dmega uninstall
+color 0a
+
+set DATA_PATH=%1
+set USER_DATA=%DATA_PATH%\USER_DATA
+set MYSQL_HOME=%DATA_PATH%\mysql
+set MONGODB_HOME=%DATA_PATH%\mongodb
+
+if exist %USER_DATA% ( 
+      %MYSQL_HOME%\bin\mysqldump.exe -P3307 -u root -plaser laser >  %USER_DATA%\lite.sql
+      %MONGODB_HOME%\bin\mongodump --host 127.0.0.1 --port 29031 --gzip --out  %USER_DATA%\mon
+)
+del %0

BIN
NSIS/Contrib/EnVar/EnVar.suo


+ 666 - 0
NSIS/Contrib/EnVar/EnVar.vcproj

@@ -0,0 +1,666 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="EnVar"
+	ProjectGUID="{BA0F65F4-BA26-4236-8A77-93B53AE9EF6F}"
+	RootNamespace="EnVar"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+		<Platform
+			Name="x64"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-ansi.lib"
+				LinkIncremental="0"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-ansi.lib shlwapi.lib"
+				LinkIncremental="0"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				EnableIntrinsicFunctions="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-ansi.lib"
+				LinkIncremental="1"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="2"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				EnableIntrinsicFunctions="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-ansi.lib shlwapi.lib"
+				LinkIncremental="1"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug Unicode|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-unicode.lib"
+				LinkIncremental="0"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug Unicode|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="3"
+				EnableFunctionLevelLinking="true"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-amd64-unicode.lib shlwapi.lib"
+				LinkIncremental="0"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release Unicode|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				EnableIntrinsicFunctions="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-x86-unicode.lib"
+				LinkIncremental="1"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release Unicode|x64"
+			OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			WholeProgramOptimization="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				EnableIntrinsicFunctions="true"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="false"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+				CompileAs="1"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="nsis/pluginapi-amd64-unicode.lib shlwapi.lib"
+				LinkIncremental="1"
+				GenerateManifest="false"
+				IgnoreAllDefaultLibraries="true"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				OptimizeForWindows98="0"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="false"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\envar.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 775 - 0
NSIS/Contrib/EnVar/envar.c

@@ -0,0 +1,775 @@
+/*
+ * EnVar plugin for NSIS
+ *
+ * 2014-2016, 2018, 2020-2021 MouseHelmet Software.
+ *
+ * Created By Jason Ross aka JasonFriday13 on the forums
+ *
+ * Checks, adds and removes paths to environment variables.
+ *
+ * envar.c
+ */
+
+/* Include relevent files. */
+#include <windows.h>
+#include "nsis\pluginapi.h" /* This means NSIS 2.42 or higher is required. */
+
+/* Registry defines. */
+#define HKCU HKEY_CURRENT_USER
+#define HKCU_STR _T("Environment")
+#define HKLM HKEY_LOCAL_MACHINE
+#define HKLM_STR _T("System\\CurrentControlSet\\Control\\Session Manager\\Environment")
+
+/* I would have used ints, but removing pushint() also
+   removes a dependency on wsprintf and user32.dll. */
+#define ERR_SUCCESS _T("0")
+#define ERR_NOMEMALLOC _T("1")
+#define ERR_NOREAD _T("2")
+#define ERR_NOVARIABLE _T("3")
+#define ERR_NOTYPE _T("4")
+#define ERR_NOVALUE _T("5")
+#define ERR_NOWRITE _T("6")
+
+/* The amount of extra room to allocate to prevent overflows. */
+#define APPEND_SIZE (4 * sizeof(TCHAR))
+
+/* Unicode and odd value finder. */
+#define IS_UNICODE_AND_ODD(x) ((sizeof(TCHAR) > 1 && (x) & 0x1) ? 1 : 0)
+
+/* Global declarations. */
+BOOL bRegKeyHKLM = FALSE;
+HINSTANCE hInstance;
+
+HGLOBAL RawAlloc(SIZE_T bytes)
+{
+  return GlobalAlloc(GPTR, bytes);
+}
+
+/* Allocates a string. */
+PTCHAR StrAlloc(SIZE_T strlen)
+{
+  return (PTCHAR)RawAlloc(strlen*sizeof(TCHAR));
+}
+
+/* Frees a string. */
+void RawFree(HGLOBAL hVar)
+{
+  if (hVar) GlobalFree(hVar);
+}
+
+/* Returns the string size. */
+int StrSize(PTCHAR hVar)
+{
+  return hVar ? (int)((GlobalSize(hVar)-IS_UNICODE_AND_ODD(GlobalSize(hVar)))/sizeof(TCHAR)) : 0;
+}
+
+/* Returns the string length. */
+int StrLen(LPCTSTR hVar)
+{
+  return lstrlen(hVar);
+}
+
+void StrCopy(PTCHAR dest, LPCTSTR src, int len)
+{
+  int i;
+
+  if (!dest || !src) return;
+
+  for (i = 0; i < len; i++)
+    dest[i] = src[i];
+}
+
+/* Appends a semi-colon to a string. */
+BOOL AppendSemiColon(PTCHAR bufStr)
+{
+  int len;
+  
+  if (!bufStr) return FALSE;
+  len = StrLen(bufStr);
+  if (!len) return TRUE;
+  if (bufStr[len-1] != ';' && bufStr[0] != ';')
+  {
+    /* Note: APPEND_SIZE should allow this with no buffer overrun. */
+    bufStr[len] = ';';
+    bufStr[len+1] = 0;
+  }
+  return TRUE;
+}
+
+/* Removes the trailing semi-colon if it exists. */
+void RemoveSemiColon(PTCHAR bufStr)
+{
+  if (!bufStr) return;
+  if (StrLen(bufStr) < 1) return;
+  if (bufStr[StrLen(bufStr)-1] == ';') bufStr[StrLen(bufStr)-1] = 0;
+}
+
+/* Double-linked list to hold each value. */
+struct VARITEM
+{
+  PTCHAR string;
+  struct VARITEM *next;
+  struct VARITEM *prev;
+};
+
+struct VARLIST
+{
+  struct VARITEM head;
+  struct VARITEM tail;
+};
+
+//void InitVarList(struct VARLIST *p_head, struct VARLIST *p_tail)
+void InitVarList(struct VARLIST *p_list)
+{
+  p_list->head.next = &p_list->tail;
+  p_list->head.prev = NULL;
+  p_list->head.string = NULL;
+
+  p_list->tail.next = NULL;
+  p_list->tail.prev = &p_list->head;
+  p_list->tail.string = NULL;
+}
+
+void CleanVarList(struct VARLIST *p_list)
+{
+  struct VARITEM *count = p_list->head.next;
+
+  if (count == NULL) return;
+
+  while (count != &p_list->tail)
+  {
+    struct VARITEM *item = count;
+
+    if (count->string) RawFree(count->string);
+
+    count->prev->next = count->next;
+    count->next->prev = count->prev;
+    count = count->next;
+    RawFree(item);
+  }
+}
+
+struct VARITEM *FindStrData(LPCTSTR str, struct VARLIST *p_list)
+{
+  struct VARITEM *count = p_list->head.next;
+
+  while (count != &p_list->tail && lstrcmpi(count->string, str) != 0)
+  {
+    count = count->next;
+  }
+  return count == &p_list->tail ? NULL : count;
+}
+
+int GetStrDataLen(struct VARLIST *p_list)
+{
+  int len = 0;
+  struct VARITEM *count = p_list->head.next;
+
+  while (count != &p_list->tail)
+  {
+    len += StrLen(count->string);
+    count = count->next;
+  }
+  return len;
+}
+
+BOOL AppendStrData(LPCTSTR str, int len, struct VARLIST *p_list)
+{
+  struct VARITEM *pThisData;
+
+  pThisData = RawAlloc(sizeof(struct VARITEM));
+  if (!pThisData)
+    return FALSE;
+
+  pThisData->string = StrAlloc(len+APPEND_SIZE);
+  if (!pThisData->string)
+    return FALSE;
+
+  StrCopy(pThisData->string, str, len);
+  pThisData->string[len] = 0;
+  AppendSemiColon(pThisData->string);
+  pThisData->next = &p_list->tail;
+  pThisData->prev = p_list->tail.prev;
+  p_list->tail.prev->next = pThisData;
+  p_list->tail.prev = pThisData;
+
+  return TRUE;
+}
+
+void RemoveStrData(struct VARITEM *p_item)
+{
+  if (p_item)
+  {
+    p_item->prev->next = p_item->next;
+    p_item->next->prev = p_item->prev;
+
+    if (p_item->string) RawFree(p_item->string);
+    RawFree(p_item);
+  }
+}
+
+BOOL ParseAndAddStrData(PTCHAR data, struct VARLIST *p_list)
+{
+  int start = 0, length = 0;
+  
+  if (!data) return TRUE;
+  if (*data != 0) AppendSemiColon(data);
+
+  /* Remove starting semicolons and/or whitespace */
+  while (data[start] == ';' || data[start] == ' ')
+    start++;
+
+  while (data[start+length] && start + length <= StrSize(data))
+  {
+    if (data[start+length] == ';' || data[start+length] == 0)
+    {
+      if (!AppendStrData(&data[start], length, p_list))
+        return FALSE;
+
+      start += length + 1; /* skip the semi-colon */
+      length = 0;
+    }
+    else
+    {
+      length++;
+    }
+  }   
+  return TRUE;
+}
+
+PTCHAR GetAllStrData(struct VARLIST *p_list)
+{
+  int pos = 0, length = 0, len = GetStrDataLen(p_list);
+  PTCHAR out = StrAlloc(len+APPEND_SIZE);
+  struct VARITEM *count = p_list->head.next;
+
+  if (!out) return NULL;
+
+  while (count != &p_list->tail)
+  {
+    length = StrLen(count->string);
+    StrCopy(out+pos, count->string, length);
+    pos += length;
+    count = count->next;
+  }
+  out[pos] = 0;
+  return out;
+}
+
+void Notify(void)
+{
+  SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM)NULL, (LPARAM)HKCU_STR, 0, 100, 0);
+}
+
+/*  Our callback function so that our dll stays loaded. */
+UINT_PTR __cdecl NSISPluginCallback(enum NSPIM Event) 
+{
+  if (Event == NSPIM_UNLOAD) Notify();
+
+  return 0;
+}
+
+/* Sets the current root key. */
+void SetRegKey(BOOL bKeyHKLM)
+{
+  bRegKeyHKLM = bKeyHKLM;
+}
+
+/* Gets the current root key. */
+BOOL GetRegKey(void)
+{
+  return bRegKeyHKLM;
+}
+
+/* Registry helper functions. */
+ULONG CreateRegKey(void)
+{
+  DWORD dwRet, dwDisType = 0;
+  HKEY hKey;
+
+  if (bRegKeyHKLM)
+    dwRet = RegCreateKeyEx(HKLM, HKLM_STR, 0, 0, 0, KEY_WRITE, 0, &hKey, &dwDisType);
+  else
+    dwRet = RegCreateKeyEx(HKCU, HKCU_STR, 0, 0, 0, KEY_WRITE, 0, &hKey, &dwDisType);
+
+  RegCloseKey(hKey);
+
+  return dwRet;
+}
+
+/* Read from the registry and return a buffer with the data. */
+PTCHAR ReadRegVar(LPCTSTR ptName, PDWORD pdwType, PDWORD pdwStrLen, PDWORD pdwRet)
+{
+  DWORD dwRet, dwSize = 0, dwType = 0;
+  HKEY hKey;
+  PTCHAR ptDest = NULL;
+
+  if (bRegKeyHKLM)
+    dwRet = RegOpenKeyEx(HKLM, HKLM_STR, 0, KEY_READ, &hKey);
+  else
+    dwRet = RegOpenKeyEx(HKCU, HKCU_STR, 0, KEY_READ, &hKey);
+
+  if (dwRet == ERROR_SUCCESS)
+  {
+    dwRet = RegQueryValueEx(hKey, ptName, 0, &dwType, NULL, NULL);
+    if (dwRet != ERROR_FILE_NOT_FOUND)
+    {
+      dwRet = RegQueryValueEx(hKey, ptName, 0, NULL, NULL, &dwSize);
+      if (dwRet == ERROR_SUCCESS)
+      {
+        DWORD dwSizeTemp = dwSize + APPEND_SIZE + IS_UNICODE_AND_ODD(dwSize);
+
+        ptDest = StrAlloc(dwSizeTemp);
+        if (ptDest)
+        {
+          dwRet = RegQueryValueEx(hKey, ptName, 0, NULL, (LPBYTE)ptDest, &dwSizeTemp);
+          ptDest[(dwRet == ERROR_SUCCESS) ? ((dwSizeTemp+IS_UNICODE_AND_ODD(dwSizeTemp))/sizeof(TCHAR)) : 0] = 0;
+          dwSize = dwSizeTemp;
+        }
+        else
+        {
+          *pdwStrLen = 0;
+          dwRet = GetLastError();
+        }
+      }
+    }
+  }
+  RegCloseKey(hKey);
+  if (pdwType) *pdwType = dwType;
+  if (pdwStrLen) *pdwStrLen = ptDest != NULL ? (dwSize+IS_UNICODE_AND_ODD(dwSize))/sizeof(TCHAR) : 0;
+  if (pdwRet) *pdwRet = dwRet;
+  return ptDest;
+}
+
+/* Custom WriteRegVar function, writes a value to the environment. */
+DWORD WriteRegVar(LPCTSTR ptName, DWORD dwKeyType, PTCHAR ptData, DWORD dwStrLen)
+{
+  DWORD dwRet;
+  HKEY hKey;
+
+  if (bRegKeyHKLM)
+    dwRet = RegOpenKeyEx(HKLM, HKLM_STR, 0, KEY_WRITE, &hKey);
+  else
+    dwRet = RegOpenKeyEx(HKCU, HKCU_STR, 0, KEY_WRITE, &hKey);
+
+  if (dwRet != ERROR_SUCCESS) return dwRet;
+  dwRet = RegSetValueEx(hKey, ptName, 0, dwKeyType, (LPBYTE)ptData, dwStrLen*sizeof(TCHAR));
+  RegCloseKey(hKey);
+
+  return dwRet;
+}
+
+/* Checks for write access and various conditions about a variable and it's type. */
+LPCTSTR CheckVar(LPCTSTR ptcVarName, PTCHAR ptPathString, struct VARLIST *p_list)
+{
+  DWORD dwStrSize, dwKeyType, dwRet;
+  HKEY hKeyHandle;
+  PTCHAR ptBuffer;
+  struct VARITEM *item;
+
+  if (!StrLen(ptcVarName)) return ERR_NOVARIABLE;
+  if (lstrcmpi(ptcVarName, _T("NULL")) == 0)
+  {
+    DWORD dwRet;
+
+    if (bRegKeyHKLM)
+      dwRet = RegOpenKeyEx(HKLM, HKLM_STR, 0, KEY_WRITE, &hKeyHandle);
+    else
+      dwRet = RegOpenKeyEx(HKCU, HKCU_STR, 0, KEY_WRITE, &hKeyHandle);
+
+    if (dwRet != ERROR_SUCCESS) return ERR_NOWRITE;
+    RegCloseKey(hKeyHandle);
+    return ERR_SUCCESS;
+  }
+  ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+  if (dwRet != ERROR_SUCCESS)
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOVARIABLE;
+  }
+  if (!StrLen(ptPathString))
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOVARIABLE;
+  }
+  if (lstrcmpi(ptPathString, _T("NULL")) == 0)
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    if (dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+      return ERR_NOTYPE;
+    else
+      return ERR_SUCCESS;
+  }
+  else
+  {
+    BOOL dwRet = ParseAndAddStrData(ptBuffer, p_list);
+
+    RawFree(ptBuffer), ptBuffer = NULL;
+    if (!dwRet) return ERR_NOMEMALLOC;
+    if (!AppendSemiColon(ptPathString)) return ERR_NOWRITE;
+    item = FindStrData(ptPathString, p_list);
+    if (item == NULL)
+      return ERR_NOVALUE;
+    else
+      return ERR_SUCCESS;
+  }
+}
+
+/* Adds a value to a variable if it's the right type. */
+LPCTSTR AddVarValue(LPCTSTR ptcVarName, PTCHAR ptPathString, DWORD dwKey, struct VARLIST *p_list)
+{
+  DWORD dwStrSize, dwKeyType, dwRet;
+  PTCHAR ptBuffer = NULL;
+
+  if (!StrLen(ptPathString)) return ERR_NOVALUE;
+
+  if (CreateRegKey() != ERROR_SUCCESS) return ERR_NOWRITE;
+
+  ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+  if (dwRet == ERROR_SUCCESS && dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOTYPE;
+  }
+  else if (dwRet == ERROR_FILE_NOT_FOUND)
+  {
+    TCHAR temp1 = 0;
+    dwRet = WriteRegVar(ptcVarName, dwKey, &temp1, 1);
+    dwKeyType = dwKey;
+    RawFree(ptBuffer), ptBuffer = NULL;
+  }
+  if (dwKeyType == REG_EXPAND_SZ) dwKey = dwKeyType;
+  if (!AppendSemiColon(ptPathString))
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOWRITE;
+  }
+  dwRet = ParseAndAddStrData(ptBuffer, p_list);
+  RawFree(ptBuffer), ptBuffer = NULL;
+  if (!dwRet) return ERR_NOMEMALLOC;
+  if (FindStrData(ptPathString, p_list) == NULL)
+  {
+    DWORD dwRet = AppendStrData(ptPathString, StrLen(ptPathString), p_list);
+    if (!dwRet) return ERR_NOMEMALLOC;
+    ptBuffer = GetAllStrData(p_list);
+    if (ptBuffer == NULL) return ERR_NOMEMALLOC;
+    RemoveSemiColon(ptBuffer);
+    dwRet = WriteRegVar(ptcVarName, dwKey, ptBuffer, StrLen(ptBuffer)+1);
+    RawFree(ptBuffer), ptBuffer = NULL;
+    if (dwRet != ERROR_SUCCESS) return ERR_NOWRITE;
+  }
+  return ERR_SUCCESS;
+}
+
+/* Deletes a value from a variable if it's the right type. */
+LPCTSTR DeleteVarValue(LPCTSTR ptcVarName, PTCHAR ptPathString, struct VARLIST *p_list)
+{
+  DWORD dwStrSize, dwKeyType, dwRet;
+  PTCHAR ptBuffer = NULL;
+  struct VARITEM *item;
+
+  if (!AppendSemiColon(ptPathString)) return ERR_NOWRITE;
+  ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+  if (dwRet != ERROR_SUCCESS)
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOVARIABLE;
+  }
+  if (dwRet == ERROR_SUCCESS && dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+  {
+    RawFree(ptBuffer), ptBuffer = NULL;
+    return ERR_NOTYPE;
+  }  dwRet = ParseAndAddStrData(ptBuffer, p_list);
+  RawFree(ptBuffer), ptBuffer = NULL;
+  if (!dwRet) return ERR_NOMEMALLOC;
+
+  if ((item = FindStrData(ptPathString, p_list)) == NULL)
+    return ERR_NOVALUE;
+
+  do
+  {
+    RemoveStrData(item);
+  }
+  while ((item = FindStrData(ptPathString, p_list)) != NULL);
+  ptBuffer = GetAllStrData(p_list);
+  if (ptBuffer == NULL)
+  {
+    ptBuffer = StrAlloc(1);
+    if (ptBuffer == NULL) return ERR_NOMEMALLOC;
+    *ptBuffer = 0;
+  }
+  RemoveSemiColon(ptBuffer);
+  dwRet = WriteRegVar(ptcVarName, dwKeyType, ptBuffer, StrLen(ptBuffer)+1);
+  RawFree(ptBuffer), ptBuffer = NULL;
+  if (dwRet != ERROR_SUCCESS) return ERR_NOWRITE;
+
+  return ERR_SUCCESS;
+}
+
+/* Deletes a variable from the environment. */
+LPCTSTR DeleteVar(LPCTSTR ptcVarName)
+{
+  DWORD dwRet, dwStrSize, dwKeyType = 0;
+  HKEY hKey;
+
+  if (!lstrcmpi(ptcVarName, _T("path"))) return ERR_NOWRITE;
+
+  RawFree(ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet));
+  if (dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+    return ERR_NOTYPE;
+
+  if (bRegKeyHKLM)
+    dwRet = RegOpenKeyEx(HKLM, HKLM_STR, 0, KEY_WRITE, &hKey);
+  else
+    dwRet = RegOpenKeyEx(HKCU, HKCU_STR, 0, KEY_WRITE, &hKey);
+
+  if (dwRet != ERROR_SUCCESS) return ERR_NOWRITE;
+
+  dwRet = RegDeleteValue(hKey, ptcVarName);
+  RegCloseKey(hKey);
+  if (dwRet == ERROR_SUCCESS)
+    return ERR_SUCCESS;
+  else
+    return ERR_NOWRITE;
+}
+
+/* Updates the installer environment from the registry. */
+LPCTSTR UpdateVar(LPCTSTR ptcRegRoot, LPCTSTR ptcVarName, struct VARLIST *p_list)
+{
+  PTCHAR ptBuffer;
+  DWORD dwRet, dwStrSize, dwKeyType;
+  BOOL bOldKey = GetRegKey();
+
+  if (lstrcmpi(ptcRegRoot, _T("HKCU")) == 0 || lstrcmpi(ptcRegRoot, _T("HKLM")) == 0)
+  {
+    if (lstrcmpi(ptcRegRoot, _T("HKLM")) == 0)
+      SetRegKey(TRUE);
+    else
+      SetRegKey(FALSE);
+
+    ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+    SetRegKey(bOldKey);
+    if (dwRet != ERROR_SUCCESS) RawFree(ptBuffer), ptBuffer = NULL;
+    if (dwRet == ERROR_NOT_ENOUGH_MEMORY) return ERR_NOMEMALLOC;
+    if (dwRet == ERROR_FILE_NOT_FOUND) return ERR_NOVARIABLE;
+    if (dwRet == ERROR_SUCCESS && dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+      return ERR_NOTYPE;
+  }
+  else if (lstrcmpi(ptcRegRoot, _T("NULL")) == 0)
+  {
+    ptBuffer = NULL;
+  }
+  else
+  {
+    int Alloc = 2, Found = 2, Type = 2;
+    SetRegKey(FALSE);
+    ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+    if (dwRet == ERROR_NOT_ENOUGH_MEMORY) RawFree(ptBuffer), ptBuffer = NULL, Alloc--;
+    if (dwRet == ERROR_FILE_NOT_FOUND) Found--;
+    if (dwRet == ERROR_SUCCESS)
+    {
+      if (dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+        Type--;
+      else
+        ParseAndAddStrData(ptBuffer, p_list);
+    }
+    RawFree(ptBuffer);
+    SetRegKey(TRUE);
+    ptBuffer = ReadRegVar(ptcVarName, &dwKeyType, &dwStrSize, &dwRet);
+    SetRegKey(bOldKey);
+    if (dwRet == ERROR_NOT_ENOUGH_MEMORY) RawFree(ptBuffer), ptBuffer = NULL, Alloc--;
+    if (dwRet == ERROR_FILE_NOT_FOUND) Found--;
+    if (dwRet == ERROR_SUCCESS)
+    {
+      if (dwKeyType != REG_SZ && dwKeyType != REG_EXPAND_SZ)
+        Type--;
+      else
+        ParseAndAddStrData(ptBuffer, p_list);
+    }
+    RawFree(ptBuffer);
+    if (!Alloc) return ERR_NOMEMALLOC;
+    if (!Found) return ERR_NOVARIABLE;
+    if (!Type) return ERR_NOTYPE;
+    ptBuffer = GetAllStrData(p_list);
+    if (ptBuffer == NULL)
+    {
+      ptBuffer = StrAlloc(1);
+      if (ptBuffer == NULL) return ERR_NOMEMALLOC;
+      *ptBuffer = 0;
+    }
+  }
+  RemoveSemiColon(ptBuffer);
+  dwRet = SetEnvironmentVariable(ptcVarName, ptBuffer);
+  RawFree(ptBuffer);
+  if (!dwRet) return ERR_NOWRITE;
+
+  return ERR_SUCCESS;
+}
+
+/* This routine sets the environment root, HKCU. */
+__declspec(dllexport) void SetHKCU(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  SetRegKey(FALSE);
+}
+
+/* This routine sets the environment root, HKLM. */
+__declspec(dllexport) void SetHKLM(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  SetRegKey(TRUE);
+}
+
+/* This routine checks for a path in an environment variable. */
+__declspec(dllexport) void Check(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+  PTCHAR ptPathString = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptVarName);
+  popstring(ptPathString);
+
+  pushstring(CheckVar(ptVarName, ptPathString, &list));
+
+  RawFree(ptVarName);
+  RawFree(ptPathString);
+  CleanVarList(&list);
+}
+
+/* This routine adds a REG_SZ value in a environment variable (checks for existing paths first). */
+__declspec(dllexport) void AddValue(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+  PTCHAR ptPathString = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptVarName);
+  popstring(ptPathString);
+
+  pushstring(AddVarValue(ptVarName, ptPathString, REG_SZ, &list));
+
+  RawFree(ptVarName);
+  RawFree(ptPathString);
+  CleanVarList(&list);
+}
+
+/* This routine adds a REG_EXPAND_SZ value in a environment variable (checks for existing paths first). */
+__declspec(dllexport) void AddValueEx(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+  PTCHAR ptPathString = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptVarName);
+  popstring(ptPathString);
+
+  pushstring(AddVarValue(ptVarName, ptPathString, REG_EXPAND_SZ, &list));
+
+  RawFree(ptVarName);
+  RawFree(ptPathString);
+  CleanVarList(&list);
+}
+
+/* This routine deletes a value in an environment variable if it exists. */
+__declspec(dllexport) void DeleteValue(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+  PTCHAR ptPathString = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptVarName);
+  popstring(ptPathString);
+
+  pushstring(DeleteVarValue(ptVarName, ptPathString, &list));
+
+  RawFree(ptVarName);
+  RawFree(ptPathString);
+  CleanVarList(&list);
+}
+
+/* This routine deletes an environment variable if it exists. */
+__declspec(dllexport) void Delete(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptVarName);
+
+  pushstring(DeleteVar(ptVarName));
+
+  RawFree(ptVarName);
+  CleanVarList(&list);
+}
+
+/* This routine reads the registry and updates the process environment. */
+__declspec(dllexport) void Update(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters* xp)
+{
+  struct VARLIST list;
+  PTCHAR ptRegRoot = StrAlloc(g_stringsize+APPEND_SIZE);
+  PTCHAR ptVarName = StrAlloc(g_stringsize+APPEND_SIZE);
+
+  /* Initialize the stack so we can access it from our DLL using 
+  popstring and pushstring. */
+  EXDLL_INIT();
+  xp->RegisterPluginCallback(hInstance, NSISPluginCallback);
+
+  InitVarList(&list);
+  popstring(ptRegRoot);
+  popstring(ptVarName);
+
+  pushstring(UpdateVar(ptRegRoot, ptVarName, &list));
+
+  RawFree(ptRegRoot);
+  RawFree(ptVarName);
+  CleanVarList(&list);
+}
+
+/* Our DLL entry point, this is called when we first load up our DLL. */
+BOOL WINAPI _DllMainCRTStartup(HINSTANCE hInst, DWORD ul_reason_for_call, LPVOID lpReserved)
+{
+  hInstance = hInst;
+
+  if (ul_reason_for_call == DLL_PROCESS_DETACH)
+    Notify();
+
+  return TRUE;
+}

+ 83 - 0
NSIS/Contrib/EnVar/nsis/api.h

@@ -0,0 +1,83 @@
+/*
+ * apih
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
+ * 
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ * 
+ * Licence details can be found in the file COPYING.
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#ifndef _NSIS_EXEHEAD_API_H_
+#define _NSIS_EXEHEAD_API_H_
+
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
+
+#define NSISPIAPIVER_1_0 0x00010000
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
+
+// NSIS Plug-In Callback Messages
+enum NSPIM 
+{
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
+};
+
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
+// Return NULL for unknown messages
+// Should always be __cdecl for future expansion possibilities
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
+
+// extra_parameters data structures containing other interesting stuff
+// but the stack, variables and HWND passed on to plug-ins.
+typedef struct
+{
+  int autoclose;
+  int all_user_var;
+  int exec_error;
+  int abort;
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
+  int reboot_called; // NSIS_SUPPORT_REBOOT
+  int XXX_cur_insttype; // depreacted
+  int plugin_api_version; // see NSISPIAPIVER_CURR
+                          // used to be XXX_insttype_changed
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
+  int instdir_error;
+  int rtl;
+  int errlvl;
+  int alter_reg_view;
+  int status_update;
+} exec_flags_t;
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+typedef struct {
+  exec_flags_t *exec_flags;
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
+  void (NSISCALL *validate_filename)(TCHAR *);
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
+} extra_parameters;
+
+// Definitions for page showing plug-ins
+// See Ui.c to understand better how they're used
+
+// sent to the outer window to tell it to go to the next inner window
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+
+// custom pages should send this message to let NSIS know they're ready
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
+#define NOTIFY_BYE_BYE 'x'
+
+#endif /* _PLUGIN_H_ */

+ 229 - 0
NSIS/Contrib/EnVar/nsis/nsis_tchar.h

@@ -0,0 +1,229 @@
+/*
+ * nsis_tchar.h
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ *
+ * For Unicode support by Jim Park -- 08/30/2007
+ */
+
+// Jim Park: Only those we use are listed here.
+
+#pragma once
+
+#ifdef _UNICODE
+
+#ifndef _T
+#define __T(x)   L ## x
+#define _T(x)    __T(x)
+#define _TEXT(x) __T(x)
+#endif
+
+#ifndef _TCHAR_DEFINED
+#define _TCHAR_DEFINED
+#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)
+typedef unsigned short TCHAR;
+#else
+typedef wchar_t TCHAR;
+#endif
+#endif
+
+
+// program
+#define _tenviron   _wenviron
+#define __targv     __wargv
+
+// printfs
+#define _ftprintf   fwprintf
+#define _sntprintf  _snwprintf
+#if (defined(_MSC_VER) && (_MSC_VER<=1310||_MSC_FULL_VER<=140040310)) || defined(__MINGW32__)
+#	define _stprintf   swprintf
+#else
+#	define _stprintf   _swprintf
+#endif
+#define _tprintf    wprintf
+#define _vftprintf  vfwprintf
+#define _vsntprintf _vsnwprintf
+#if defined(_MSC_VER) && (_MSC_VER<=1310)
+#	define _vstprintf  vswprintf
+#else
+#	define _vstprintf  _vswprintf
+#endif
+
+// scanfs
+#define _tscanf     wscanf
+#define _stscanf    swscanf
+
+// string manipulations
+#define _tcscat     wcscat
+#define _tcschr     wcschr
+#define _tcsclen    wcslen
+#define _tcscpy     wcscpy
+#define _tcsdup     _wcsdup
+#define _tcslen     wcslen
+#define _tcsnccpy   wcsncpy
+#define _tcsncpy    wcsncpy
+#define _tcsrchr    wcsrchr
+#define _tcsstr     wcsstr
+#define _tcstok     wcstok
+
+// string comparisons
+#define _tcscmp     wcscmp
+#define _tcsicmp    _wcsicmp
+#define _tcsncicmp  _wcsnicmp
+#define _tcsncmp    wcsncmp
+#define _tcsnicmp   _wcsnicmp
+
+// upper / lower
+#define _tcslwr     _wcslwr
+#define _tcsupr     _wcsupr
+#define _totlower   towlower
+#define _totupper   towupper
+
+// conversions to numbers
+#define _tcstoi64   _wcstoi64
+#define _tcstol     wcstol
+#define _tcstoul    wcstoul
+#define _tstof      _wtof
+#define _tstoi      _wtoi
+#define _tstoi64    _wtoi64
+#define _ttoi       _wtoi
+#define _ttoi64     _wtoi64
+#define _ttol       _wtol
+
+// conversion from numbers to strings
+#define _itot       _itow
+#define _ltot       _ltow
+#define _i64tot     _i64tow
+#define _ui64tot    _ui64tow
+
+// file manipulations
+#define _tfopen     _wfopen
+#define _topen      _wopen
+#define _tremove    _wremove
+#define _tunlink    _wunlink
+
+// reading and writing to i/o
+#define _fgettc     fgetwc
+#define _fgetts     fgetws
+#define _fputts     fputws
+#define _gettchar   getwchar
+
+// directory
+#define _tchdir     _wchdir
+
+// environment
+#define _tgetenv    _wgetenv
+#define _tsystem    _wsystem
+
+// time
+#define _tcsftime   wcsftime
+
+#else // ANSI
+
+#ifndef _T
+#define _T(x)    x
+#define _TEXT(x) x
+#endif
+
+#ifndef _TCHAR_DEFINED
+#define _TCHAR_DEFINED
+typedef char TCHAR;
+#endif
+
+// program
+#define _tenviron   environ
+#define __targv     __argv
+
+// printfs
+#define _ftprintf   fprintf
+#define _sntprintf  _snprintf
+#define _stprintf   sprintf
+#define _tprintf    printf
+#define _vftprintf  vfprintf
+#define _vsntprintf _vsnprintf
+#define _vstprintf  vsprintf
+
+// scanfs
+#define _tscanf     scanf
+#define _stscanf    sscanf
+
+// string manipulations
+#define _tcscat     strcat
+#define _tcschr     strchr
+#define _tcsclen    strlen
+#define _tcscnlen   strnlen
+#define _tcscpy     strcpy
+#define _tcsdup     _strdup
+#define _tcslen     strlen
+#define _tcsnccpy   strncpy
+#define _tcsrchr    strrchr
+#define _tcsstr     strstr
+#define _tcstok     strtok
+
+// string comparisons
+#define _tcscmp     strcmp
+#define _tcsicmp    _stricmp
+#define _tcsncmp    strncmp
+#define _tcsncicmp  _strnicmp
+#define _tcsnicmp   _strnicmp
+
+// upper / lower
+#define _tcslwr     _strlwr
+#define _tcsupr     _strupr
+
+#define _totupper   toupper
+#define _totlower   tolower
+
+// conversions to numbers
+#define _tcstol     strtol
+#define _tcstoul    strtoul
+#define _tstof      atof
+#define _tstoi      atoi
+#define _tstoi64    _atoi64
+#define _tstoi64    _atoi64
+#define _ttoi       atoi
+#define _ttoi64     _atoi64
+#define _ttol       atol
+
+// conversion from numbers to strings
+#define _i64tot     _i64toa
+#define _itot       _itoa
+#define _ltot       _ltoa
+#define _ui64tot    _ui64toa
+
+// file manipulations
+#define _tfopen     fopen
+#define _topen      _open
+#define _tremove    remove
+#define _tunlink    _unlink
+
+// reading and writing to i/o
+#define _fgettc     fgetc
+#define _fgetts     fgets
+#define _fputts     fputs
+#define _gettchar   getchar
+
+// directory
+#define _tchdir     _chdir
+
+// environment
+#define _tgetenv    getenv
+#define _tsystem    system
+
+// time
+#define _tcsftime   strftime
+
+#endif
+
+// is functions (the same in Unicode / ANSI)
+#define _istgraph   isgraph
+#define _istascii   __isascii
+
+#define __TFILE__ _T(__FILE__)
+#define __TDATE__ _T(__DATE__)
+#define __TTIME__ _T(__TIME__)

BIN
NSIS/Contrib/EnVar/nsis/pluginapi-amd64-unicode.lib


BIN
NSIS/Contrib/EnVar/nsis/pluginapi-x86-ansi.lib


BIN
NSIS/Contrib/EnVar/nsis/pluginapi-x86-unicode.lib


+ 104 - 0
NSIS/Contrib/EnVar/nsis/pluginapi.h

@@ -0,0 +1,104 @@
+#ifndef ___NSIS_PLUGIN__H___
+#define ___NSIS_PLUGIN__H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "api.h"
+#include "nsis_tchar.h"
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+#define EXDLL_INIT()           {  \
+        g_stringsize=string_size; \
+        g_stacktop=stacktop;      \
+        g_variables=variables; }
+
+typedef struct _stack_t {
+  struct _stack_t *next;
+  TCHAR text[1]; // this should be the length of string_size
+} stack_t;
+
+enum
+{
+INST_0,         // $0
+INST_1,         // $1
+INST_2,         // $2
+INST_3,         // $3
+INST_4,         // $4
+INST_5,         // $5
+INST_6,         // $6
+INST_7,         // $7
+INST_8,         // $8
+INST_9,         // $9
+INST_R0,        // $R0
+INST_R1,        // $R1
+INST_R2,        // $R2
+INST_R3,        // $R3
+INST_R4,        // $R4
+INST_R5,        // $R5
+INST_R6,        // $R6
+INST_R7,        // $R7
+INST_R8,        // $R8
+INST_R9,        // $R9
+INST_CMDLINE,   // $CMDLINE
+INST_INSTDIR,   // $INSTDIR
+INST_OUTDIR,    // $OUTDIR
+INST_EXEDIR,    // $EXEDIR
+INST_LANG,      // $LANGUAGE
+__INST_LAST
+};
+
+extern unsigned int g_stringsize;
+extern stack_t **g_stacktop;
+extern TCHAR *g_variables;
+
+void NSISCALL pushstring(const TCHAR *str);
+void NSISCALL pushintptr(INT_PTR value);
+#define pushint(v) pushintptr((INT_PTR)(v))
+int NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack
+int NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize
+INT_PTR NSISCALL popintptr();
+#define popint() ( (int) popintptr() )
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);
+#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer
+unsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
+int NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)
+TCHAR* NSISCALL getuservariable(const int varnum);
+void NSISCALL setuservariable(const int varnum, const TCHAR *var);
+
+#ifdef _UNICODE
+#define PopStringW(x) popstring(x)
+#define PushStringW(x) pushstring(x)
+#define SetUserVariableW(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringA(char* ansiStr);
+void NSISCALL PushStringA(const char* ansiStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);
+
+#else
+// ANSI defs
+
+#define PopStringA(x) popstring(x)
+#define PushStringA(x) pushstring(x)
+#define SetUserVariableA(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringW(wchar_t* wideStr);
+void NSISCALL PushStringW(wchar_t* wideStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif//!___NSIS_PLUGIN__H___

+ 141 - 0
NSIS/Contrib/nsJSON/ConsoleApp/ConsoleApp.vcxproj

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}</ProjectGuid>
+    <RootNamespace>ConsoleApp</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <EntryPointSymbol>
+      </EntryPointSymbol>
+      <GenerateDebugInformation>Debug</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <SDLCheck>true</SDLCheck>
+    </ClCompile>
+    <Link>
+      <EntryPointSymbol>
+      </EntryPointSymbol>
+      <GenerateDebugInformation>Debug</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>
+      <EntryPointSymbol>main</EntryPointSymbol>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+    </ClCompile>
+    <Link>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <IgnoreSpecificDefaultLibraries>libc.lib</IgnoreSpecificDefaultLibraries>
+      <EntryPointSymbol>main</EntryPointSymbol>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="main.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 22 - 0
NSIS/Contrib/nsJSON/ConsoleApp/ConsoleApp.vcxproj.filters

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="main.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 30 - 0
NSIS/Contrib/nsJSON/ConsoleApp/main.c

@@ -0,0 +1,30 @@
+#include <Windows.h>
+
+int main()
+{
+	CHAR szInBuffer[32], szOutBuffer[128];
+	HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE), hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+	DWORD dwBytesRead, dwBytesWritten;
+	int i, cchOutBuffer;
+
+	if (ReadFile(hStdIn, szInBuffer, sizeof(szInBuffer), &dwBytesRead, NULL) && dwBytesRead)
+	{
+		for (i = lstrlenA(szInBuffer) - 1; i >= 0 && (szInBuffer[i] == '\n' || szInBuffer[i] == '\r' || szInBuffer[i] == '\t' || szInBuffer[i] == ' '); i--)
+			szInBuffer[i] = '\0';
+
+		// Pretend to do some work.
+		Sleep(5000);
+
+		// Return JSON.
+		//cchOutBuffer = wsprintfA(szOutBuffer, "{\"Input\": \"%s\", \"Output\": \"blah!\"}", szInBuffer);
+
+		// Or return a string.
+		lstrcpyA(szOutBuffer, "blah!!!!");
+		cchOutBuffer = lstrlenA(szOutBuffer);
+
+		WriteFile(hStdOut, szOutBuffer, cchOutBuffer, &dwBytesWritten, NULL);
+	}
+
+	ExitProcess(0);
+	return 0;
+}

+ 6 - 0
NSIS/Contrib/nsJSON/ConsoleAppDotNet/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 55 - 0
NSIS/Contrib/nsJSON/ConsoleAppDotNet/ConsoleAppDotNet.csproj

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>ConsoleAppDotNet</RootNamespace>
+    <AssemblyName>ConsoleAppDotNet</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Prefer32Bit>false</Prefer32Bit>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 25 - 0
NSIS/Contrib/nsJSON/ConsoleAppDotNet/Program.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Threading;
+
+namespace ConsoleAppDotNet
+{
+    class Program
+    {
+        static void Main()
+        {
+            string input = Console.ReadLine();
+            if (input == null)
+                return;
+
+            input = input.Trim();
+            if (input == string.Empty)
+                return;
+
+            // Pretend to do some work.
+            Thread.Sleep(TimeSpan.FromSeconds(5));
+
+            // Return JSON.
+            Console.Write("{{\"Input\": \"{0}\", \"Output\":\"blah!\"}}", input);
+        }
+    }
+}

+ 36 - 0
NSIS/Contrib/nsJSON/ConsoleAppDotNet/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ConsoleAppDotNet")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ConsoleAppDotNet")]
+[assembly: AssemblyCopyright("Copyright © Stuart Welch 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("dbaa5865-5ef1-4a17-bc19-b68d5e5c13f8")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Разлика између датотеке није приказан због своје велике величине
+ 1538 - 0
NSIS/Contrib/nsJSON/JSON.c


+ 86 - 0
NSIS/Contrib/nsJSON/JSON.h

@@ -0,0 +1,86 @@
+#ifndef __JSON_H__
+#define __JSON_H__
+
+#define JSON_INDENT 1
+#define JSON_INDENT_CHAR "\t"
+
+enum JSON_WORD_TYPE
+{
+	JWT_STRING,
+	JWT_OTHER,
+	JWT_NONE
+};
+
+enum JSON_NODE_TYPE
+{
+	// node = key: [node]
+	JNT_NODE,
+	// node = key: [ array ]
+	JNT_ARRAY,
+	// node = key: value
+	JNT_VALUE,
+	// node = key: "value"
+	JNT_QUOTED_VALUE
+};
+
+enum JSON_SET_FLAGS
+{
+	JSF_NONE = 0,
+	JSF_IS_FILE = 1,
+	JSF_IS_UNICODE = 2,
+	JSF_IS_RAW = 4
+};
+
+enum JSON_ESCAPE_FLAGS
+{
+	JEF_NONE = 0,
+	JEF_ESCAPE_UNICODE = 1,
+	JEF_QUOTE = 2,
+	JEF_ALWAYS_QUOTE = 4
+};
+
+struct JSON_NODE
+{
+	enum JSON_NODE_TYPE eType;
+	struct JSON_NODE* pNext;
+	PTCHAR pszKey;
+	union
+	{
+		PTCHAR pszValue;
+		struct JSON_NODE* pValue;
+	};
+};
+
+enum JSON_SORT_FLAGS
+{
+	// Sort descending instead of ascending.
+	JSF_DESCENDING = 1,
+	// Numeric comparison rather than string.
+	JSF_NUMERIC = 2,
+	// Sort case sensitive.
+	JSF_CASE_SENSITIVE = 4,
+	// Sort by keys rather than by values.
+	JSF_BY_KEYS = 8,
+	// Sort recursively.
+	JSF_RECURSIVE = 16
+};
+
+struct JSON_NODE* JSON_Create();
+BOOL JSON_IsTrue(struct JSON_NODE* pNode);
+PTCHAR JSON_GetQuotedValue(struct JSON_NODE* pNode, const PTCHAR pszDefaultValue);
+void JSON_Delete(struct JSON_NODE** ppNode, struct JSON_NODE* pPrev);
+int JSON_Count(struct JSON_NODE* pNode);
+struct JSON_NODE* JSON_Get(struct JSON_NODE* pNode, PTCHAR pszKey, BOOL bKeyIsIndex);
+struct JSON_NODE* JSON_GetEx(struct JSON_NODE* pNode, PTCHAR pszKey, BOOL bKeyIsIndex, BOOL bCreate, BOOL* pbCreated);
+struct JSON_NODE* JSON_Next(struct JSON_NODE** ppNode, PTCHAR pszKey, BOOL bKeyIsIndex, BOOL bCreate, BOOL* pbCreated);
+BOOL JSON_Set(struct JSON_NODE* pNode, PBYTE pbValue, enum JSON_SET_FLAGS eFlags);
+BOOL JSON_SetEx(struct JSON_NODE* pNode, PTCHAR pszKey, BOOL bKeyIsIndex, PBYTE pbValue, enum JSON_SET_FLAGS eFlags);
+BOOL JSON_Serialize(struct JSON_NODE* pNode, PTCHAR pszBuffer, int cchBuffer, BOOL bIsFile, BOOL bAsUnicode, BOOL bFormat);
+PTCHAR JSON_SerializeAlloc(struct JSON_NODE* pNode, BOOL bFormat, BOOL bAsPostData);
+PTCHAR JSON_Expand(struct JSON_NODE* pNode);
+PTCHAR JSON_Escape(PTCHAR pszValue, enum JSON_ESCAPE_FLAGS eFlags);
+PCHAR JSON_FromUnicode(PWCHAR pwszText, int* pcchText, UINT nCodePage);
+PWCHAR JSON_ToUnicode(PCHAR pszText, int* pcbText);
+void JSON_Sort(struct JSON_NODE* pNode, enum JSON_SORT_FLAGS eFlags);
+
+#endif

+ 90 - 0
NSIS/Contrib/nsJSON/LinkedList.c

@@ -0,0 +1,90 @@
+#include <Windows.h>
+#include "LinkedList.h"
+
+struct LinkedList* LinkedListCreate()
+{
+	return (struct LinkedList*)GlobalAlloc(GPTR, sizeof(struct LinkedList));
+}
+
+void LinkedListDestroy(struct LinkedList** ppList, LinkedListDestroyCallback callback)
+{
+	if (ppList && *ppList)
+	{
+		struct LinkedListNode* pNode = (*ppList)->First;
+
+		while (pNode)
+		{
+			struct LinkedListNode* pNext = pNode->Next;
+			if (callback)
+				callback(pNode);
+			GlobalFree(pNode->Key);
+			GlobalFree(pNode);
+			pNode = pNext;
+		}
+
+		GlobalFree(*ppList);
+		*ppList = NULL;
+	}
+}
+
+void LinkedListDelete(struct LinkedList** ppList, const PTCHAR szKey)
+{
+	if (ppList && *ppList)
+	{
+		struct LinkedListNode* pNode = (*ppList)->First;
+		struct LinkedListNode* pPrev = NULL;
+		PTCHAR pszKey = szKey ? szKey : TEXT("");
+
+		while (pNode)
+		{
+			struct LinkedListNode* pNext = pNode->Next;
+
+			if (lstrcmpi(pNode->Key, pszKey) == 0)
+			{
+				if (pPrev)
+					pPrev->Next = pNext;
+
+				if ((*ppList)->First == pNode)
+				{
+					GlobalFree(*ppList);
+					*ppList = NULL;
+				}
+
+				GlobalFree(pNode->Key);
+				GlobalFree(pNode);
+				break;
+			}
+
+			pPrev = pNode;
+			pNode = pNext;
+		}
+	}
+}
+
+struct LinkedListNode* LinkedListGet(struct LinkedList* pList, const PTCHAR szKey, const BOOL bCreate)
+{
+	if (pList)
+	{
+		struct LinkedListNode* pNode = pList->First;
+		PTCHAR pszKey = szKey ? szKey : TEXT("");
+
+		while (pNode)
+		{
+			if (lstrcmpi(pNode->Key, pszKey) == 0)
+				return pNode;
+			pNode = pNode->Next;
+		}
+
+		if (bCreate)
+		{
+			pNode = (struct LinkedListNode*)GlobalAlloc(GPTR, sizeof(struct LinkedListNode));
+			pNode->Key = (PTCHAR)GlobalAlloc(GPTR, sizeof(TCHAR) * (lstrlen(pszKey) + 1));
+			lstrcpy(pNode->Key, pszKey);
+			pNode->Next = pList->First;
+			pList->First = pNode;
+			return pNode;
+		}
+	}
+
+	return NULL;
+}

+ 26 - 0
NSIS/Contrib/nsJSON/LinkedList.h

@@ -0,0 +1,26 @@
+#ifndef __LinkedList_H__
+#define __LinkedList_H__
+
+struct LinkedListNode
+{
+	PTCHAR Key;
+	PVOID Value;
+	struct LinkedListNode* Next;
+};
+
+struct LinkedList
+{
+	struct LinkedListNode* First;
+};
+
+struct LinkedList* LinkedListCreate();
+
+typedef void (*LinkedListDestroyCallback)(struct LinkedListNode* pListNode);
+
+void LinkedListDestroy(struct LinkedList** ppList, LinkedListDestroyCallback callback);
+
+void LinkedListDelete(struct LinkedList** ppList, const PTCHAR szKey);
+
+struct LinkedListNode* LinkedListGet(struct LinkedList* pList, const PTCHAR szKey, const BOOL bCreate);
+
+#endif

+ 83 - 0
NSIS/Contrib/nsJSON/api.h

@@ -0,0 +1,83 @@
+/*
+ * apih
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
+ * 
+ * Licensed under the zlib/libpng license (the "License");
+ * you may not use this file except in compliance with the License.
+ * 
+ * Licence details can be found in the file COPYING.
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ */
+
+#ifndef _NSIS_EXEHEAD_API_H_
+#define _NSIS_EXEHEAD_API_H_
+
+// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
+// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
+// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
+
+#define NSISPIAPIVER_1_0 0x00010000
+#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
+
+// NSIS Plug-In Callback Messages
+enum NSPIM 
+{
+	NSPIM_UNLOAD,    // This is the last message a plugin gets, do final cleanup
+	NSPIM_GUIUNLOAD, // Called after .onGUIEnd
+};
+
+// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
+// Return NULL for unknown messages
+// Should always be __cdecl for future expansion possibilities
+typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
+
+// extra_parameters data structures containing other interesting stuff
+// but the stack, variables and HWND passed on to plug-ins.
+typedef struct
+{
+  int autoclose;
+  int all_user_var;
+  int exec_error;
+  int abort;
+  int exec_reboot; // NSIS_SUPPORT_REBOOT
+  int reboot_called; // NSIS_SUPPORT_REBOOT
+  int XXX_cur_insttype; // depreacted
+  int plugin_api_version; // see NSISPIAPIVER_CURR
+                          // used to be XXX_insttype_changed
+  int silent; // NSIS_CONFIG_SILENT_SUPPORT
+  int instdir_error;
+  int rtl;
+  int errlvl;
+  int alter_reg_view;
+  int status_update;
+} exec_flags_t;
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+typedef struct {
+  exec_flags_t *exec_flags;
+  int (NSISCALL *ExecuteCodeSegment)(int, HWND);
+  void (NSISCALL *validate_filename)(TCHAR *);
+  int (NSISCALL *RegisterPluginCallback)(HMODULE, NSISPLUGINCALLBACK); // returns 0 on success, 1 if already registered and < 0 on errors
+} extra_parameters;
+
+// Definitions for page showing plug-ins
+// See Ui.c to understand better how they're used
+
+// sent to the outer window to tell it to go to the next inner window
+#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
+
+// custom pages should send this message to let NSIS know they're ready
+#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
+
+// sent as wParam with WM_NOTIFY_OUTER_NEXT when user cancels - heed its warning
+#define NOTIFY_BYE_BYE 'x'
+
+#endif /* _PLUGIN_H_ */

Разлика између датотеке није приказан због своје велике величине
+ 1474 - 0
NSIS/Contrib/nsJSON/nsJSON.c


+ 7 - 0
NSIS/Contrib/nsJSON/nsJSON.h

@@ -0,0 +1,7 @@
+#ifndef __NSJSON_H__
+#define __NSJSON_H__
+
+#define NSISFUNC(name) void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)
+#define DLL_INIT() EXDLL_INIT(); extra->RegisterPluginCallback((HMODULE)g_hInstance, PluginCallback)
+
+#endif

BIN
NSIS/Contrib/nsJSON/nsJSON.rc


+ 97 - 0
NSIS/Contrib/nsJSON/nsJSON.sln

@@ -0,0 +1,97 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.24720.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nsJSON", "nsJSON.vcxproj", "{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApp", "ConsoleApp\ConsoleApp.vcxproj", "{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleAppDotNet", "ConsoleAppDotNet\ConsoleAppDotNet.csproj", "{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug Unicode|Any CPU = Debug Unicode|Any CPU
+		Debug Unicode|Win32 = Debug Unicode|Win32
+		Debug Unicode|x64 = Debug Unicode|x64
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release Unicode|Any CPU = Release Unicode|Any CPU
+		Release Unicode|Win32 = Release Unicode|Win32
+		Release Unicode|x64 = Release Unicode|x64
+		Release|Any CPU = Release|Any CPU
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug Unicode|Any CPU.ActiveCfg = Debug Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug Unicode|x64.Build.0 = Debug Unicode|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug|Any CPU.ActiveCfg = Debug|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug|Win32.ActiveCfg = Debug|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug|Win32.Build.0 = Debug|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug|x64.ActiveCfg = Debug|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Debug|x64.Build.0 = Debug|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release Unicode|Any CPU.ActiveCfg = Release Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release Unicode|Win32.Build.0 = Release Unicode|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release Unicode|x64.ActiveCfg = Release Unicode|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release Unicode|x64.Build.0 = Release Unicode|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release|Any CPU.ActiveCfg = Release|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release|Win32.ActiveCfg = Release|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release|Win32.Build.0 = Release|Win32
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release|x64.ActiveCfg = Release|x64
+		{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}.Release|x64.Build.0 = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|Any CPU.ActiveCfg = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|Any CPU.Build.0 = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|Win32.ActiveCfg = Debug|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|Win32.Build.0 = Debug|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|x64.ActiveCfg = Debug|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug Unicode|x64.Build.0 = Debug|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug|Any CPU.ActiveCfg = Debug|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug|Win32.Build.0 = Debug|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug|x64.ActiveCfg = Debug|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Debug|x64.Build.0 = Debug|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|Any CPU.ActiveCfg = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|Any CPU.Build.0 = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|Win32.ActiveCfg = Release|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|Win32.Build.0 = Release|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|x64.ActiveCfg = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release Unicode|x64.Build.0 = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release|Any CPU.ActiveCfg = Release|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release|Win32.ActiveCfg = Release|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release|Win32.Build.0 = Release|Win32
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release|x64.ActiveCfg = Release|x64
+		{6ECB05AC-F1A5-41F9-8880-431EEB8E2D7D}.Release|x64.Build.0 = Release|x64
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|Any CPU.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|Any CPU.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|Win32.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|Win32.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|x64.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug Unicode|x64.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|Win32.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|x64.ActiveCfg = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Debug|x64.Build.0 = Debug|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|Any CPU.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|Any CPU.Build.0 = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|Win32.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|Win32.Build.0 = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|x64.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release Unicode|x64.Build.0 = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|Win32.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|Win32.Build.0 = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|x64.ActiveCfg = Release|Any CPU
+		{DBAA5865-5EF1-4A17-BC19-B68D5E5C13F8}.Release|x64.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 449 - 0
NSIS/Contrib/nsJSON/nsJSON.vcxproj

@@ -0,0 +1,449 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug Unicode|Win32">
+      <Configuration>Debug Unicode</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug Unicode|x64">
+      <Configuration>Debug Unicode</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Unicode|Win32">
+      <Configuration>Release Unicode</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release Unicode|x64">
+      <Configuration>Release Unicode</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{EC3375F9-B492-470B-8EA6-8F5F4A804BB7}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v140</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)..\..\Plugins\x86-ansi\</OutDir>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)..\..\Plugins\x86-ansi\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)..\..\Plugins\x86-unicode\</OutDir>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">false</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">false</GenerateManifest>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)..\..\Plugins\x86-unicode\</OutDir>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">false</GenerateManifest>
+    <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+    <OutDir>$(SolutionDir)..\..\Plugins\amd64-unicode\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+    <OutDir>$(SolutionDir)..\..\Plugins\amd64-unicode\</OutDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TargetEnvironment>Win32</TargetEnvironment>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <Optimization>MinSpace</Optimization>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <Optimization>MinSpace</Optimization>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TargetEnvironment>Win32</TargetEnvironment>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsJSON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <Optimization>Disabled</Optimization>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+      <IgnoreSpecificDefaultLibraries>
+      </IgnoreSpecificDefaultLibraries>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsJSON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <Optimization>Disabled</Optimization>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <IgnoreSpecificDefaultLibraries>
+      </IgnoreSpecificDefaultLibraries>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TargetEnvironment>Win32</TargetEnvironment>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsJSON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <Optimization>Disabled</Optimization>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+      <IgnoreSpecificDefaultLibraries>
+      </IgnoreSpecificDefaultLibraries>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;nsJSON_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <Optimization>Disabled</Optimization>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <IgnoreSpecificDefaultLibraries>
+      </IgnoreSpecificDefaultLibraries>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TargetEnvironment>Win32</TargetEnvironment>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MinSpace</Optimization>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <HeaderFileName>
+      </HeaderFileName>
+    </Midl>
+    <ClCompile>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <BufferSecurityCheck>false</BufferSecurityCheck>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MinSpace</Optimization>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0409</Culture>
+    </ResourceCompile>
+    <Link>
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
+      <EntryPointSymbol>DllMain</EntryPointSymbol>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+      <AdditionalDependencies>wininet.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <GenerateDebugInformation>No</GenerateDebugInformation>
+    </Link>
+    <PostBuildEvent>
+      <Command>
+      </Command>
+    </PostBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="JSON.c" />
+    <ClCompile Include="LinkedList.c" />
+    <ClCompile Include="nsJSON.c" />
+    <ClCompile Include="pluginapi.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="JSON.h" />
+    <ClInclude Include="LinkedList.h" />
+    <ClInclude Include="nsis_tchar.h" />
+    <ClInclude Include="nsJSON.h" />
+    <ClInclude Include="pluginapi.h" />
+    <ClInclude Include="resource.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="nsJSON.rc" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 56 - 0
NSIS/Contrib/nsJSON/nsJSON.vcxproj.filters

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="JSON.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="nsJSON.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="pluginapi.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="LinkedList.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="resource.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="JSON.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="nsJSON.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="nsis_tchar.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="pluginapi.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="LinkedList.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ResourceCompile Include="nsJSON.rc">
+      <Filter>Resource Files</Filter>
+    </ResourceCompile>
+  </ItemGroup>
+</Project>

+ 229 - 0
NSIS/Contrib/nsJSON/nsis_tchar.h

@@ -0,0 +1,229 @@
+/*
+ * nsis_tchar.h
+ * 
+ * This file is a part of NSIS.
+ * 
+ * Copyright (C) 1999-2013 Nullsoft and Contributors
+ * 
+ * This software is provided 'as-is', without any express or implied
+ * warranty.
+ *
+ * For Unicode support by Jim Park -- 08/30/2007
+ */
+
+// Jim Park: Only those we use are listed here.
+
+#pragma once
+
+#ifdef _UNICODE
+
+#ifndef _T
+#define __T(x)   L ## x
+#define _T(x)    __T(x)
+#define _TEXT(x) __T(x)
+#endif
+
+#ifndef _TCHAR_DEFINED
+#define _TCHAR_DEFINED
+#if !defined(_NATIVE_WCHAR_T_DEFINED) && !defined(_WCHAR_T_DEFINED)
+typedef unsigned short TCHAR;
+#else
+typedef wchar_t TCHAR;
+#endif
+#endif
+
+
+// program
+#define _tenviron   _wenviron
+#define __targv     __wargv
+
+// printfs
+#define _ftprintf   fwprintf
+#define _sntprintf  _snwprintf
+#if (defined(_MSC_VER) && (_MSC_VER<=1310)) || defined(__MINGW32__)
+#	define _stprintf   swprintf
+#else
+#	define _stprintf   _swprintf
+#endif
+#define _tprintf    wprintf
+#define _vftprintf  vfwprintf
+#define _vsntprintf _vsnwprintf
+#if defined(_MSC_VER) && (_MSC_VER<=1310)
+#	define _vstprintf  vswprintf
+#else
+#	define _vstprintf  _vswprintf
+#endif
+
+// scanfs
+#define _tscanf     wscanf
+#define _stscanf    swscanf
+
+// string manipulations
+#define _tcscat     wcscat
+#define _tcschr     wcschr
+#define _tcsclen    wcslen
+#define _tcscpy     wcscpy
+#define _tcsdup     _wcsdup
+#define _tcslen     wcslen
+#define _tcsnccpy   wcsncpy
+#define _tcsncpy    wcsncpy
+#define _tcsrchr    wcsrchr
+#define _tcsstr     wcsstr
+#define _tcstok     wcstok
+
+// string comparisons
+#define _tcscmp     wcscmp
+#define _tcsicmp    _wcsicmp
+#define _tcsncicmp  _wcsnicmp
+#define _tcsncmp    wcsncmp
+#define _tcsnicmp   _wcsnicmp
+
+// upper / lower
+#define _tcslwr     _wcslwr
+#define _tcsupr     _wcsupr
+#define _totlower   towlower
+#define _totupper   towupper
+
+// conversions to numbers
+#define _tcstoi64   _wcstoi64
+#define _tcstol     wcstol
+#define _tcstoul    wcstoul
+#define _tstof      _wtof
+#define _tstoi      _wtoi
+#define _tstoi64    _wtoi64
+#define _ttoi       _wtoi
+#define _ttoi64     _wtoi64
+#define _ttol       _wtol
+
+// conversion from numbers to strings
+#define _itot       _itow
+#define _ltot       _ltow
+#define _i64tot     _i64tow
+#define _ui64tot    _ui64tow
+
+// file manipulations
+#define _tfopen     _wfopen
+#define _topen      _wopen
+#define _tremove    _wremove
+#define _tunlink    _wunlink
+
+// reading and writing to i/o
+#define _fgettc     fgetwc
+#define _fgetts     fgetws
+#define _fputts     fputws
+#define _gettchar   getwchar
+
+// directory
+#define _tchdir     _wchdir
+
+// environment
+#define _tgetenv    _wgetenv
+#define _tsystem    _wsystem
+
+// time
+#define _tcsftime   wcsftime
+
+#else // ANSI
+
+#ifndef _T
+#define _T(x)    x
+#define _TEXT(x) x
+#endif
+
+#ifndef _TCHAR_DEFINED
+#define _TCHAR_DEFINED
+typedef char TCHAR;
+#endif
+
+// program
+#define _tenviron   environ
+#define __targv     __argv
+
+// printfs
+#define _ftprintf   fprintf
+#define _sntprintf  _snprintf
+#define _stprintf   sprintf
+#define _tprintf    printf
+#define _vftprintf  vfprintf
+#define _vsntprintf _vsnprintf
+#define _vstprintf  vsprintf
+
+// scanfs
+#define _tscanf     scanf
+#define _stscanf    sscanf
+
+// string manipulations
+#define _tcscat     strcat
+#define _tcschr     strchr
+#define _tcsclen    strlen
+#define _tcscnlen   strnlen
+#define _tcscpy     strcpy
+#define _tcsdup     _strdup
+#define _tcslen     strlen
+#define _tcsnccpy   strncpy
+#define _tcsrchr    strrchr
+#define _tcsstr     strstr
+#define _tcstok     strtok
+
+// string comparisons
+#define _tcscmp     strcmp
+#define _tcsicmp    _stricmp
+#define _tcsncmp    strncmp
+#define _tcsncicmp  _strnicmp
+#define _tcsnicmp   _strnicmp
+
+// upper / lower
+#define _tcslwr     _strlwr
+#define _tcsupr     _strupr
+
+#define _totupper   toupper
+#define _totlower   tolower
+
+// conversions to numbers
+#define _tcstol     strtol
+#define _tcstoul    strtoul
+#define _tstof      atof
+#define _tstoi      atoi
+#define _tstoi64    _atoi64
+#define _tstoi64    _atoi64
+#define _ttoi       atoi
+#define _ttoi64     _atoi64
+#define _ttol       atol
+
+// conversion from numbers to strings
+#define _i64tot     _i64toa
+#define _itot       _itoa
+#define _ltot       _ltoa
+#define _ui64tot    _ui64toa
+
+// file manipulations
+#define _tfopen     fopen
+#define _topen      _open
+#define _tremove    remove
+#define _tunlink    _unlink
+
+// reading and writing to i/o
+#define _fgettc     fgetc
+#define _fgetts     fgets
+#define _fputts     fputs
+#define _gettchar   getchar
+
+// directory
+#define _tchdir     _chdir
+
+// environment
+#define _tgetenv    getenv
+#define _tsystem    system
+
+// time
+#define _tcsftime   strftime
+
+#endif
+
+// is functions (the same in Unicode / ANSI)
+#define _istgraph   isgraph
+#define _istascii   __isascii
+
+#define __TFILE__ _T(__FILE__)
+#define __TDATE__ _T(__DATE__)
+#define __TTIME__ _T(__TIME__)

+ 294 - 0
NSIS/Contrib/nsJSON/pluginapi.c

@@ -0,0 +1,294 @@
+#include <windows.h>
+
+#include "pluginapi.h"
+
+#ifdef _countof
+#define COUNTOF _countof
+#else
+#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))
+#endif
+
+unsigned int g_stringsize;
+stack_t **g_stacktop;
+TCHAR *g_variables;
+
+// utility functions (not required but often useful)
+
+int NSISCALL popstring(TCHAR *str)
+{
+  stack_t *th;
+  if (!g_stacktop || !*g_stacktop) return 1;
+  th=(*g_stacktop);
+  if (str) lstrcpy(str,th->text);
+  *g_stacktop = th->next;
+  GlobalFree((HGLOBAL)th);
+  return 0;
+}
+
+int NSISCALL popstringn(TCHAR *str, int maxlen)
+{
+  stack_t *th;
+  if (!g_stacktop || !*g_stacktop) return 1;
+  th=(*g_stacktop);
+  if (str) lstrcpyn(str,th->text,maxlen?maxlen:g_stringsize);
+  *g_stacktop = th->next;
+  GlobalFree((HGLOBAL)th);
+  return 0;
+}
+
+void NSISCALL pushstring(const TCHAR *str)
+{
+  stack_t *th;
+  if (!g_stacktop) return;
+  th=(stack_t*)GlobalAlloc(GPTR,(sizeof(stack_t)+(g_stringsize)*sizeof(TCHAR)));
+  lstrcpyn(th->text,str,g_stringsize);
+  th->next=*g_stacktop;
+  *g_stacktop=th;
+}
+
+TCHAR* NSISCALL getuservariable(const int varnum)
+{
+  if (varnum < 0 || varnum >= __INST_LAST) return NULL;
+  return g_variables+varnum*g_stringsize;
+}
+
+void NSISCALL setuservariable(const int varnum, const TCHAR *var)
+{
+	if (var != NULL && varnum >= 0 && varnum < __INST_LAST) 
+		lstrcpy(g_variables + varnum*g_stringsize, var);
+}
+
+#ifdef _UNICODE
+int NSISCALL PopStringA(char* ansiStr)
+{
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));
+   int rval = popstring(wideStr);
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
+   GlobalFree((HGLOBAL)wideStr);
+   return rval;
+}
+
+int NSISCALL PopStringNA(char* ansiStr, int maxlen)
+{
+   int realLen = maxlen ? maxlen : g_stringsize;
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, realLen*sizeof(wchar_t));
+   int rval = popstringn(wideStr, realLen);
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, realLen, NULL, NULL);
+   GlobalFree((HGLOBAL)wideStr);
+   return rval;
+}
+
+void NSISCALL PushStringA(const char* ansiStr)
+{
+   wchar_t* wideStr = (wchar_t*) GlobalAlloc(GPTR, g_stringsize*sizeof(wchar_t));
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
+   pushstring(wideStr);
+   GlobalFree((HGLOBAL)wideStr);
+   return;
+}
+
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)
+{
+   lstrcpyW(wideStr, getuservariable(varnum));
+}
+
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr)
+{
+   wchar_t* wideStr = getuservariable(varnum);
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
+}
+
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr)
+{
+   if (ansiStr != NULL && varnum >= 0 && varnum < __INST_LAST)
+   {
+      wchar_t* wideStr = g_variables + varnum * g_stringsize;
+      MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
+   }
+}
+
+#else
+// ANSI defs
+int NSISCALL PopStringW(wchar_t* wideStr)
+{
+   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);
+   int rval = popstring(ansiStr);
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
+   GlobalFree((HGLOBAL)ansiStr);
+   return rval;
+}
+
+int NSISCALL PopStringNW(wchar_t* wideStr, int maxlen)
+{
+   int realLen = maxlen ? maxlen : g_stringsize;
+   char* ansiStr = (char*) GlobalAlloc(GPTR, realLen);
+   int rval = popstringn(ansiStr, realLen);
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, realLen);
+   GlobalFree((HGLOBAL)ansiStr);
+   return rval;
+}
+
+void NSISCALL PushStringW(wchar_t* wideStr)
+{
+   char* ansiStr = (char*) GlobalAlloc(GPTR, g_stringsize);
+   WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
+   pushstring(ansiStr);
+   GlobalFree((HGLOBAL)ansiStr);
+}
+
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr)
+{
+   char* ansiStr = getuservariable(varnum);
+   MultiByteToWideChar(CP_ACP, 0, ansiStr, -1, wideStr, g_stringsize);
+}
+
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr)
+{
+   lstrcpyA(ansiStr, getuservariable(varnum));
+}
+
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr)
+{
+   if (wideStr != NULL && varnum >= 0 && varnum < __INST_LAST)
+   {
+      char* ansiStr = g_variables + varnum * g_stringsize;
+      WideCharToMultiByte(CP_ACP, 0, wideStr, -1, ansiStr, g_stringsize, NULL, NULL);
+   }
+}
+#endif
+
+// playing with integers
+
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s)
+{
+  INT_PTR v=0;
+  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))
+  {
+    s++;
+    for (;;)
+    {
+      int c=*(++s);
+      if (c >= _T('0') && c <= _T('9')) c-=_T('0');
+      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;
+      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;
+      else break;
+      v<<=4;
+      v+=c;
+    }
+  }
+  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))
+  {
+    for (;;)
+    {
+      int c=*(++s);
+      if (c >= _T('0') && c <= _T('7')) c-=_T('0');
+      else break;
+      v<<=3;
+      v+=c;
+    }
+  }
+  else
+  {
+    int sign=0;
+    if (*s == _T('-')) sign++; else s--;
+    for (;;)
+    {
+      int c=*(++s) - _T('0');
+      if (c < 0 || c > 9) break;
+      v*=10;
+      v+=c;
+    }
+    if (sign) v = -v;
+  }
+
+  return v;
+}
+
+unsigned int NSISCALL myatou(const TCHAR *s)
+{
+  unsigned int v=0;
+
+  for (;;)
+  {
+    unsigned int c=*s++;
+    if (c >= _T('0') && c <= _T('9')) c-=_T('0');
+    else break;
+    v*=10;
+    v+=c;
+  }
+  return v;
+}
+
+int NSISCALL myatoi_or(const TCHAR *s)
+{
+  int v=0;
+  if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X')))
+  {
+    s++;
+    for (;;)
+    {
+      int c=*(++s);
+      if (c >= _T('0') && c <= _T('9')) c-=_T('0');
+      else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;
+      else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;
+      else break;
+      v<<=4;
+      v+=c;
+    }
+  }
+  else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0'))
+  {
+    for (;;)
+    {
+      int c=*(++s);
+      if (c >= _T('0') && c <= _T('7')) c-=_T('0');
+      else break;
+      v<<=3;
+      v+=c;
+    }
+  }
+  else
+  {
+    int sign=0;
+    if (*s == _T('-')) sign++; else s--;
+    for (;;)
+    {
+      int c=*(++s) - _T('0');
+      if (c < 0 || c > 9) break;
+      v*=10;
+      v+=c;
+    }
+    if (sign) v = -v;
+  }
+
+  // Support for simple ORed expressions
+  if (*s == _T('|')) 
+  {
+      v |= myatoi_or(s+1);
+  }
+
+  return v;
+}
+
+INT_PTR NSISCALL popintptr()
+{
+  TCHAR buf[128];
+  if (popstringn(buf,COUNTOF(buf)))
+    return 0;
+  return nsishelper_str_to_ptr(buf);
+}
+
+int NSISCALL popint_or()
+{
+  TCHAR buf[128];
+  if (popstringn(buf,COUNTOF(buf)))
+    return 0;
+  return myatoi_or(buf);
+}
+
+void NSISCALL pushintptr(INT_PTR value)
+{
+	TCHAR buffer[30];
+	wsprintf(buffer, sizeof(void*) > 4 ? _T("%Id") : _T("%d"), value);
+	pushstring(buffer);
+}

+ 104 - 0
NSIS/Contrib/nsJSON/pluginapi.h

@@ -0,0 +1,104 @@
+#ifndef ___NSIS_PLUGIN__H___
+#define ___NSIS_PLUGIN__H___
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "api.h"
+#include "nsis_tchar.h"
+
+#ifndef NSISCALL
+#  define NSISCALL __stdcall
+#endif
+
+#define EXDLL_INIT()           {  \
+        g_stringsize=string_size; \
+        g_stacktop=stacktop;      \
+        g_variables=variables; }
+
+typedef struct _stack_t {
+  struct _stack_t *next;
+  TCHAR text[1]; // this should be the length of string_size
+} stack_t;
+
+enum
+{
+INST_0,         // $0
+INST_1,         // $1
+INST_2,         // $2
+INST_3,         // $3
+INST_4,         // $4
+INST_5,         // $5
+INST_6,         // $6
+INST_7,         // $7
+INST_8,         // $8
+INST_9,         // $9
+INST_R0,        // $R0
+INST_R1,        // $R1
+INST_R2,        // $R2
+INST_R3,        // $R3
+INST_R4,        // $R4
+INST_R5,        // $R5
+INST_R6,        // $R6
+INST_R7,        // $R7
+INST_R8,        // $R8
+INST_R9,        // $R9
+INST_CMDLINE,   // $CMDLINE
+INST_INSTDIR,   // $INSTDIR
+INST_OUTDIR,    // $OUTDIR
+INST_EXEDIR,    // $EXEDIR
+INST_LANG,      // $LANGUAGE
+__INST_LAST
+};
+
+extern unsigned int g_stringsize;
+extern stack_t **g_stacktop;
+extern TCHAR *g_variables;
+
+void NSISCALL pushstring(const TCHAR *str);
+void NSISCALL pushintptr(INT_PTR value);
+#define pushint(v) pushintptr((INT_PTR)(v))
+int NSISCALL popstring(TCHAR *str); // 0 on success, 1 on empty stack
+int NSISCALL popstringn(TCHAR *str, int maxlen); // with length limit, pass 0 for g_stringsize
+INT_PTR NSISCALL popintptr();
+#define popint() ( (int) popintptr() )
+int NSISCALL popint_or(); // with support for or'ing (2|4|8)
+INT_PTR NSISCALL nsishelper_str_to_ptr(const TCHAR *s);
+#define myatoi(s) ( (int) nsishelper_str_to_ptr(s) ) // converts a string to an integer
+unsigned int NSISCALL myatou(const TCHAR *s); // converts a string to an unsigned integer, decimal only
+int NSISCALL myatoi_or(const TCHAR *s); // with support for or'ing (2|4|8)
+TCHAR* NSISCALL getuservariable(const int varnum);
+void NSISCALL setuservariable(const int varnum, const TCHAR *var);
+
+#ifdef _UNICODE
+#define PopStringW(x) popstring(x)
+#define PushStringW(x) pushstring(x)
+#define SetUserVariableW(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringA(char* ansiStr);
+void NSISCALL PushStringA(const char* ansiStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableA(const int varnum, const char* ansiStr);
+
+#else
+// ANSI defs
+
+#define PopStringA(x) popstring(x)
+#define PushStringA(x) pushstring(x)
+#define SetUserVariableA(x,y) setuservariable(x,y)
+
+int  NSISCALL PopStringW(wchar_t* wideStr);
+void NSISCALL PushStringW(wchar_t* wideStr);
+void NSISCALL GetUserVariableW(const int varnum, wchar_t* wideStr);
+void NSISCALL GetUserVariableA(const int varnum, char* ansiStr);
+void NSISCALL SetUserVariableW(const int varnum, const wchar_t* wideStr);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif//!___NSIS_PLUGIN__H___

BIN
NSIS/Contrib/nsJSON/resource.h


+ 18 - 0
NSIS/Docs/EnVar/license.txt

@@ -0,0 +1,18 @@
+EnVar plugin for NSIS
+
+Coded by Jason Ross aka JasonFriday13 on the forums.
+
+Copyright (C) 2014-2016, 2018, 2020-2021 MouseHelmet Software
+
+
+EULA - End User License Agreement
+
+This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. 
+
+Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source distribution.

+ 70 - 0
NSIS/Docs/EnVar/readme.txt

@@ -0,0 +1,70 @@
+EnVar plugin for NSIS
+
+Coded by Jason Ross aka JasonFriday13 on the forums.
+
+Copyright (C) 2014-2016, 2018, 2020-2021 MouseHelmet Software
+
+
+Introduction
+------------
+
+This plugin manages environment variables. It allows checking for environment
+variables, checking for paths in those variables, adding paths to variables,
+removing paths from variables, removing variables from the environment, and
+updating the installer enviroment from the registry. This plugin is provided
+with 32bit ansi and unicode versions, as well as a 64bit unicode version.
+
+Functions
+---------
+
+There are eight functions in this plugin. Returns an error code on the 
+stack (unless noted otherwise), see below for the codes.
+
+ERR_SUCCESS     0   Function completed successfully.
+ERR_NOMEMALLOC  1   Function can't allocate memory required.
+ERR_NOREAD      2   Function couldn't read from the environment.
+ERR_NOVARIABLE  3   Variable doesn't exist in the current environment.
+ERR_NOTYPE      4   Variable exists but is the wrong type.
+ERR_NOVALUE     5   Value doesn't exist in the Variable.
+ERR_NOWRITE     6   Function can't write to the current environment.
+
+EnVar::SetHKCU
+EnVar::SetHKLM
+
+  SetHKCU sets the environment access to the current user. This is the default.
+  SetHKLM sets the environment access to the local machine.
+  These functions do not return a value on the stack.
+
+EnVar::Check         VariableName Path
+
+  Checks for a Path in the specified VariableName. Passing "null" as a Path makes
+  it check for the existance of VariableName. Passing "null" for both makes it
+  check for write access to the current environment.
+
+EnVar::AddValue      VariableName Path
+EnVar::AddValueEx    VariableName Path
+
+  Adds a Path to the specified VariableName. AddValueEx is for expandable paths,
+  ie %tempdir%. Both functions respect expandable variables, so if the variable
+  already exists, they try to leave it intact. AddValueEx converts the variable to
+  its expandable version. If the path already exists, it returns a success error code.
+
+EnVar::DeleteValue   VariableName Path
+
+  Deletes a path from a variable. The delete is also recursive, so if it finds multiple
+  paths, all of them are deleted as well.
+
+EnVar::Delete        VariableName
+
+  Deletes a variable from the environment. Note that "path" cannot be deleted.
+
+EnVar::Update        RegRoot VariableName
+
+  Updates the installer environment by reading VariableName from the registry
+  and can use RegRoot to specify from which root it reads from: HKCU for the
+  current user, and HKLM for the local machine. Passing "null" for RegRoot
+  causes VariableName to be removed from the installer environment. Anything
+  else (including an empty string) for RegRoot means it reads from both roots,
+  appends the paths together, and updates the installer environment. This
+  function is not affected by EnVar::SetHKCU and EnVar::SetHKLM, and does not
+  write to the registry.

+ 564 - 0
NSIS/Docs/nsJSON/Readme.txt

@@ -0,0 +1,564 @@
+nsJSON NSIS plug-in
+
+Author:  Stuart 'Afrow UK' Welch
+Date:    21st November 2017
+Version: 1.1.1.0
+
+A JSON (JavaScript Object Notation) parser, manipulator and generator
+plug-in for NSIS.
+
+See Examples\nsJSON\*.
+
+------------------------------------------------------------------------
+About JSON
+------------------------------------------------------------------------
+
+  See http://www.json.org/ for information about JSON along with the
+  syntax and string escape sequences.
+
+------------------------------------------------------------------------
+Important information
+------------------------------------------------------------------------
+
+  All plug-in functions set the NSIS error flag on error. For functions
+  that return a value on the stack, no item will be returned if the
+  error flag has been set. You can use IfErrors or ${If} ${Errors} to
+  check that a call has succeeded before Pop-ping a value, if any.
+
+  The plug-in supports all escape sequences in string values:
+  \r, \n, \t, \b, \f, \", \\ and \uXXXX
+
+  [NodePath], used throughout this readme, is any space-delimited list
+  of mixed node keys and indices (prefixed with /index). For example:
+
+  {
+    "node1": {
+      "node2": false,
+      "node3": [ "Stuart", 1, { "node4": "Welch", "node5": "" }, 32.5, [ 0, "test", false ] ]
+    }
+  }
+
+  This is a JSON snippet. "node2" is a child node of "node1". "node2"
+  has a Boolean value of false. "node3" is an array (denoted by square
+  brackets). The 3rd element within the array is another node. The 5th
+  element within the array is another array.
+
+  These are examples of node paths within the JSON snippet:
+
+  "node1" "node2"
+  -> The path for "node2" (value: false)
+  -> nsJSON::Get "node1" "node2" /end
+
+  "node1" "node3" /index 0
+  -> The path for the first array element in "node3" (value: "Stuart")
+  -> nsJSON::Get "node1" "node3" /index 0 /end
+
+  "node1" "node3" /index 2 "node4"
+  -> The path for "node4" (value: "Welch")
+  -> nsJSON::Get "node1" "node3" /index 3 "node4" /end
+
+  /index 0 "node3" /index 2 /index 0
+  -> Also the path for "node4" (value: "Welch")
+  -> nsJSON::Get /index 0 /index 1 /index 3 /index 0 /end
+
+  "node1" "node3" /index 4 /index -2
+  -> The path for value "test" in the array; note the negative index
+  -> nsJSON::Get "node1" "node3" /index 4 /index -2 /end
+
+  Node names containing double quotes are automatically escaped. If no
+  node path is given, the root node is used.
+
+  Multiple JSON trees can be manipulated at the same time. Add
+  /tree Tree (where Tree is the tree name) before all other plug-in
+  arguments to specify which JSON tree you are manipulating.
+
+------------------------------------------------------------------------
+Reading JSON files
+------------------------------------------------------------------------
+
+  nsJSON::Set [/tree Tree] [NodePath] /file [/unicode] "path\to\input.json"
+
+  Loads the JSON from the given file into the given node. Specify
+  /unicode if the input file is Unicode.
+
+------------------------------------------------------------------------
+
+  nsJSON::Set [/tree Tree] /file [/unicode] "path\to\input.json"
+
+  Loads the JSON from the given file into memory, overwriting any
+  existing JSON tree. Specify /unicode if the input file is Unicode.
+
+------------------------------------------------------------------------
+JSON from HTTP web requests
+------------------------------------------------------------------------
+
+  nsJSON::Set [/tree Tree] [NodePath] /http ConfigTree
+
+  Executes an HTTP web request and loads the JSON response into the
+  given node. The ConfigTree JSON tree specifies the web request
+  configuration to execute, described using JSON. Its possible values
+  are as follows...
+
+  "Url": "http://..."
+  - The web request URL. This is required.
+
+  "Verb": "GET"
+  - The request verb, such as GET or POST. Default is GET.
+
+  "Params": "..."
+  - Optional parameters to append to the URL (after ?).
+
+  "ParamsType": "..."
+  - The parameters type. Possible values are...
+
+    Empty string/omitted (default)
+    - Parameters are given as JSON and will be sent as a standard
+      key/value pair string. Special characters will be URL-encoded
+      automatically. Arrays will be serialized as multiple keys of the
+      same name with a [] suffix.
+
+      For example {"a": "Value1", "b": true, "c": "Value3"} becomes
+      a=Value1&b&c=Value3, and {"Array": [1, 2]} becomes
+      Array[]=1&Array[]=2.
+
+    "Raw"
+    - Raw parameters are given as a string.
+
+  "Data": "..."
+  - Optional request data to send (typically used with POST).
+
+  "DataType": "..."
+  - The request data type. Possible values are...
+
+    Empty string/omitted (default)
+    - Data is given as JSON and will be sent as a standard POST
+      key/value pair string. Special characters will be URL-encoded
+      automatically. Arrays will be serialized as multiple keys of the
+      same name with a [] suffix.
+
+      For example {"a": "Value1", "b": true, "c": "Value3"} becomes
+      a=Value1&b&c=Value3, and {"Array": [1, 2]} becomes
+      Array[]=1&Array[]=2.
+
+    "JSON"
+    - POST data is JSON and will be sent as-is (serialized JSON).
+
+    "Raw"
+    - Raw POST data is given as a string.
+
+  "DataEncoding": "..."
+  - Specifies the encoding to use for the POST data. Possible values
+    are...
+
+    Empty string/omitted (default)
+    - Data is encoded as 1 byte per character.
+
+    "Unicode"
+    - Data is encoded as 2 bytes per character.
+
+  "Headers": "..."
+  - Additional headers to send, which will override these defaults...
+    * "Content-Type: application/x-www-form-urlencoded" is sent if "Verb"
+      is "POST" and "DataType" is "Raw".
+    * "Content-Type: application/json" is sent if "Verb" is "POST" and
+      "DataType" is "JSON".
+    * "Accept-Encoding: gzip,deflate" is sent if "Decoding" is set to
+      true.
+
+    Specify headers as JSON, for example:
+    {"Content-Type": "text/plain", "a": "b"}
+
+
+  "Agent": "nsJSON NSIS plug-in/1.0.x.x"
+  - The request agent string. Default is shown.
+
+  "Decoding": false
+  - Enables automatic GZIP decompression by sending the
+    "Accept-Encoding: gzip,deflate" request header. If the server responds
+    with a valid "Content-Encoding" header, the compressed data will be
+    decompressed automatically.
+
+  "AccessType": "..."
+  - The connection access type. Possible values are...
+
+    Empty string/omitted (default)
+    - Direct access (bypasses any proxy).
+
+    "PreConfig"
+    - Use the internet configuration defined in the Windows registry.
+
+    "Proxy"
+    - Use defined proxy configuration (see below).
+
+  "Proxy": { "Server": "...", "Bypass": "...", Username": "...", "Password": "..." }
+  - Specifies the proxy configuration. The "Bypass" value is optional.
+
+  "Username": "..."
+  - Username for HTTP authentication.
+
+  "Password": "..."
+  - Password for HTTP authentication.
+
+  "ConnectTimeout": "..."
+  - The initial connection timeout. A value of 0XFFFFFFFF will
+    disable the timeout.
+
+  "SendTimeout": N
+  - The request send timeout.
+
+  "ReceiveTimeout": N
+  - The response receive timeout.
+
+  "UnicodeOutput": true
+  - The response must be read as Unicode rather than ASCII.
+
+  "RawOutput": true
+  - The response must be read as raw text rather than JSON.
+
+  "Async": true
+  - Perform the request asynchronously. You must use the Wait function
+    to wait or check if the request has finished.
+
+  "UIAsync": true
+  - For performing the request in a page callback function. This will
+    ensure window messages are processed so that the UI does not become
+    unresponsive.
+
+  After the request has finished, the node specified by NodePath will
+  contain the following values:
+
+  "Output": ...
+  - The HTTP response as JSON.
+
+  "StatusCode": N
+  - The HTTP status code.
+
+  "ErrorCode": N
+  - The WinINet/Win32 error code on error.
+
+  "ErrorMessage": "..."
+  - The WinINet/Win32 error message on error.
+
+------------------------------------------------------------------------
+JSON from console application execution
+------------------------------------------------------------------------
+
+  nsJSON::Set [/tree Tree] [NodePath] /exec ConfigTree
+
+  Executes a console application and loads the output into the given
+  node. The ConfigTree JSON tree specifies the console application to
+  execute, described using JSON. Its possible values are as follows...
+
+  "Path": "$INSTDIR\ConsoleApp.exe"
+  - The path to the executable to be executed. This is required.
+
+  "Arguments": ...
+  - The command line arguments. The value can be a string or an array of
+    strings.
+
+  "WorkingDir": "..."
+  - The working/current directory. If not specified, the installer's
+    working directory will be used, which is $OUTDIR.
+
+  "Input": ...
+  - The input to write to STDIN. The value can be a string or an array
+    of strings.
+
+  "UnicodeInput": true
+  - The standard input must be written as Unicode rather than ASCII.
+
+  "UnicodeOutput": true
+  - The standard output must be read as Unicode rather than ASCII.
+
+  "RawOutput": true
+  - The standard output must be read as raw text rather than JSON.
+
+  "Async": true
+  - Execute asynchronously. You must use the Wait function to wait or
+    check if the process has finished.
+
+  "UIAsync": true
+  - For performing the execution in a page callback function. This will
+    ensure window messages are processed so that the UI does not become
+    unresponsive.
+
+  After execution has finished, the node specified by NodePath will
+  contain the following values:
+
+  "Output": ...
+  - The output of the console application, depending on the
+    RawOutput setting.
+
+  "ExitCode": X
+  - The process exit code.
+
+------------------------------------------------------------------------
+Modifying JSON
+------------------------------------------------------------------------
+
+  nsJSON::Set [/tree Tree] [NodePath] /value "Value"
+
+  Sets the value of the given node. The value can be any single value or
+  it can be JSON code. The node will be created if it does not exist.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Delete [/tree Tree] [NodePath] /end
+
+  Deletes the given tree or node. /end must be added to the end of the
+  list to prevent stack corruption.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Quote [/unicode] [/always] Value
+  Pop $Var
+
+  Surrounds the given value with quotes if necessary and escapes any
+  characters that require it. The quoted value will be returned on the
+  stack.
+
+  Optionally specify /unicode to escape non ASCII characters as well
+  although it is perfectly legal to include Unicode characters in JSON.
+
+  Specify /always to always surround the input string in quotes even if
+  it is already quoted.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Sort [/tree Tree] [NodePath] [/options Options] /end
+
+  Sorts the given node. Add up the following values for the optional
+  sort options:
+
+    1 = Sort in descending order.
+    2 = Use numeric sort.
+    4 = Sort case sensitively.
+    8 = Sort by keys rather than by values.
+    16 = Sort all nodes in the tree recursively.
+
+------------------------------------------------------------------------
+Reading JSON values
+------------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] [/noexpand] [NodePath] /end
+  Pop $Var
+
+  Gets the value of the given node. The value returned will be JSON code
+  if the node is not a value-only node. Specify /noexpand when reading
+  quoted string values to stop escape sequences being expanded. /end
+  must be added to the end of the list to prevent stack corruption.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /type [NodePath] /end
+  Pop $Var
+
+  Gets the value-type of the given node. It can be one of "node",
+  "array", "string" (quoted strings), "value" (which is all non-string
+  values such as integers, floats and Booleans) or an empty string if
+  the node does not exist.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /key [NodePath] /end
+  Pop $Var
+
+  Gets the name (key) of the given node.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /keys [NodePath] /end
+  Pop $VarKeyCount
+  Pop $VarKey1
+  Pop $VarKey2
+  Pop $VarKeyN
+
+  Gets the keys of the given node. $VarKeyCount will be the number of
+  keys pushed onto the stack (to be removed via Pop).
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /exists [NodePath] /end
+  Pop $Var
+
+  Determines whether or not the given node exists. $Var will be "yes" or
+  "no".
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /count [NodePath] /end
+  Pop $Var
+
+  Gets the number of child nodes for the given node or the number of
+  elements if the node is an array.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Get [/tree Tree] /isempty [NodePath] /end
+  Pop $Var
+
+  Determines whether or not the given node is empty. $Var will be "yes"
+  or "no". An empty node is for example: "node": { } or "array": [ ].
+
+------------------------------------------------------------------------
+Generating JSON
+------------------------------------------------------------------------
+
+  nsJSON::Serialize [/tree Tree] [/format]
+  Pop $Var
+
+  Serializes the current JSON tree into $Var. Add /format to apply
+  formatting to the output. The error flag is set if an error occurs.
+
+  --------------------------------------------------------------------
+
+  nsJSON::Serialize [/tree Tree] [/format] /file [/unicode] "path\to\output.json"
+
+  Serializes the current JSON tree into the given file. Add /format to
+  apply formatting to the output. Add /unicode to generate a Unicode
+  output file (applies to both ANSI and Unicode NSIS).
+
+------------------------------------------------------------------------
+Waiting for asynchronous tasks to finish
+------------------------------------------------------------------------
+
+  nsJSON::Wait Tree [/timeout TimeoutInMilliseconds]
+  Pop $Var
+
+  Checks whether or not the asynchonous task that is being ran under the
+  given JSON tree has finished.
+
+  If /timeout is specified, the function will return after the
+  specified number of milliseconds; after which $Var will be "wait" if
+  the task has not finished; or an empty string otherwise.
+
+  When /timeout is omitted, the function will wait indefinitely and
+  nothing will be pushed onto the stack when the task finishes.
+
+------------------------------------------------------------------------
+Change log
+------------------------------------------------------------------------
+
+1.1.1.0 - 21st November 2017
+* Fixed JSON with syntax errors still being parsed without setting the
+  error flag.
+* Fixed Set function not replacing the root value if the value was an
+  array.
+* Fixed Delete function not deleting the root node and tree.
+
+1.1.0.9 - 9th August 2017
+* Fixed access violation and stack overflow crashes in JSON_Delete, which
+  could occur on plug-in unload, Delete function call or when overwriting
+  existing nodes with the Set function.
+* Fixed DoHttpWebRequest failing when POST data exceeded 2048 characters.
+* Fixed DoCreateProcess failing to read process output when the output
+  exceeded 1024 characters.
+* Delete function will now delete a complete node tree if no path is
+  given.
+
+1.1.0.8 - 8th January 2017
+* Added ErrorCode and ErrorMessage for HTTP requests for getting WinINet
+  or Win32 errors.
+* Added Sort function.
+
+1.1.0.7 - 7th November 2016
+* Fixed /index for adding array elements with the Set function.
+* Fixed file name being left on the stack after Serialize with /file.
+* Added access type, proxy, authentication and timeout options for HTTP
+  requests.
+* Added POST data encoding options for HTTP requests.
+* HTTP request headers can be given as raw headers or as JSON key/value
+  pairs.
+* Fixed a memory leak in JSON_SerializeAlloc and EscapePostData.
+* POST parameters given as a JSON array was not escaped using
+  EscapePostData.
+
+1.1.0.6 - 14th October 2016
+* Output and ExitCode/StatusCode are always cleared for /exec and /http
+  calls on the Set function.
+
+1.1.0.5 - 10th August 2016
+* Empty value keys ("") were not included in serialized JSON.
+* Serialize function popped one extra value from the stack.
+
+1.1.0.4 - 7th June 2016
+* Fixed incorrect flags used for HTTP requests.
+* Added support for negative indices.
+* Added console application execution for input and output.
+* Added support for asynchronous HTTP requests and console application
+  execution.
+
+1.1.0.3 - 4th March 2016
+* Fixed crash for the Delete function when specifying a tree/path that
+  does not exist.
+* Fixed Unicode build.
+* Added /keys switch to Get function.
+
+1.1.0.2 - 9th December 2015
+* Get function /type switch returns an empty string if the node does not
+  exist.
+* Added /always switch to Quote function which surrounds the input
+  string in quotes even if it is already quoted.
+
+1.1.0.1 - 23rd November 2015
+* Added Quote function.
+* Added amd64-unicode build.
+
+1.1.0.0 - 19th April 2015
+* Support for multiple JSON trees.
+* JSON via HTTP web requests.
+
+1.0.1.3 - 18th October 2014
+* Added UTF-16LE BOM, UTF-16BE BOM and UTF-8 signature detection for
+  input files (with UTF-16BE conversion to UTF-16LE).
+* Fixed formatting errors for the Serialize function.
+* Fixed closing bracket or curly brace not being included on Serialize
+  to stack when not using /format.
+* Moved plug-in DLLs to x86-ansi and x86-unicode respectively for NSIS
+  3.0.
+
+1.0.1.2 - 12th July 2014
+* Fixed crash on serialization to file for node values larger than 64KB.
+* Fixed crash on serialization to stack for JSON larger than
+  NSIS_MAX_STRLEN. The JSON will now be truncated.
+
+1.0.1.1 - 29th March 2014
+* Fixed incorrect handling of escape character (\).
+
+1.0.1.0 - 28th August 2012
+* Added /unicode switch to the Serialize function. Output files for both
+  plug-in builds are now encoded in ANSI by default.
+* Removed the Parse function in favour of Set /file [/unicode].
+* Added /type, /key, /exists, /count, /isempty to the Get function.
+* Added /index switch for referencing nodes by index.
+
+1.0.0.2 - 15th August 2012
+* Fixed Unicode build parsing and serializing.
+
+1.0.0.1 - 1st July 2012
+* Fixed parsing of single digit numbers.
+* Fixed Serialize not writing the output file when the stack isn't
+  empty.
+
+1.0.0.0 - 25th June 2012
+* First version.
+
+------------------------------------------------------------------------
+License
+------------------------------------------------------------------------
+
+This plug-in is provided 'as-is', without any express or implied
+warranty. In no event will the author be held liable for any damages
+arising from the use of this plug-in.
+
+Permission is granted to anyone to use this plug-in for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this plug-in must not be misrepresented; you must not
+   claim that you wrote the original plug-in.
+   If you use this plug-in in a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
+2. Altered versions must be plainly marked as such, and must not be
+   misrepresented as being the original plug-in.
+3. This notice may not be removed or altered from any distribution.

+ 90 - 0
NSIS/Examples/EnVar/example.nsi

@@ -0,0 +1,90 @@
+Name "EnVar Example"
+OutFile "EnVarExample.exe"
+
+RequestExecutionLevel User
+ShowInstDetails Show
+
+Page InstFiles
+
+Unicode True
+
+Section
+
+  ; Check for write access
+  EnVar::Check "NULL" "NULL"
+  Pop $0
+  DetailPrint "EnVar::Check write access HKCU returned=|$0|"
+
+  ; Set to HKLM
+  EnVar::SetHKLM
+
+  ; Check for write access
+  EnVar::Check "NULL" "NULL"
+  Pop $0
+  DetailPrint "EnVar::Check write access HKLM returned=|$0|"
+
+  ; Set back to HKCU
+  EnVar::SetHKCU
+  DetailPrint "EnVar::SetHKCU"
+
+  ; Check for a 'temp' variable
+  EnVar::Check "temp" "NULL"
+  Pop $0
+  DetailPrint "EnVar::Check returned=|$0|"
+
+  ; Add a value
+  EnVar::AddValue "ZTestVariable" "C:\Test"
+  Pop $0
+  DetailPrint "EnVar::AddValue returned=|$0|"
+
+  EnVar::AddValue "ZTestVariable" "C:\TestJas"
+  Pop $0
+  DetailPrint "EnVar::AddValue returned=|$0|"
+
+  ; Add an expanded value
+  EnVar::AddValue "ZTestVariable1" "C:\Test"
+  Pop $0
+  DetailPrint "EnVar::AddValue returned=|$0|"
+
+  EnVar::AddValueEx "ZTestVariable1" "C:\Test"
+  Pop $0
+  DetailPrint "EnVar::AddValue returned=|$0|"
+
+  EnVar::AddValueEx "ZTestVariable1" "C:\TestVariable"
+  Pop $0
+  DetailPrint "EnVar::AddValue returned=|$0|"
+
+  ; Update the installer environment so that new
+  ; paths are available to the installer
+  EnVar::Update "HKCU" "ZTestVariable"
+  Pop $0
+  DetailPrint "EnVar::Update returned=|$0|"
+
+  EnVar::Update "" "ZTestVariable1"
+  Pop $0
+  DetailPrint "EnVar::Update returned=|$0|"
+
+  ; Delete a value from a variable
+  EnVar::DeleteValue "ZTestVariable1" "C:\Test"
+  Pop $0
+  DetailPrint "EnVar::DeleteValue returned=|$0|"
+
+  EnVar::DeleteValue "ZTestVariable1" "C:\Test"
+  Pop $0
+  DetailPrint "EnVar::DeleteValue returned=|$0|"
+
+  EnVar::DeleteValue "ZTestVariable1" "C:\TestJason"
+  Pop $0
+  DetailPrint "EnVar::DeleteValue returned=|$0|"
+
+  ; Delete a variable
+  EnVar::Delete "ZTestVariable"
+  Pop $0
+  DetailPrint "EnVar::Delete returned=|$0|"
+
+  ; Try deleting "path", this should give an error
+  EnVar::Delete "path"
+  Pop $0
+  DetailPrint "EnVar::Delete returned=|$0|"
+
+SectionEnd

BIN
NSIS/Examples/nsJSON/Bin/ConsoleApp.exe


BIN
NSIS/Examples/nsJSON/Bin/ConsoleAppDotNet.exe


+ 33 - 0
NSIS/Examples/nsJSON/Bin/HttpWebRequest.php

@@ -0,0 +1,33 @@
+<?php
+
+// Dump it...
+@file_put_contents('GET.txt', print_r($_GET, true));
+
+// Data POSTed is JSON.
+if (isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json')
+{
+	if (!($input = @file_get_contents("php://input")) || ($json = @json_decode(@utf8_encode($input))) === null)
+	{
+		echo json_encode(array('Error' => 'No input given', 'SentHeaders' => getallheaders()));
+		exit;
+	}
+
+	// Dump it...
+	@file_put_contents('POST.json', $input);
+
+	// Do stuff with the POSTed JSON (read from HttpWebRequest->Data).
+	//$json->glossary->title = "nsJSON NSIS plug-in";
+}
+// Data POSTed as key value pairs.
+else
+{
+	// Dump it...
+	@file_put_contents('POST.txt', print_r($_POST, true));
+
+	//$myValue = $_POST['MyValue'];
+}
+
+// Now respond with JSON (downloaded into HttpWebResponse).
+echo json_encode(array('FirstName' => 'Stuart', 'LastName' => 'Welch', 'NickName' => 'Afrow UK', 'Email' => 'afrowuk@afrowsoft.co.uk'));
+
+?>

+ 193 - 0
NSIS/Examples/nsJSON/ConsoleExec.nsi

@@ -0,0 +1,193 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_ConsoleExec.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ComponentsPage_Leave
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+Section
+
+  CreateDirectory $EXEDIR\Output
+
+SectionEnd
+
+Section /o `Console App` NATIVE
+
+  InitPluginsDir
+  StrCpy $R0 $PLUGINSDIR\ConsoleApp.exe
+  File /oname=$R0 Bin\ConsoleApp.exe
+
+  nsJSON::Set /tree ConsoleExec /value `{ "Path": "$R0", "WorkingDir": "$PLUGINSDIR", "RawOutput": true }`
+
+  ; Provide arguments as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Arguments /value `[]`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg1"`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg2"`
+
+  ; Provide input as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Input /value `"hello"`
+
+  ; Export the tree to file for debugging.
+  DetailPrint `Generate: $EXEDIR\Output\ConsoleExecInput.json from ConsoleExec`
+  nsJSON::Serialize /tree ConsoleExec /format /file $EXEDIR\Output\ConsoleExecInput.json
+
+  ; Execute the console application.
+  DetailPrint `Exec: $R0`
+  nsJSON::Set /tree ConsoleExecOutput /exec ConsoleExec
+
+  ; Save the output to file.
+  DetailPrint `Generate: $EXEDIR\Output\ConsoleExecOutput.json from ConsoleExecOutput`
+  nsJSON::Serialize /tree ConsoleExecOutput /format /file $EXEDIR\Output\ConsoleExecOutput.json
+
+SectionEnd
+
+Section /o `Async Console App` NATIVEASYNC
+
+  InitPluginsDir
+  StrCpy $R0 $PLUGINSDIR\ConsoleApp.exe
+  File /oname=$R0 Bin\ConsoleApp.exe
+
+  nsJSON::Set /tree ConsoleExec /value `{ "Async": true, "Path": "$R0", "WorkingDir": "$PLUGINSDIR", "RawOutput": true }`
+
+  ; Provide arguments as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Arguments /value `[]`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg1"`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg2"`
+
+  ; Provide input as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Input /value `"hello"`
+
+  ; Export the tree to file for debugging.
+  DetailPrint `Generate: $EXEDIR\Output\AsyncConsoleExecInput.json from ConsoleExec`
+  nsJSON::Serialize /tree ConsoleExec /format /file $EXEDIR\Output\AsyncConsoleExecInput.json
+
+  ; Execute the console application.
+  DetailPrint `Exec: $R0`
+  nsJSON::Set /tree AsyncConsoleExecOutput /exec ConsoleExec
+
+  ; Wait until done.
+  ${Do}
+    Sleep 1000
+    nsJSON::Wait ConsoleExec /timeout 0
+    Pop $R0
+    ${If} $R0 != wait
+      ${Break}
+    ${EndIf}
+    DetailPrint `Waiting...`
+  ${Loop}
+
+  DetailPrint `Finished...`
+
+  ; Save the output to file.
+  DetailPrint `Generate: $EXEDIR\Output\AsyncConsoleExecOutput.json from AsyncConsoleExecOutput`
+  nsJSON::Serialize /tree AsyncConsoleExecOutput /format /file $EXEDIR\Output\AsyncConsoleExecOutput.json
+
+SectionEnd
+
+Section /o `.NET Console App` DOTNET
+
+  InitPluginsDir
+  StrCpy $R0 $PLUGINSDIR\ConsoleAppDotNet.exe
+  File /oname=$R0 Bin\ConsoleAppDotNet.exe
+
+  nsJSON::Set /tree ConsoleExec /value `{ "Path": "$R0", "WorkingDir": "$PLUGINSDIR" }`
+
+  ; Provide arguments as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Arguments /value `[]`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg1"`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg2"`
+
+  ; Provide input as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Input /value `"hello"`
+
+  ; Export the tree to file for debugging.
+  DetailPrint `Generate: $EXEDIR\Output\ConsoleExecDotNetInput.json from ConsoleExec`
+  nsJSON::Serialize /tree ConsoleExec /format /file $EXEDIR\Output\ConsoleExecDotNetInput.json
+
+  ; Execute the console application.
+  DetailPrint `Exec: $R0`
+  nsJSON::Set /tree ConsoleExecOutput /exec ConsoleExec
+
+  ; Save the output to file.
+  DetailPrint `Generate: $EXEDIR\Output\ConsoleExecDotNetOutput.json from ConsoleExecOutput`
+  nsJSON::Serialize /tree ConsoleExecOutput /format /file $EXEDIR\Output\ConsoleExecDotNetOutput.json
+
+SectionEnd
+
+Section /o `UI Thread Console App` UINATIVE
+
+SectionEnd
+
+Function ComponentsPage_Leave
+
+  ${IfNot} ${SectionIsSelected} ${UINATIVE}
+    Return
+  ${EndIf}
+
+  GetDlgItem $R0 $HWNDPARENT 1
+  EnableWindow $R0 0
+  GetDlgItem $R0 $HWNDPARENT 2
+  EnableWindow $R0 0
+  GetDlgItem $R0 $HWNDPARENT 3
+  EnableWindow $R0 0
+  FindWindow $R0 `#32770` `` $HWNDPARENT
+  GetDlgItem $R0 $R0 1032
+  EnableWindow $R0 0
+
+  Banner::Show /set 76 `Executing ConsoleApp.exe` `Please wait...`
+
+  InitPluginsDir
+  StrCpy $R0 $PLUGINSDIR\ConsoleApp.exe
+  File /oname=$R0 Bin\ConsoleApp.exe
+
+  nsJSON::Set /tree ConsoleExec /value `{ "UIAsync": true, "Path": "$R0", "WorkingDir": "$PLUGINSDIR", "RawOutput": true }`
+
+  ; Provide arguments as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Arguments /value `[]`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg1"`
+  nsJSON::Set /tree ConsoleExec Arguments /value `"arg2"`
+
+  ; Provide input as a single string or an array.
+  nsJSON::Set /tree ConsoleExec Input /value `"hello"`
+
+  ; Export the tree to file for debugging.
+  nsJSON::Serialize /tree ConsoleExec /format /file $EXEDIR\Output\UIConsoleExecInput.json
+
+  ; Execute the console application.
+  nsJSON::Set /tree UIConsoleExecOutput /exec ConsoleExec
+
+  ; Save the output to file.
+  nsJSON::Serialize /tree UIConsoleExecOutput /format /file $EXEDIR\Output\UIConsoleExecOutput.json
+
+  Banner::Destroy
+
+  GetDlgItem $R0 $HWNDPARENT 1
+  EnableWindow $R0 1
+  GetDlgItem $R0 $HWNDPARENT 2
+  EnableWindow $R0 1
+  GetDlgItem $R0 $HWNDPARENT 3
+  EnableWindow $R0 1
+  FindWindow $R0 `#32770` `` $HWNDPARENT
+  GetDlgItem $R0 $R0 1032
+  EnableWindow $R0 1
+
+FunctionEnd
+
+LangString NATIVEDesc ${LANG_ENGLISH} `Executes native console app with STDIN data and reads JSON from STDOUT`
+LangString NATIVEASYNCDesc ${LANG_ENGLISH} `Executes native console app asynchronously with STDIN data and reads JSON from STDOUT`
+LangString DOTNETDesc ${LANG_ENGLISH} `Executes .NET console app with STDIN data and reads JSON from STDOUT`
+LangString UINATIVEDesc ${LANG_ENGLISH} `Executes native console app asynchronously while processing window messages`
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${NATIVE} $(NATIVEDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${NATIVEASYNC} $(NATIVEASYNCDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${DOTNET} $(DOTNETDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${UINATIVE} $(UINATIVEDesc)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END

+ 509 - 0
NSIS/Examples/nsJSON/Example.nsi

@@ -0,0 +1,509 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_Example.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+Section
+
+  CreateDirectory $EXEDIR\Output
+
+SectionEnd
+
+Section /o `Parse Example1.json` EXAMPLE1
+
+  ; Input: Example1.json; output: Example1.json.
+  nsJSON::Set /file $EXEDIR\Input\Example1.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example1.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1.json`
+
+SectionEnd
+
+Section /o `Convert Example1_Unicode.json (no BOM)` EXAMPLE1B
+
+  ; Use the /unicode switch if the input file is Unicode.
+  nsJSON::Set /file /unicode $EXEDIR\Input\Example1_Unicode.json
+
+  ; Generate an ANSII output file.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example1B_ASCII.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1B_ASCII.json`
+
+  ; Generate a Unicode output file.
+  nsJSON::Serialize /format /file /unicode $EXEDIR\Output\Example1B_Unicode.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1B_Unicode.json`
+
+SectionEnd
+
+Section /o `Convert Example1_Unicode_UTF16BE.json (BOM)` EXAMPLE1C
+
+  ; Use the /unicode switch if the input file is Unicode.
+  nsJSON::Set /file /unicode $EXEDIR\Input\Example1_Unicode_UTF16BE.json
+
+  ; Generate an ANSII output file.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example1C_ASCII.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1C_ASCII.json`
+
+  ; Generate a Unicode output file.
+  nsJSON::Serialize /format /file /unicode $EXEDIR\Output\Example1C_Unicode.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1C_Unicode.json`
+
+SectionEnd
+
+Section /o `Convert Example1_Unicode_UTF16LE.json (BOM)` EXAMPLE1D
+
+  ; Use the /unicode switch if the input file is Unicode.
+  nsJSON::Set /file /unicode $EXEDIR\Input\Example1_Unicode_UTF16LE.json
+
+  ; Generate an ANSII output file.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example1D_ASCII.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1D_ASCII.json`
+
+  ; Generate a Unicode output file.
+  nsJSON::Serialize /format /file /unicode $EXEDIR\Output\Example1D_Unicode.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1D_Unicode.json`
+
+SectionEnd
+
+Section /o `Convert Example1_Unicode_UTF8.json (sig)` EXAMPLE1E
+
+  ; No /unicode switch is used for UTF8.
+  nsJSON::Set /file $EXEDIR\Input\Example1_Unicode_UTF8.json
+
+  ; Generate an ANSII output file.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example1_ASCII.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1_ASCII.json`
+
+  ; Generate a Unicode output file.
+  nsJSON::Serialize /format /file /unicode $EXEDIR\Output\Example1_Unicode.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1_Unicode.json`
+
+SectionEnd
+
+Section /o `Parse Example2.json` EXAMPLE2
+
+  ; Input: Example2.json; output: Example2.json.
+  nsJSON::Set /file $EXEDIR\Input\Example2.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example2.json
+  DetailPrint `Generate: $EXEDIR\Output\Example2.json`
+
+SectionEnd
+
+Section /o `Parse Example3.json` EXAMPLE3
+
+  ; Input: Example3.json; output: Example3.json.
+  nsJSON::Set /file $EXEDIR\Input\Example3.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example3.json
+  DetailPrint `Generate: $EXEDIR\Output\Example3.json`
+
+SectionEnd
+
+Section /o `Parse Example4.json` EXAMPLE4
+
+  ; Input: Example4.json; output: Example4.json.
+  nsJSON::Set /file $EXEDIR\Input\Example4.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example4.json
+  DetailPrint `Generate: $EXEDIR\Output\Example4.json`
+
+SectionEnd
+
+Section /o `Parse Example5.json` EXAMPLE5
+
+  ; Input: Example5.json; output: Example5.json.
+  nsJSON::Set /file $EXEDIR\Input\Example5.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example5.json
+  DetailPrint `Generate: $EXEDIR\Output\Example5.json`
+
+SectionEnd
+
+Section /o `Parse Example5.json (via $$R0)` EXAMPLE5B
+
+  ; Input: Example5.json; output: Example5.json.
+  nsJSON::Set /file $EXEDIR\Input\Example5.json
+  nsJSON::Serialize /format
+  Pop $R0
+  FileOpen $R1 $EXEDIR\Output\Example5B.json w
+  FileWrite $R1 $R0
+  FileClose $R1
+  DetailPrint `Generate: $EXEDIR\Output\Example5B.json`
+
+SectionEnd
+
+Section /o `Generate Example6.json` EXAMPLE6
+
+  nsJSON::Set /value `{}`
+  nsJSON::Set `html` `head` `title` /value `"Example6"`
+
+  ; Build an array using individual calls.
+  nsJSON::Set `html` `body` `h1` /value `[]`
+  nsJSON::Set `html` `body` `h1` /value `"Hello,\tmy name is"`
+  nsJSON::Set `html` `body` `h1` `i` /value `"Stuart."`
+  nsJSON::Set `html` `body` `h1` /value `"Howdy"`
+  nsJSON::Set `html` `body` `h1` /value `"!"`
+  nsJSON::Set `html` `body` `h1` /value `[ true, "hello", false ]`
+
+  ; Build an array using a JSON string.
+  nsJSON::Set `html` `body` `h2` /value `[ "I like", { "u": { "i" : "programming" } }, "very much!" ]`
+
+  ; Quotes in node keys are allowed; they are escaped automatically.
+  nsJSON::Set `html` `body` `a href="http://www.afrowsoft.co.uk"` /value `"My website!"`
+
+  ; Open the file below in Notepad.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example6.json
+  DetailPrint `Generate: $EXEDIR\Output\Example6.json`
+
+SectionEnd
+
+Section /o `Reading from Example1.json` EXAMPLE7
+
+  nsJSON::Set /file $EXEDIR\Input\Example1.json
+
+  ; Read quoted string value.
+  ClearErrors
+  nsJSON::Get `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossTerm` /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossTerm = $R0`
+  ${EndIf}
+
+  ; Read quoted string value with escaping.
+  ClearErrors
+  nsJSON::Set `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `para2` /value `"A meta-markup language, used to create markup languages\r\nsuch as DocBook."`
+  nsJSON::Get `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `para2` /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->para2 = $R0`
+  ${EndIf}
+
+  ; Read quoted string value without expanding escape sequences.
+  ClearErrors
+  nsJSON::Set `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `para3` /value `"A meta-markup language, used to create markup languages\r\nsuch as DocBook."`
+  nsJSON::Get /noexpand `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `para3` /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->para3 = $R0`
+  ${EndIf}
+
+  ; Read the value of an array (returns a comma delimited list).
+  ClearErrors
+  nsJSON::Get `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `GlossSeeAlso` /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->GlossSeeAlso = $R0`
+  ${EndIf}
+
+  ; Try reading a node that does not exist.
+  ClearErrors
+  nsJSON::Get `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `GlossSeeAlso2` /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->GlossSeeAlso2 = $R0`
+  ${Else}
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->GlossSeeAlso2 = Does not exist!`
+  ${EndIf}
+
+  ; Try reading an array element that does not exist.
+  ClearErrors
+  nsJSON::Get `glossary` `GlossDiv` `GlossList` `GlossEntry` `GlossDef` `GlossSeeAlso` 99 /end
+  ${IfNot} ${Errors}
+    Pop $R0
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->GlossSeeAlso->#99 = $R0`
+  ${Else}
+    DetailPrint `glossary->GlossDiv->GlossList->GlossEntry->GlossDef->GlossSeeAlso->#99 = Does not exist!`
+  ${EndIf}
+
+SectionEnd
+
+Section /o `Arrays test` EXAMPLE8
+
+  nsJSON::Set /value `{}`
+
+  ; You can add an array this way.
+  nsJSON::Set `array1` /value `[ "value 1", "value 2", { "value 3": "node value" }, "value 4", 5 ]`
+
+  ; Inspect array1.
+  nsJSON::Get `array1` /end
+  Pop $R0
+  DetailPrint `array1 = [$R0]`
+
+  ; Or you can build it this way.
+  nsJSON::Set `array2` /value `[]`
+  nsJSON::Set `array2` /value `"value 1"`
+  nsJSON::Set `array2` /value `"value 2"`
+  nsJSON::Set `array2` `value 3` /value `"node value"`
+  nsJSON::Set `array2` /value `"value 4"`
+  nsJSON::Set `array2` /value `5`
+
+  ; You cannot add the same value again.
+  nsJSON::Set `array2` /value `5`
+
+  ; More.
+  nsJSON::Set `array2` /value `blah1`
+  nsJSON::Set `array2` /value `blah2`
+
+  ; Inspect array2.
+  nsJSON::Get `array2` /end
+  Pop $R0
+  DetailPrint `array2 = [$R0]`
+
+  ; Does an array element exist at the given index?
+  nsJSON::Get /exists `array2` /index 0 /end
+  Pop $R0
+  DetailPrint `array2[0] exists? = $R0`
+  ${If} $R0 == yes
+    nsJSON::Get `array2` /index 0 /end
+    Pop $R0
+    DetailPrint `array2[0] = $R0`
+  ${EndIf}
+
+  ; Does an array element exist at the given index?
+  nsJSON::Get /exists `array2` /index -2 /end
+  Pop $R0
+  DetailPrint `array2[-2] exists? = $R0`
+  ${If} $R0 == yes
+    nsJSON::Get `array2` /index -2 /end
+    Pop $R0
+    DetailPrint `array2[-2] = $R0`
+  ${EndIf}
+
+  ; Does an array element exist that matches the value?
+  nsJSON::Get /exists `array2` `5` /end
+  Pop $R0
+  DetailPrint `array2->5 exists? = $R0`
+
+  ; Does an array element exist at the given index?
+  nsJSON::Get /exists `array2` /index 6 /end
+  Pop $R0
+  DetailPrint `array2[6] exists? = $R0`
+
+  ; Open Example8_1.json to see what it now looks like.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example8_1.json
+  DetailPrint `Generate: $EXEDIR\Output\Example8_1.json`
+
+  ; Now delete the element at the given index.
+  nsJSON::Delete `array1` /index 2 `value 3` /end
+  DetailPrint `Delete: array1[2]->value 3`
+  nsJSON::Delete `array2` /index 5 /end
+  DetailPrint `Delete: array2[5]`
+
+  ; Now delete the elements with the given values.
+  nsJSON::Delete `array1` `value 1` /end
+  DetailPrint `Delete: array1->value 1`
+  nsJSON::Delete `array2` `value 2` /end
+  DetailPrint `Delete: array2->value 2`
+
+  ; Inspect array1.
+  nsJSON::Get `array1` /end
+  Pop $R0
+  DetailPrint `array1 = [$R0]`
+
+  ; Inspect array2.
+  nsJSON::Get `array2` /end
+  Pop $R0
+  DetailPrint `array2 = [$R0]`
+
+  ; Open Example8_2.json to see what it now looks like.
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example8_2.json
+  DetailPrint `Generate: $EXEDIR\Output\Example8_2.json`
+
+SectionEnd
+
+Section /o `Node iteration test` EXAMPLE9
+
+  nsJSON::Set /file $EXEDIR\Input\Example4.json
+
+  ; Get the node count.
+  nsJSON::Get /count `web-app` `servlet` /index 0 `init-param` /end
+  Pop $R0
+
+  DetailPrint `Node web-app->servlet[0]->init-param contains $R0 children:`
+  ${For} $R1 0 $R0
+
+    nsJSON::Get /key `web-app` `servlet` /index 0 `init-param` /index $R1 /end
+    Pop $R2
+    nsJSON::Get `web-app` `servlet` /index 0 `init-param` /index $R1 /end
+    Pop $R3
+    nsJSON::Get /type `web-app` `servlet` /index 0 `init-param` /index $R1 /end
+    Pop $R4
+    DetailPrint `$R2 = $R3 (type: $R4)`
+
+  ${Next}
+
+SectionEnd
+
+Section /o `Load Example5.json into Example4.json` EXAMPLE10
+
+  ; Input: Example5.json; output: Example5.json.
+  nsJSON::Set /file $EXEDIR\Input\Example5.json
+  nsJSON::Set `menu` `example4` /file $EXEDIR\Input\Example4.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Example10.json
+  DetailPrint `Generate: $EXEDIR\Output\Example10.json`
+
+SectionEnd
+
+Section /o `Copies Preferences.json into PreferencesNew.json` EXAMPLE11
+
+  ; Input: Preferences.json; output: PreferencesNew.json.
+  nsJSON::Set /file $EXEDIR\Input\Preferences.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\PreferencesNew.json
+  DetailPrint `Generate: $EXEDIR\Output\PreferencesNew.json`
+
+SectionEnd
+
+Section /o `Copies Preferences2.json into Preferences2New.json` EXAMPLE12
+
+  ; Input: Preferences2.json; output: Preferences2New.json.
+  nsJSON::Set /file $EXEDIR\Input\Preferences2.json
+  nsJSON::Serialize /format /file $EXEDIR\Output\Preferences2New.json
+  DetailPrint `Generate: $EXEDIR\Output\Preferences2New.json`
+
+SectionEnd
+
+Section /o `Buffer overflow` EXAMPLE13
+
+  ; Input: Example2.json.
+  nsJSON::Set /file $EXEDIR\Input\Example2.json
+  nsJSON::Serialize /format
+  Pop $R0
+  StrLen $R1 $R0
+  DetailPrint `Output length: $R1`
+  MessageBox MB_OK $R0
+
+SectionEnd
+
+Section /o `Get tests` EXAMPLE14
+
+  nsJSON::Set /value `{ "a": "a", "b": 1, "c": {} }`
+  nsJSON::Serialize /format
+  Pop $R0
+  DetailPrint `Test: $R0`
+
+  nsJSON::Get /key /index 0 /end
+  Pop $R0
+  DetailPrint `Key at index 0: $R0`
+
+  nsJSON::Get /keys /end
+  Pop $R0
+  DetailPrint `Total keys: $R0`
+  StrCpy $R1 0
+  ${DoWhile} $R0 > 0
+    Pop $R2
+    DetailPrint `Key at index $R1: $R2`
+    IntOp $R0 $R0 - 1
+    IntOp $R1 $R1 + 1
+  ${Loop}
+
+  nsJSON::Get /type /index 0 /end
+  Pop $R0
+  DetailPrint `Type at index 0: $R0`
+
+  nsJSON::Get /exists /index 0 /end
+  Pop $R0
+  DetailPrint `Index 0 exists?: $R0`
+
+  nsJSON::Get /count /end
+  Pop $R0
+  DetailPrint `Count: $R0`
+
+  nsJSON::Get /isempty /end
+  Pop $R0
+  DetailPrint `Is empty?: $R0`
+
+  nsJSON::Get /isempty /index 2 /end
+  Pop $R0
+  DetailPrint `Is empty at index 2?: $R0`
+
+  ClearErrors
+  nsJSON::Get /isempty /index 99 /end
+  IfErrors 0 +2
+    DetailPrint `Is empty at index 99?: Error flag is set`
+
+SectionEnd
+
+Section /o `Delete tests` EXAMPLE15
+
+  nsJSON::Set /value `{ "a": "a", "b": 1, "c": {} }`
+  nsJSON::Serialize /format
+  Pop $R0
+  DetailPrint `Test: $R0`
+
+  nsJSON::Delete a /end
+  Pop $R0
+  DetailPrint `Delete key "a": $R0`
+
+  nsJSON::Serialize /format
+  Pop $R0
+  DetailPrint `Now: $R0`
+
+  ClearErrors
+  nsJSON::Delete /index 99 /end
+  IfErrors 0 +2
+    DetailPrint `Delete at index 99: Error flag is set`
+
+SectionEnd
+
+Section /o `Empty keys` EXAMPLE16
+
+  nsJSON::Set /value `{ "": "a", 1, "c": {} }`
+  nsJSON::Serialize /format
+  Pop $R0
+  DetailPrint `Test: $R0`
+
+  nsJSON::Set a "" /value `"abc"`
+  nsJSON::Serialize /format
+  Pop $R0
+  DetailPrint `Test: $R0`
+
+SectionEnd
+
+LangString Example1Desc ${LANG_ENGLISH} `Parses Example1.json and then generates Output\Example1.json`
+LangString Example1BDesc ${LANG_ENGLISH} `Parses Example1_Unicode.json (no BOM) and then generates Unicode and ASCII copies`
+LangString Example1CDesc ${LANG_ENGLISH} `Parses Example1_Unicode_UTF16BE.json (BOM) and then generates Unicode and ASCII copies`
+LangString Example1DDesc ${LANG_ENGLISH} `Parses Example1_Unicode_UTF16LE.json (BOM) and then generates Unicode and ASCII copies`
+LangString Example1EDesc ${LANG_ENGLISH} `Parses Example1_Unicode_UTF8.json (sig) and then generates Unicode and ASCII copies`
+LangString Example2Desc ${LANG_ENGLISH} `Parses Example2.json and then generates Output\Example2.json`
+LangString Example3Desc ${LANG_ENGLISH} `Parses Example3.json and then generates Output\Example3.json`
+LangString Example4Desc ${LANG_ENGLISH} `Parses Example4.json and then generates Output\Example4.json`
+LangString Example5Desc ${LANG_ENGLISH} `Parses Example5.json and then generates Output\Example5.json`
+LangString Example5BDesc ${LANG_ENGLISH} `Parses Example5.json and then generates Output\Example5B.json using $$R0`
+LangString Example6Desc ${LANG_ENGLISH} `Generates Output\Example6.json using Parse, Set and Serialize`
+LangString Example7Desc ${LANG_ENGLISH} `Parses Example1.json and then reads values from the tree using Get`
+LangString Example8Desc ${LANG_ENGLISH} `Tests JSON array manipulation while generating Output\Example8.json`
+LangString Example9Desc ${LANG_ENGLISH} `Iterates through some nodes in Example4.json by index`
+LangString Example10Desc ${LANG_ENGLISH} `Parses Example5.json into Example4.json and then generates Output\Example10.json`
+LangString Example11Desc ${LANG_ENGLISH} `Parses Preferences.json and then generates Output\PreferencesNew.json`
+LangString Example12Desc ${LANG_ENGLISH} `Parses Preferences2.json and then generates Output\Preferences2New.json`
+LangString Example13Desc ${LANG_ENGLISH} `Parses Example2.json (size>NSIS_MAX_STRLEN) and outputs the result.`
+LangString Example14Desc ${LANG_ENGLISH} `Simple Get function tests.`
+LangString Example15Desc ${LANG_ENGLISH} `Simple Delete function tests.`
+LangString Example16Desc ${LANG_ENGLISH} `Empty/missing value keys tests.`
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE1} $(Example1Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE1B} $(Example1BDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE1C} $(Example1CDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE1D} $(Example1DDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE1E} $(Example1EDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE2} $(Example2Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE3} $(Example3Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE4} $(Example4Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE5} $(Example5Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE5B} $(Example5BDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE6} $(Example6Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE7} $(Example7Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE8} $(Example8Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE9} $(Example9Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE10} $(Example10Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE11} $(Example11Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE12} $(Example12Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE13} $(Example13Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE14} $(Example14Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE15} $(Example15Desc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${EXAMPLE16} $(Example16Desc)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END

+ 127 - 0
NSIS/Examples/nsJSON/HttpWebRequest.nsi

@@ -0,0 +1,127 @@
+!include MUI2.nsh
+
+!define HttpWebRequestURL `http://www.afrowsoft.co.uk/test/HttpWebRequest.php`
+
+Name `nsJSON plug-in`
+OutFile nsJSON_HttpWebRequest.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!define MUI_COMPONENTSPAGE_SMALLDESC
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+Section
+
+  CreateDirectory $EXEDIR\Output
+
+SectionEnd
+
+Section /o `POST` DATAPOST
+
+  StrCpy $R0 `{ "Name": "Jonathan Doe", "Age": 23, "Formula": "a + b == 13%!", "ViewTimes": [ "10:00", "13:43", "21:19", "03:10" ] }`
+
+  nsJSON::Set /tree HttpWebRequest /value `{ "Url": "${HttpWebRequestURL}", "Verb": "POST", "Agent": "Mozilla/5.0 (Windows NT 10.0; rv:10.0) Gecko/20100101 Firefox/10.0" }`
+  DetailPrint `Send: $R0`
+  DetailPrint `Send to: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebRequest Data /value $R0
+
+  nsJSON::Set /tree HttpWebRequest Params /value `{ "a": "string", "b": true, "c": 2 }`
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebRequest.json from HttpWebRequest`
+  nsJSON::Serialize /tree HttpWebRequest /format /file $EXEDIR\Output\HttpWebRequest.json
+
+  DetailPrint `Download: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebResponse /http HttpWebRequest
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebResponse.json from HttpWebResponse`
+  nsJSON::Serialize /tree HttpWebResponse /format /file $EXEDIR\Output\HttpWebResponse.json
+
+SectionEnd
+
+Section /o `Async POST` DATAPOSTASYNC
+
+  StrCpy $R0 `{ "Name": "Jonathan Doe", "Age": 23, "Formula": "a + b == 13%!", "ViewTimes": [ "10:00", "13:43", "21:19", "03:10" ] }`
+
+  nsJSON::Set /tree HttpWebRequest /value `{ "Url": "${HttpWebRequestURL}", "Verb": "POST", "Async": true }`
+  DetailPrint `Send: $R0`
+  DetailPrint `Send to: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebRequest Data /value $R0
+
+  nsJSON::Set /tree HttpWebRequest Params /value `{ "a": "string", "b": true, "c": 2 }`
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebRequest.json from HttpWebRequest`
+  nsJSON::Serialize /tree HttpWebRequest /format /file $EXEDIR\Output\HttpWebRequest.json
+
+  DetailPrint `Download: ${HttpWebRequestURL}`
+  nsJSON::Set /tree AsyncHttpWebResponse /http HttpWebRequest
+
+  ; Wait until done.
+  ${Do}
+    Sleep 1000
+    nsJSON::Wait HttpWebRequest /timeout 0
+    Pop $R0
+    ${If} $R0 != wait
+      ${Break}
+    ${EndIf}
+    DetailPrint `Waiting...`
+  ${Loop}
+
+  DetailPrint `Finished...`
+
+  DetailPrint `Generate: $EXEDIR\Output\AsyncHttpWebResponse.json from AsyncHttpWebResponse`
+  nsJSON::Serialize /tree AsyncHttpWebResponse /format /file $EXEDIR\Output\AsyncHttpWebResponse.json
+
+SectionEnd
+
+Section /o `Raw POST` RAWDATAPOST
+
+  StrCpy $R0 `Name=Jonathan+Doe&Age=23&Formula=a+%2B+b+%3D%3D+13%25%21&ViewTimes[]=10%3A00&ViewTimes[]=13%3A43&ViewTimes[]=21%3A19&ViewTimes[]=03%3A10`
+
+  nsJSON::Set /tree HttpWebRequest /value `{ "Url": "${HttpWebRequestURL}", "Verb": "POST", "DataType": "Raw" }`
+  DetailPrint `Send: $R0`
+  DetailPrint `Send to: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebRequest Data /value `"$R0"`
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebRequest_Raw.json from HttpWebRequest`
+  nsJSON::Serialize /tree HttpWebRequest /format /file $EXEDIR\Output\HttpWebRequest_Raw.json
+
+  DetailPrint `Download: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebResponse /http HttpWebRequest
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebResponse_Raw.json from HttpWebResponse`
+  nsJSON::Serialize /tree HttpWebResponse /format /file $EXEDIR\Output\HttpWebResponse_Raw.json
+
+SectionEnd
+
+Section /o `JSON POST` JSONPOST
+
+  nsJSON::Set /tree HttpWebRequest /value `{ "Url": "${HttpWebRequestURL}", "Verb": "POST", "DataType": "JSON" }`
+  DetailPrint `Send: $EXEDIR\Input\Example1.json`
+  DetailPrint `Send to: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebRequest Data /file $EXEDIR\Input\Example1.json
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebRequest_JSON.json from HttpWebRequest`
+  nsJSON::Serialize /tree HttpWebRequest /format /file $EXEDIR\Output\HttpWebRequest_JSON.json
+
+  DetailPrint `Download: ${HttpWebRequestURL}`
+  nsJSON::Set /tree HttpWebResponse /http HttpWebRequest
+
+  DetailPrint `Generate: $EXEDIR\Output\HttpWebResponse_JSON.json from HttpWebResponse`
+  nsJSON::Serialize /tree HttpWebResponse /format /file $EXEDIR\Output\HttpWebResponse_JSON.json
+
+SectionEnd
+
+LangString DataPOSTDesc ${LANG_ENGLISH} `Sends POST data and parses the JSON response`
+LangString DataPOSTAsyncDesc ${LANG_ENGLISH} `Asynchronously sends POST data and parses the JSON response`
+LangString RawDataPOSTDesc ${LANG_ENGLISH} `Sends raw POST data and parses the JSON response`
+LangString JSONPOSTDesc ${LANG_ENGLISH} `Sends Example1.json and parses the JSON response`
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${DATAPOST} $(DataPOSTDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${DATAPOSTASYNC} $(DataPOSTAsyncDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${RAWDATAPOST} $(RawDataPOSTDesc)
+  !insertmacro MUI_DESCRIPTION_TEXT ${JSONPOST} $(JSONPOSTDesc)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END

+ 22 - 0
NSIS/Examples/nsJSON/Input/Example1.json

@@ -0,0 +1,22 @@
+{
+	"glossary": {
+		"title": "example glossary",
+		"GlossDiv": {
+			"title": "S",
+			"GlossList": {
+				"GlossEntry": {
+					"ID": "SGML",
+					"SortAs": "SGML",
+					"GlossTerm": "Standard Generalized Markup Language",
+					"Acronym": "SGML",
+					"Abbrev": "ISO 8879:1986",
+					"GlossDef": {
+						"para": "A meta-markup language, used to create markup languages such as DocBook.",
+						"GlossSeeAlso": ["GML", "XML"]
+					},
+					"GlossSee": "markup"
+				}
+			}
+		}
+	}
+}

BIN
NSIS/Examples/nsJSON/Input/Example1_Unicode.json


BIN
NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF16BE.json


BIN
NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF16LE.json


+ 22 - 0
NSIS/Examples/nsJSON/Input/Example1_Unicode_UTF8.json

@@ -0,0 +1,22 @@
+{
+	"glossary": {
+		"title": "example glossary",
+		"GlossDiv": {
+			"title": "S",
+			"GlossList": {
+				"GlossEntry": {
+					"ID": "SGML",
+					"SortAs": "SGML",
+					"GlossTerm": "Standard Generalized Markup Language",
+					"Acronym": "SGML",
+					"Abbrev": "ISO 8879:1986",
+					"GlossDef": {
+						"para": "A meta-markup language, used to create markup languages such as DocBook.",
+						"GlossSeeAlso": ["GML", "XML"]
+					},
+					"GlossSee": "markup"
+				}
+			}
+		}
+	}
+}

Разлика између датотеке није приказан због своје велике величине
+ 14 - 0
NSIS/Examples/nsJSON/Input/Example2.json


+ 28 - 0
NSIS/Examples/nsJSON/Input/Example3.json

@@ -0,0 +1,28 @@
+{
+	"widget": {
+		"debug": "on",
+		"window": {
+			"title": "Sample Konfabulator Widget",
+			"name": "main_window",
+			"width": 500,
+			"height": 500
+		},
+		"image": {
+			"src": "Images/Sun.png",
+			"name": "sun1",
+			"hOffset": 250,
+			"vOffset": 250,
+			"alignment": "center"
+		},
+		"text": {
+			"data": "Click Here",
+			"size": 36,
+			"style": "bold",
+			"name": "text1",
+			"hOffset": 250,
+			"vOffset": 100,
+			"alignment": "center",
+			"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
+		}
+	}
+}

+ 99 - 0
NSIS/Examples/nsJSON/Input/Example4.json

@@ -0,0 +1,99 @@
+{
+	"web-app": {
+		"servlet": [
+			{
+				"servlet-name": "cofaxCDS",
+				"servlet-class": "org.cofax.cds.CDSServlet",
+				"init-param": {
+					"configGlossary:installationAt": "Philadelphia, PA",
+					"configGlossary:adminEmail": "ksm@pobox.com",
+					"configGlossary:poweredBy": "Cofax",
+					"configGlossary:poweredByIcon": "/images/cofax.gif",
+					"configGlossary:staticPath": "/content/static",
+					"templateProcessorClass": "org.cofax.WysiwygTemplate",
+					"templateLoaderClass": "org.cofax.FilesTemplateLoader",
+					"templatePath": "templates",
+					"templateOverridePath": "",
+					"defaultListTemplate": "listTemplate.htm",
+					"defaultFileTemplate": "articleTemplate.htm",
+					"useJSP": false,
+					"jspListTemplate": "listTemplate.jsp",
+					"jspFileTemplate": "articleTemplate.jsp",
+					"cachePackageTagsTrack": 200,
+					"cachePackageTagsStore": 200,
+					"cachePackageTagsRefresh": 60,
+					"cacheTemplatesTrack": 100,
+					"cacheTemplatesStore": 50,
+					"cacheTemplatesRefresh": 15,
+					"cachePagesTrack": 200,
+					"cachePagesStore": 100,
+					"cachePagesRefresh": 10,
+					"cachePagesDirtyRead": 10,
+					"searchEngineListTemplate": "forSearchEnginesList.htm",
+					"searchEngineFileTemplate": "forSearchEngines.htm",
+					"searchEngineRobotsDb": "WEB-INF/robots.db",
+					"useDataStore": true,
+					"dataStoreClass": "org.cofax.SqlDataStore",
+					"redirectionClass": "org.cofax.SqlRedirection",
+					"dataStoreName": "cofax",
+					"dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
+					"dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
+					"dataStoreUser": "sa",
+					"dataStorePassword": "dataStoreTestQuery",
+					"dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
+					"dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
+					"dataStoreInitConns": 10,
+					"dataStoreMaxConns": 100,
+					"dataStoreConnUsageLimit": 100,
+					"dataStoreLogLevel": "debug",
+					"maxUrlLength": 500
+				}
+			},
+			{
+				"servlet-name": "cofaxEmail",
+				"servlet-class": "org.cofax.cds.EmailServlet",
+				"init-param": {
+					"mailHost": "mail1",
+					"mailHostOverride": "mail2"
+				}
+			},
+			{
+				"servlet-name": "cofaxAdmin",
+				"servlet-class": "org.cofax.cds.AdminServlet"
+			},
+			{
+				"servlet-name": "fileServlet",
+				"servlet-class": "org.cofax.cds.FileServlet"
+			},
+			{
+				"servlet-name": "cofaxTools",
+				"servlet-class": "org.cofax.cms.CofaxToolsServlet",
+				"init-param": {
+					"templatePath": "toolstemplates/",
+					"log": 1,
+					"logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
+					"logMaxSize": "",
+					"dataLog": 1,
+					"dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
+					"dataLogMaxSize": "",
+					"removePageCache": "/content/admin/remove?cache=pages&id=",
+					"removeTemplateCache": "/content/admin/remove?cache=templates&id=",
+					"fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
+					"lookInContext": 1,
+					"adminGroupID": 4,
+					"betaServer": true
+				}
+			} ],
+		"servlet-mapping": {
+			"cofaxCDS": "/",
+			"cofaxEmail": "/cofaxutil/aemail/*",
+			"cofaxAdmin": "/admin/*",
+			"fileServlet": "/static/*",
+			"cofaxTools": "/tools/*"
+		},
+		"taglib": {
+			"taglib-uri": "cofax.tld",
+			"taglib-location": "/WEB-INF/tlds/cofax.tld"
+		}
+	}
+}

+ 29 - 0
NSIS/Examples/nsJSON/Input/Example5.json

@@ -0,0 +1,29 @@
+{
+	"menu": {
+		"header": "SVG Viewer",
+		"items": [
+			{"id": "Open"},
+			{"id": "OpenNew", "label": "Open New"},
+			null,
+			{"id": "ZoomIn", "label": "Zoom In"},
+			{"id": "ZoomOut", "label": "Zoom Out"},
+			{"id": "OriginalView", "label": "Original View"},
+			null,
+			{"id": "Quality"},
+			{"id": "Pause"},
+			{"id": "Mute"},
+			null,
+			{"id": "Find", "label": "Find..."},
+			{"id": "FindAgain", "label": "Find Again"},
+			{"id": "Copy"},
+			{"id": "CopyAgain", "label": "Copy Again"},
+			{"id": "CopySVG", "label": "Copy SVG"},
+			{"id": "ViewSVG", "label": "View SVG"},
+			{"id": "ViewSource", "label": "View Source"},
+			{"id": "SaveAs", "label": "Save As"},
+			null,
+			{"id": "Help"},
+			{"id": "About", "label": "About Adobe CVG Viewer..."}
+		]
+	}
+}

+ 992 - 0
NSIS/Examples/nsJSON/Input/Preferences.json

@@ -0,0 +1,992 @@
+{
+   "apps": {
+      "shortcuts_have_been_created": true
+   },
+   "browser": {
+      "last_known_google_url": "https://www.google.co.uk/",
+      "last_prompted_google_url": "https://www.google.co.uk/",
+      "window_placement": {
+         "bottom": 1087,
+         "left": 682,
+         "maximized": false,
+         "right": 1627,
+         "top": 67,
+         "work_area_bottom": 1040,
+         "work_area_left": 0,
+         "work_area_right": 1920,
+         "work_area_top": 0
+      }
+   },
+   "countryid_at_install": 21843,
+   "default_apps_install_state": 3,
+   "default_search_provider": {
+      "alternate_urls": [ "{google:baseURL}#q={searchTerms}", "{google:baseURL}search#q={searchTerms}", "{google:baseURL}webhp#q={searchTerms}" ],
+      "enabled": true,
+      "encodings": "UTF-8",
+      "icon_url": "http://www.google.com/favicon.ico",
+      "id": "2",
+      "image_url": "{google:baseURL}searchbyimage/upload",
+      "image_url_post_params": "encoded_image={google:imageThumbnail},image_url={google:imageURL},sbisrc={google:imageSearchSource},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight}",
+      "instant_url": "{google:baseURL}webhp?sourceid=chrome-instant&{google:RLZ}{google:forceInstantResults}{google:instantExtendedEnabledParameter}{google:ntpIsThemedParameter}{google:omniboxStartMarginParameter}ie={inputEncoding}",
+      "instant_url_post_params": "",
+      "keyword": "google.co.uk",
+      "name": "Google",
+      "new_tab_url": "{google:baseURL}_/chrome/newtab?{google:RLZ}{google:instantExtendedEnabledParameter}{google:ntpIsThemedParameter}ie={inputEncoding}",
+      "prepopulate_id": "1",
+      "search_terms_replacement_key": "espv",
+      "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:bookmarkBarPinned}{google:searchClient}{google:sourceId}{google:instantExtendedEnabledParameter}{google:omniboxStartMarginParameter}ie={inputEncoding}",
+      "search_url_post_params": "",
+      "suggest_url": "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}sugkey={google:suggestAPIKeyParameter}",
+      "suggest_url_post_params": ""
+   },
+   "extensions": {
+      "alerts": {
+         "initialized": true
+      },
+      "autoupdate": {
+         "next_check": "13040578803125671",
+         "test": "E:\\",
+         "test2": "E:\\\""
+      },
+      "chrome_url_overrides": {
+         "bookmarks": [ "chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html" ]
+      },
+      "known_disabled": [  ],
+      "last_chrome_version": "33.0.1750.154",
+      "settings": {
+         "ahfgeienlihckogmohjhadlkjgocpleb": {
+            "active_permissions": {
+               "api": [ "management", "webstorePrivate" ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "t",
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "web_url": "https://chrome.google.com/webstore"
+                  },
+                  "urls": [ "https://chrome.google.com/webstore" ]
+               },
+               "description": "Chrome Web Store",
+               "icons": {
+                  "128": "webstore_icon_128.png",
+                  "16": "webstore_icon_16.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtl3tO0osjuzRsf6xtD2SKxPlTfuoy7AWoObysitBPvH5fE1NaAA1/2JkPWkVDhdLBWLaIBPYeXbzlHp3y4Vv/4XG+aN5qFE3z+1RU/NqkzVYHtIpVScf3DjTYtKVL66mzVGijSoAIwbFCC3LpGdaoe6Q1rSRDp76wR6jjFzsYwQIDAQAB",
+               "name": "Store",
+               "permissions": [ "webstorePrivate", "management" ],
+               "version": "0.2"
+            },
+            "page_ordinal": "n",
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\web_store",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "aohghmighlieiainnegkcijnfilokake": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "w",
+            "content_settings": [  ],
+            "creation_flags": 137,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": true,
+            "granted_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559089376747",
+            "lastpingday": "13040550028882747",
+            "location": 1,
+            "manifest": {
+               "api_console_project_id": "619683526622",
+               "app": {
+                  "launch": {
+                     "local_path": "main.html"
+                  }
+               },
+               "container": "GOOGLE_DRIVE",
+               "current_locale": "en_GB",
+               "default_locale": "en_US",
+               "description": "Create and edit documents",
+               "icons": {
+                  "128": "icon_128.png",
+                  "16": "icon_16.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJhLK6fk/BWTEvJhywpk7jDe4A2r0bGXGOLZW4/AdBp3IiD9o9nx4YjLAtv0tIPxi7MvFd/GUUbQBwHT5wQWONJj1z/0Rc2qBkiJA0yqXh42p0snuA8dCfdlhOLsp7/XTMEwAVasjV5hC4awl78eKfJYlZ+8fM/UldLWJ/51iBQwIDAQAB",
+               "manifest_version": 2,
+               "name": "Google Docs",
+               "offline_enabled": true,
+               "update_url": "http://clients2.google.com/service/update2/crx",
+               "version": "0.5"
+            },
+            "page_ordinal": "n",
+            "path": "aohghmighlieiainnegkcijnfilokake\\0.5_0",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "state": 1,
+            "was_installed_by_default": true
+         },
+         "apdfllckaahabafndbhieahigkjlhalf": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "yn",
+            "content_settings": [  ],
+            "creation_flags": 137,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": true,
+            "granted_permissions": {
+               "api": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ],
+               "manifest_permissions": [  ]
+            },
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559088240747",
+            "lastpingday": "13040550028882747",
+            "location": 1,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "web_url": "https://drive.google.com/?usp=chrome_app"
+                  },
+                  "urls": [ "http://docs.google.com/", "http://drive.google.com/", "https://docs.google.com/", "https://drive.google.com/" ]
+               },
+               "background": {
+                  "allow_js_access": false
+               },
+               "current_locale": "en_GB",
+               "default_locale": "en_US",
+               "description": "Google Drive: create, share and keep all your stuff in one place.",
+               "icons": {
+                  "128": "128.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIl5KlKwL2TSkntkpY3naLLz5jsN0YwjhZyObcTOK6Nda4Ie21KRqZau9lx5SHcLh7pE2/S9OiArb+na2dn7YK5EvH+aRXS1ec3uxVlBhqLdnleVgwgwlg5fH95I52IeHcoeK6pR4hW/Nv39GNlI/Uqk6O6GBCCsAxYrdxww9BiQIDAQAB",
+               "manifest_version": 2,
+               "name": "Google Drive",
+               "offline_enabled": true,
+               "options_page": "https://drive.google.com/settings",
+               "permissions": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ],
+               "update_url": "http://clients2.google.com/service/update2/crx",
+               "version": "6.3"
+            },
+            "page_ordinal": "n",
+            "path": "apdfllckaahabafndbhieahigkjlhalf\\6.3_0",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "state": 1,
+            "was_installed_by_default": true
+         },
+         "blpcfgokakmgnkcojhhkbfbldkacnbeo": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "x",
+            "content_settings": [  ],
+            "creation_flags": 153,
+            "events": [  ],
+            "from_bookmark": true,
+            "from_webstore": true,
+            "granted_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559088955747",
+            "lastpingday": "13040550028882747",
+            "location": 1,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "container": "tab",
+                     "web_url": "http://www.youtube.com/?feature=ytca"
+                  },
+                  "web_content": {
+                     "enabled": true,
+                     "origin": "http://www.youtube.com"
+                  }
+               },
+               "current_locale": "en_GB",
+               "default_locale": "en",
+               "description": "The world's most popular online video community.",
+               "icons": {
+                  "128": "128.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDC/HotmFlyuz5FaHaIbVBhhL4BwbcUtsfWwzgUMpZt5ZsLB2nW/Y5xwNkkPANYGdVsJkT2GPpRRIKBO5QiJ7jPMa3EZtcZHpkygBlQLSjMhdrAKevpKgIl6YTkwzNvExY6rzVDzeE9zqnIs33eppY4S5QcoALMxuSWlMKqgFQjHQIDAQAB",
+               "manifest_version": 2,
+               "name": "YouTube",
+               "permissions": [ "appNotifications" ],
+               "update_url": "http://clients2.google.com/service/update2/crx",
+               "version": "4.2.6"
+            },
+            "page_ordinal": "n",
+            "path": "blpcfgokakmgnkcojhhkbfbldkacnbeo\\4.2.6_0",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "state": 1,
+            "was_installed_by_default": true
+         },
+         "coobgpohoikkiipiblmjeljniedjpjpf": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "z",
+            "content_settings": [  ],
+            "creation_flags": 153,
+            "events": [  ],
+            "from_bookmark": true,
+            "from_webstore": true,
+            "granted_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559087816747",
+            "lastpingday": "13040550028882747",
+            "location": 1,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "web_url": "http://www.google.com/webhp?source=search_app"
+                  },
+                  "urls": [ "*://www.google.com/search", "*://www.google.com/webhp", "*://www.google.com/imgres" ]
+               },
+               "current_locale": "en_GB",
+               "default_locale": "en",
+               "description": "The fastest way to search the web.",
+               "icons": {
+                  "128": "128.png",
+                  "16": "16.png",
+                  "32": "32.png",
+                  "48": "48.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIiso3Loy5VJHL40shGhUl6it5ZG55XB9q/2EX6aa88jAxwPutbCgy5d9bm1YmBzLfSgpX4xcpgTU08ydWbd7b50fbkLsqWl1mRhxoqnN01kuNfv9Hbz9dWWYd+O4ZfD3L2XZs0wQqo0y6k64n+qeLkUMd1MIhf6MR8Xz1SOA8pwIDAQAB",
+               "manifest_version": 2,
+               "name": "Google Search",
+               "permissions": [  ],
+               "update_url": "http://clients2.google.com/service/update2/crx",
+               "version": "0.0.0.20"
+            },
+            "page_ordinal": "n",
+            "path": "coobgpohoikkiipiblmjeljniedjpjpf\\0.0.0.20_0",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "state": 1,
+            "was_installed_by_default": true
+         },
+         "eemcgdkfndhakfknompkggombfjjjeno": {
+            "active_permissions": {
+               "api": [ "bookmarks", "bookmarkManagerPrivate", "metricsPrivate", "systemPrivate", "tabs" ],
+               "explicit_host": [ "chrome://favicon/*", "chrome://resources/*" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "chrome_url_overrides": {
+                  "bookmarks": "main.html"
+               },
+               "content_security_policy": "object-src 'none'; script-src chrome://resources 'self'",
+               "description": "Bookmark Manager",
+               "icons": {
+
+               },
+               "incognito": "split",
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDQcByy+eN9jzazWF/DPn7NW47sW7lgmpk6eKc0BQM18q8hvEM3zNm2n7HkJv/R6fU+X5mtqkDuKvq5skF6qqUF4oEyaleWDFhd1xFwV7JV+/DU7bZ00w2+6gzqsabkerFpoP33ZRIw7OviJenP0c0uWqDWF8EGSyMhB3txqhOtiQIDAQAB",
+               "manifest_version": 2,
+               "name": "Bookmark Manager",
+               "permissions": [ "bookmarks", "bookmarkManagerPrivate", "metricsPrivate", "systemPrivate", "tabs", "chrome://favicon/", "chrome://resources/" ],
+               "version": "0.1"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\bookmark_manager",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "ennkphjdgehloodpbhlhldgbnhmacadg": {
+            "active_permissions": {
+               "api": [ "app.currentWindowInternal", "app.runtime", "app.window" ],
+               "explicit_host": [ "chrome://settings-frame/*" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [ "app.runtime.onLaunched" ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "app": {
+                  "background": {
+                     "scripts": [ "settings_app.js" ]
+                  }
+               },
+               "description": "Settings",
+               "display_in_launcher": false,
+               "icons": {
+                  "128": "settings_app_icon_128.png",
+                  "16": "settings_app_icon_16.png",
+                  "32": "settings_app_icon_32.png",
+                  "48": "settings_app_icon_48.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDoVDPGX6fvKPVVgc+gnkYlGqHuuapgFDyKhsy4z7UzRLO/95zXPv8h8e5EacqbAQJLUbP6DERH5jowyNEYVxq9GJyntJMwP1ejvoz/52hnY3CCGGCmttmKzzpp5zwLuq3iZf8bslwywfflNUYtaCFSDa0TtrBZz0aOPrAAd/AhNwIDAQAB",
+               "manifest_version": 2,
+               "name": "Settings",
+               "permissions": [ "chrome://settings-frame/" ],
+               "version": "0.2"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\settings_app",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "running": false,
+            "was_installed_by_default": false
+         },
+         "gfdkimpbcpahaombhbimeihdjnejgicl": {
+            "active_permissions": {
+               "api": [ "app.currentWindowInternal", "app.runtime", "app.window", "feedbackPrivate" ],
+               "explicit_host": [ "chrome://resources/*" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [ "feedbackPrivate.onFeedbackRequested" ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "app": {
+                  "background": {
+                     "scripts": [ "js/event_handler.js" ]
+                  },
+                  "content_security_policy": "default-src 'none'; script-src 'self' chrome://resources; style-src 'unsafe-inline' *; img-src *; media-src 'self'"
+               },
+               "description": "User feedback extension",
+               "display_in_launcher": false,
+               "display_in_new_tab_page": false,
+               "icons": {
+                  "32": "images/icon32.png",
+                  "64": "images/icon64.png"
+               },
+               "incognito": "split",
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMZElzFX2J1g1nRQ/8S3rg/1CjFyDltWOxQg+9M8aVgNVxbutEWFQz+oQzIP9BB67mJifULgiv12ToFKsae4NpEUR8sPZjiKDIHumc6pUdixOm8SJ5Rs16SMR6+VYxFUjlVW+5CA3IILptmNBxgpfyqoK0qRpBDIhGk1KDEZ4zqQIDAQAB",
+               "manifest_version": 2,
+               "name": "Feedback",
+               "permissions": [ "feedbackPrivate", "chrome://resources/" ],
+               "version": "1.0"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\feedback",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "running": false,
+            "was_installed_by_default": false
+         },
+         "mfehgcgbbipciphmccgaenjidiccnmng": {
+            "active_permissions": {
+               "api": [ "cloudPrintPrivate" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "web_url": "https://www.google.com/cloudprint"
+                  },
+                  "urls": [ "https://www.google.com/cloudprint/enable_chrome_connector" ]
+               },
+               "description": "Cloud Print",
+               "display_in_launcher": false,
+               "icons": {
+
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDqOhnwk4+HXVfGyaNsAQdU/js1Na56diW08oF1MhZiwzSnJsEaeuMN9od9q9N4ZdK3o1xXOSARrYdE+syV7Dl31nf6qz3A6K+D5NHe6sSB9yvYlIiN37jdWdrfxxE0pRYEVYZNTe3bzq3NkcYJlOdt1UPcpJB+isXpAGUKUvt7EQIDAQAB",
+               "name": "Cloud Print",
+               "permissions": [ "cloudPrintPrivate" ],
+               "version": "0.1"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\cloud_print",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "mgndgikekgjfcpckkfioiadnlibdjbkf": {
+            "active_permissions": {
+               "api": [  ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "n",
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "web_url": "http://THIS-WILL-BE-REPLACED"
+                  }
+               },
+               "description": "Chrome as an app",
+               "display_in_launcher": true,
+               "display_in_new_tab_page": false,
+               "icons": {
+                  "128": "product_logo_128.png",
+                  "16": "product_logo_16.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNuYLEQ1QPMcc5HfWI/9jiEf6FdJWqEtgRmIeI7qtjPLBM5oje+Ny2E2mTAhou5qdJiO2CHWdU1DQXY2F7Zu2gZaKZgHLfK4WimHxUT5Xd9/aro/R9PCzjguM1BLusiWYc9xlj1IsZpyiN1hcjU7SCnBhv1feQlv2WSB5KRiXwhQIDAQAB",
+               "name": "Chrome",
+               "version": "0.1"
+            },
+            "page_ordinal": "n",
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\chrome_app",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "neajdppkdcdipfabeoofebfddakdcjhd": {
+            "active_permissions": {
+               "api": [ "systemPrivate", "ttsEngine" ],
+               "explicit_host": [ "https://www.google.com/*" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [ "ttsEngine.onPause", "ttsEngine.onResume", "ttsEngine.onSpeak", "ttsEngine.onStop" ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "background": {
+                  "persistent": false,
+                  "scripts": [ "tts_extension.js" ]
+               },
+               "description": "Component extension providing speech via the Google network text-to-speech service.",
+               "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8GSbNUMGygqQTNDMFGIjZNcwXsHLzkNkHjWbuY37PbNdSDZ4VqlVjzbWqODSe+MjELdv5Keb51IdytnoGYXBMyqKmWpUrg+RnKvQ5ibWr4MW9pyIceOIdp9GrzC1WZGgTmZismYR3AjaIpufZ7xDdQQv+XrghPWCkdVqLN+qZDA1HU+DURznkMICiDDSH2sU0egm9UbWfS218bZqzKeQDiC3OnTPlaxcbJtKUuupIm5knjze3Wo9Ae9poTDMzKgchg0VlFCv3uqox+wlD8sjXBoyBCCK9HpImdVAF1a7jpdgiUHpPeV/26oYzM9/grltwNR3bzECQgSpyXp0eyoegwIDAQAB",
+               "manifest_version": 2,
+               "name": "Google Network Speech",
+               "permissions": [ "systemPrivate", "ttsEngine", "https://www.google.com/" ],
+               "tts_engine": {
+                  "voices": [ {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "en-US",
+                     "remote": true,
+                     "voice_name": "Google US English"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "male",
+                     "lang": "en-GB",
+                     "remote": true,
+                     "voice_name": "Google UK English Male"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "en-GB",
+                     "remote": true,
+                     "voice_name": "Google UK English Female"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "es-ES",
+                     "remote": true,
+                     "voice_name": "Google Español"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "fr-FR",
+                     "remote": true,
+                     "voice_name": "Google Français"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "it-IT",
+                     "remote": true,
+                     "voice_name": "Google Italiano"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "de-DE",
+                     "remote": true,
+                     "voice_name": "Google Deutsch"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "ja-JP",
+                     "remote": true,
+                     "voice_name": "Google 日本人"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "ko-KR",
+                     "remote": true,
+                     "voice_name": "Google 한국의"
+                  }, {
+                     "event_types": [ "start", "end", "error" ],
+                     "gender": "female",
+                     "lang": "zh-CN",
+                     "remote": true,
+                     "voice_name": "Google 中国的"
+                  } ]
+               },
+               "version": "1.0"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\network_speech_synthesis",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "nkeimhogjdpnpccoofpliimaahmaaome": {
+            "active_permissions": {
+               "api": [ "alarms", "desktopCapture", "webConnectable", "webrtcAudioPrivate", "webrtcLoggingPrivate", "system.cpu" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 1,
+            "events": [ "alarms.onAlarm", "runtime.onStartup" ],
+            "from_bookmark": false,
+            "from_webstore": false,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559080062671",
+            "location": 5,
+            "manifest": {
+               "background": {
+                  "page": "background.html",
+                  "persistent": false
+               },
+               "externally_connectable": {
+                  "matches": [ "https://*.google.com/hangouts*", "*://localhost/*" ]
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAQt2ZDdPfoSe/JI6ID5bgLHRCnCu9T36aYczmhw/tnv6QZB2I6WnOCMZXJZlRdqWc7w9jo4BWhYS50Vb4weMfh/I0On7VcRwJUgfAxW2cHB+EkmtI1v4v/OU24OqIa1Nmv9uRVeX0GjhQukdLNhAE6ACWooaf5kqKlCeK+1GOkQIDAQAB",
+               "manifest_version": 2,
+               "name": "Hangout Services",
+               "permissions": [ "alarms", "desktopCapture", "system.cpu", "webrtcAudioPrivate", "webrtcLoggingPrivate" ],
+               "version": "1.0"
+            },
+            "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\33.0.1750.154\\resources\\hangout_services",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "was_installed_by_default": false
+         },
+         "nmmhkkegccagdldgiimedpiccmgmieda": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [ "app.currentWindowInternal", "app.runtime", "app.window", "identity", "webRequestInternal", "webview" ],
+               "explicit_host": [ "https://checkout.google.com/*", "https://sandbox.google.com/*", "https://www.google.com/*", "https://www.googleapis.com/*" ],
+               "manifest_permissions": [  ]
+            },
+            "content_settings": [  ],
+            "creation_flags": 137,
+            "events": [ "app.runtime.onLaunched" ],
+            "from_bookmark": false,
+            "from_webstore": true,
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "initial_keybindings_set": true,
+            "install_time": "13040559086619747",
+            "lastpingday": "13040550028882747",
+            "location": 10,
+            "manifest": {
+               "app": {
+                  "background": {
+                     "scripts": [ "craw_background.js" ]
+                  }
+               },
+               "current_locale": "en_GB",
+               "default_locale": "en",
+               "description": "Google Wallet for digital goods",
+               "display_in_launcher": false,
+               "display_in_new_tab_page": false,
+               "icons": {
+                  "128": "images/icon_128.png",
+                  "16": "images/icon_16.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrKfMnLqViEyokd1wk57FxJtW2XXpGXzIHBzv9vQI/01UsuP0IV5/lj0wx7zJ/xcibUgDeIxobvv9XD+zO1MdjMWuqJFcKuSS4Suqkje6u+pMrTSGOSHq1bmBVh0kpToN8YoJs/P/yrRd7FEtAXTaFTGxQL4C385MeXSjaQfiRiQIDAQAB",
+               "manifest_version": 2,
+               "minimum_chrome_version": "29",
+               "name": "Google Wallet",
+               "oauth2": {
+                  "auto_approve": true,
+                  "client_id": "203784468217.apps.googleusercontent.com",
+                  "scopes": [ "https://www.googleapis.com/auth/sierra", "https://www.googleapis.com/auth/sierrasandbox", "https://www.googleapis.com/auth/chromewebstore", "https://www.googleapis.com/auth/chromewebstore.readonly" ]
+               },
+               "permissions": [ "identity", "webview", "https://checkout.google.com/", "https://sandbox.google.com/checkout/", "https://www.google.com/", "https://www.googleapis.com/*" ],
+               "update_url": "https://clients2.google.com/service/update2/crx",
+               "version": "0.0.6.1"
+            },
+            "path": "nmmhkkegccagdldgiimedpiccmgmieda\\0.0.6.1_0",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "running": false,
+            "state": 1,
+            "was_installed_by_default": true
+         },
+         "pjkljhegncpnkpknbcohdijeoejaedia": {
+            "ack_external": true,
+            "active_permissions": {
+               "api": [ "notifications" ],
+               "manifest_permissions": [  ]
+            },
+            "app_launcher_ordinal": "y",
+            "content_settings": [  ],
+            "creation_flags": 137,
+            "events": [  ],
+            "from_bookmark": false,
+            "from_webstore": true,
+            "granted_permissions": {
+               "api": [ "notifications" ],
+               "manifest_permissions": [  ]
+            },
+            "incognito_content_settings": [  ],
+            "incognito_preferences": {
+
+            },
+            "install_time": "13040559088625747",
+            "lastpingday": "13040550028882747",
+            "location": 1,
+            "manifest": {
+               "app": {
+                  "launch": {
+                     "container": "tab",
+                     "web_url": "https://mail.google.com/mail/ca"
+                  },
+                  "urls": [ "*://mail.google.com/mail/ca" ]
+               },
+               "current_locale": "en_GB",
+               "default_locale": "en",
+               "description": "Fast, searchable email with less spam.",
+               "icons": {
+                  "128": "128.png"
+               },
+               "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCuGglK43iAz3J9BEYK/Mz6ZhloIMMDqQSAaf3vJt4eHbTbSDsu4WdQ9dQDRcKlg8nwQdePBt0C3PSUBtiSNSS37Z3qEGfS7LCju3h6pI1Yr9MQtxw+jUa7kXXIS09VV73pEFUT/F7c6Qe8L5ZxgAcBvXBh1Fie63qb02I9XQ/CQIDAQAB",
+               "name": "Gmail",
+               "options_page": "https://mail.google.com/mail/ca/#settings",
+               "permissions": [ "notifications" ],
+               "update_url": "http://clients2.google.com/service/update2/crx",
+               "version": "7"
+            },
+            "page_ordinal": "n",
+            "path": "pjkljhegncpnkpknbcohdijeoejaedia\\7_1",
+            "preferences": {
+
+            },
+            "regular_only_preferences": {
+
+            },
+            "state": 1,
+            "was_installed_by_default": true
+         }
+      }
+   },
+   "google": {
+      "services": {
+         "signin": {
+            "LSID": "",
+            "SID": ""
+         }
+      }
+   },
+   "intl": {
+      "accept_languages": "en-GB,en-US,en"
+   },
+   "invalidator": {
+      "client_id": "XAP6G30QHyob9Zo8hpj1aA=="
+   },
+   "media": {
+      "device_id_salt": "mKmmRGOM8msXbtxkKMl0Hw=="
+   },
+   "net": {
+      "http_server_properties": {
+         "servers": {
+            "accounts.google.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "accounts.youtube.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "apis.google.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "clients2.google.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "clients2.googleusercontent.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "developer.android.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "fonts.googleapis.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "oauth.googleusercontent.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "supports_spdy": false
+            },
+            "s.ytimg.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "ssl.google-analytics.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "ssl.gstatic.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "themes.googleusercontent.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "tools.google.com:80": {
+               "alternate_protocol": {
+                  "port": 80,
+                  "protocol_str": "quic"
+               },
+               "supports_spdy": false
+            },
+            "www.google.com:443": {
+               "alternate_protocol": {
+                  "port": 443,
+                  "protocol_str": "quic"
+               },
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            },
+            "www.youtube.com:443": {
+               "settings": {
+                  "4": 100
+               },
+               "supports_spdy": true
+            }
+         },
+         "version": 2
+      }
+   },
+   "plugins": {
+      "migrated_to_pepper_flash": true,
+      "plugins_list": [  ],
+      "removed_old_component_pepper_flash_settings": true
+   },
+   "profile": {
+      "avatar_index": 0,
+      "content_settings": {
+         "clear_on_exit_migrated": true,
+         "pattern_pairs": {
+
+         },
+         "pref_version": 1
+      },
+      "created_by_version": "33.0.1750.154",
+      "exit_type": "Crashed",
+      "exited_cleanly": true,
+      "icon_version": 2,
+      "managed_user_id": "",
+      "name": "First user"
+   },
+   "session": {
+      "restore_on_startup_migrated": true,
+      "startup_urls_migration_time": "13040559080052671"
+   },
+   "sync_promo": {
+      "startup_count": 1
+   },
+   "translate_blocked_languages": [ "en" ],
+   "translate_whitelists": {
+
+   }
+}

Разлика између датотеке није приказан због своје велике величине
+ 988 - 0
NSIS/Examples/nsJSON/Input/Preferences2.json


+ 26 - 0
NSIS/Examples/nsJSON/MultiTree.nsi

@@ -0,0 +1,26 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_MultiTree.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+Section
+
+  CreateDirectory $EXEDIR\Output
+
+  DetailPrint `Read: $EXEDIR\Input\Example1.json into Example1`
+  nsJSON::Set /tree Example1 /file $EXEDIR\Input\Example1.json
+  DetailPrint `Read: $EXEDIR\Input\Example2.json into Example2`
+  nsJSON::Set /tree Example2 /file $EXEDIR\Input\Example2.json
+
+  DetailPrint `Generate: $EXEDIR\Output\Example2.json from Example2`
+  nsJSON::Serialize /tree Example2 /format /file $EXEDIR\Output\Example2.json
+  DetailPrint `Generate: $EXEDIR\Output\Example1.json from Example1`
+  nsJSON::Serialize /tree Example1 /format /file $EXEDIR\Output\Example1.json
+
+SectionEnd

+ 46 - 0
NSIS/Examples/nsJSON/Quote.nsi

@@ -0,0 +1,46 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_Quote.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+!macro nJSON_Quote_Test Unicode Always Input
+  !if `${Always}` == true
+    nsJSON::Quote /always `${Input}`
+  !else if `${Unicode}` == true
+    nsJSON::Quote /unicode `${Input}`
+  !else
+    nsJSON::Quote `${Input}`
+  !endif
+  Pop $R0
+  !if `${Always}` == true
+    DetailPrint `${Input} -> $R0 (/always)`
+  !else if `${Unicode}` == true
+    DetailPrint `${Input} -> $R0 (/unicode)`
+  !else
+    DetailPrint `${Input} -> $R0`
+  !endif
+!macroend
+!define nJSON_Quote_Test `!insertmacro nJSON_Quote_Test false false`
+!define nJSON_Quote_Test_Unicode `!insertmacro nJSON_Quote_Test true false`
+!define nJSON_Quote_Test_Always `!insertmacro nJSON_Quote_Test false true`
+
+Section
+
+  ${nJSON_Quote_Test} `"`
+  ${nJSON_Quote_Test} `\`
+  ${nJSON_Quote_Test} `£`
+  ${nJSON_Quote_Test} `¡`
+  ${nJSON_Quote_Test} `"¡"`
+  ${nJSON_Quote_Test} `"some"text"`
+  ${nJSON_Quote_Test_Always} `"some"text"`
+  ${nJSON_Quote_Test_Unicode} `£`
+  ${nJSON_Quote_Test_Unicode} `¡`
+  ${nJSON_Quote_Test_Unicode} `"¡"`
+
+SectionEnd

+ 36 - 0
NSIS/Examples/nsJSON/Sort.nsi

@@ -0,0 +1,36 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_Sort.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+!macro nJSON_Sort_Test Options
+  nsJSON::Sort /options ${Options} /end
+  nsJSON::Get /end
+  Pop $R0
+  DetailPrint $R0
+!macroend
+!define nJSON_Sort_Test `!insertmacro nJSON_Sort_Test`
+
+Section
+
+  nsJSON::Set /value `{ "D": "X", "b": 3, "a": 22, "c" : 2, "d": "x", "y": { "f": 33, "a": 9, "n": [ 1, 5, -10, 11, "m" ] } }` /end
+
+  DetailPrint `Sorted root node values only`
+  ${nJSON_Sort_Test} 0
+
+  DetailPrint `Sorted root node values only numerically`
+  ${nJSON_Sort_Test} 2
+
+  DetailPrint `Sorted root node by keys only`
+  ${nJSON_Sort_Test} 8
+
+  DetailPrint `Sorted values numerically + recursively`
+  ${nJSON_Sort_Test} 18
+
+SectionEnd

+ 35 - 0
NSIS/Examples/nsJSON/Syntax.nsi

@@ -0,0 +1,35 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_Syntax.exe
+RequestExecutionLevel user
+ShowInstDetails show
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+!macro DoTest JSON Description
+  StrCpy $R0 ``
+  ClearErrors
+  nsJSON::Set /value `${JSON}`
+  nsJSON::Serialize
+  Pop $R0
+  DetailPrint `${Description}:`
+  DetailPrint `${JSON} -> $R0`
+  IfErrors 0 +2
+    DetailPrint `Error flag is set!`
+  DetailPrint ``
+!macroend
+
+Section
+
+  !insertmacro DoTest `{ "Input": [ { "test1": false, } ] }` `Trailing comma`
+
+  !insertmacro DoTest `{ "Input": [ { "test1": false } .? ] }` `Junk characters`
+
+  !insertmacro DoTest `{ "Input": [ { "test1": false } }` `Missing square bracket`
+
+  !insertmacro DoTest `{ "Input": [ { "test1": false ] }` `Missing curly brace`
+
+SectionEnd

+ 25 - 0
NSIS/Examples/nsJSON/UnicodeNSIS.nsi

@@ -0,0 +1,25 @@
+!include MUI2.nsh
+
+Name `nsJSON plug-in`
+OutFile nsJSON_UnicodeNSIS.exe
+RequestExecutionLevel user
+ShowInstDetails show
+Unicode true
+
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE English
+
+Section
+
+	nsJSON::Set /tree testTree testNode /value testValue
+
+	nsJSON::Get /tree testTree testNode /end
+	Pop $R0
+	DetailPrint $R0
+
+	nsJSON::Serialize /tree testTree
+	Pop $R0
+	DetailPrint $R0
+
+SectionEnd

BIN
NSIS/Plugins/amd64-unicode/EnVar.dll


BIN
NSIS/Plugins/amd64-unicode/SimpleSC.dll


+ 259 - 0
NSIS/Plugins/amd64-unicode/Source/LSASecurityControl.pas

@@ -0,0 +1,259 @@
+{
+License Agreement
+
+This content is subject to the Mozilla Public License Version 1.1 (the "License");
+You may not use this plugin except in compliance with the License. You may 
+obtain a copy of the License at http://www.mozilla.org/MPL. 
+
+Alternatively, you may redistribute this library, use and/or modify it 
+under the terms of the GNU Lesser General Public License as published 
+by the Free Software Foundation; either version 2.1 of the License, 
+or (at your option) any later version. You may obtain a copy 
+of the LGPL at www.gnu.org/copyleft. 
+
+Software distributed under the License is distributed on an "AS IS" basis, 
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+for the specific language governing rights and limitations under the License. 
+
+The original code is LSASecurityControl.pas, released April 16, 2007. 
+
+The initial developer of the original code is Rainer Döpke
+(Formerly: Rainer Budde) (https://www.speed-soft.de).
+
+SimpleSC - NSIS Service Control Plugin is written, published and maintained by
+Rainer Döpke (rainer@speed-soft.de).
+}
+unit LSASecurityControl;
+
+interface
+
+uses
+  Winapi.Windows;
+
+  function GrantPrivilege(AccountName: String; PrivilegeName: String): Integer;
+  function RemovePrivilege(AccountName: String; PrivilegeName: String): Integer;
+  function EnablePrivilege(PrivilegeName: String): Integer;
+  function DisablePrivilege(PrivilegeName: String): Integer;
+
+implementation
+
+type
+  LSA_HANDLE = Pointer;
+  TLSAHandle = LSA_HANDLE;
+
+  LSA_UNICODE_STRING = record
+    Length: Word;
+    MaximumLength: Word;
+    Buffer: PWideChar;
+  end;
+  TLSAUnicodeString = LSA_UNICODE_STRING;
+  PLSAUnicodeString = ^TLSAUnicodeString;
+
+  LSA_OBJECT_ATTRIBUTES = record
+    Length: ULONG;
+    RootDirectory: THandle;
+    ObjectName: PLSAUnicodeString;
+    Attributes: ULONG;
+    SecurityDescriptor: Pointer;
+    SecurityQualityOfService: Pointer; 
+  end;
+  TLsaObjectAttributes = LSA_OBJECT_ATTRIBUTES;
+  PLsaObjectAttributes = ^TLsaObjectAttributes;
+
+  function LsaOpenPolicy(SystemName: PLSAUnicodeString; var ObjectAttributes: TLsaObjectAttributes; DesiredAccess: ACCESS_MASK;  var PolicyHandle: LSA_HANDLE): DWORD; stdcall; external 'advapi32.dll';
+  function LsaAddAccountRights(PolicyHandle: LSA_HANDLE; AccountSid: PSID; UserRights: PLSAUnicodeString; CountOfRights: ULONG): DWORD; stdcall; external 'advapi32.dll';
+  function LsaRemoveAccountRights(PolicyHandle: LSA_HANDLE; AccountSid: PSID; AllRights: Boolean; UserRights: PLSAUnicodeString; CountOfRights: ULONG): DWORD; stdcall; external 'advapi32.dll';
+  function LsaClose(ObjectHandle: LSA_HANDLE): DWORD; stdcall; external 'advapi32.dll';
+
+
+function GetAccountSid(const AccountName: String; var Sid: PSID): Integer;
+var
+  DomainSize: LongWord;
+  SidSize: LongWord;
+  Domain: String;
+  Use: SID_NAME_USE;
+begin
+  Result := 0;
+
+  SidSize := 0;
+  DomainSize := 0;
+
+  if not LookupAccountName(nil, PChar(AccountName), nil, SidSize, nil, DomainSize, Use) and (GetLastError = ERROR_INSUFFICIENT_BUFFER) then
+  begin
+    SetLength(Domain, DomainSize);
+    Sid := AllocMem(SidSize);
+
+    if not LookupAccountName(nil, PChar(AccountName), Sid, SidSize, PChar(Domain), DomainSize, Use) then
+    begin
+      Result := GetLastError;
+      FreeMem(Sid);
+      Sid := nil;
+    end;
+  end
+  else
+    Result := GetLastError;
+end;
+
+function GrantPrivilege(AccountName: String; PrivilegeName: String): Integer;
+const
+  UNICODE_NULL = WCHAR(0);
+  POLICY_CREATE_ACCOUNT = $00000010;
+  POLICY_LOOKUP_NAMES = $00000800;
+var
+  SID: PSID;
+  PolicyHandle: TLSAHandle;
+  LSAPrivilegeName: TLSAUnicodeString;
+  LSAObjectAttributes: TLsaObjectAttributes;
+  pwszPrivilegeName: PWideChar;
+  PrivilegeNameLength: Cardinal;
+  Status: DWORD;
+begin
+  Result := 0;
+
+  GetMem(pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  StringToWideChar(PrivilegeName, pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  ZeroMemory(@LSAObjectAttributes, SizeOf(TLsaObjectAttributes));
+  PrivilegeNameLength := Length(pwszPrivilegeName);
+
+  if PrivilegeNameLength > 0 then
+  begin
+    Result := GetAccountSid(AccountName, SID);
+
+    if Result = 0 then
+    begin
+      LSAPrivilegeName.Length := PrivilegeNameLength * SizeOf(WideChar);
+      LSAPrivilegeName.MaximumLength := LSAPrivilegeName.Length + SizeOf(UNICODE_NULL);
+      LSAPrivilegeName.Buffer := pwszPrivilegeName;
+
+      Status := LsaOpenPolicy(nil, LSAObjectAttributes, POLICY_LOOKUP_NAMES or POLICY_CREATE_ACCOUNT, PolicyHandle);
+      try
+        if Status = 0 then
+          Result := LsaAddAccountRights(PolicyHandle, Sid, @LSAPrivilegeName, 1)
+        else
+          Result := Status;
+      finally
+        LsaClose(PolicyHandle);
+      end;
+    end;
+
+  end;
+    
+  FreeMem(pwszPrivilegeName);
+end;
+
+function RemovePrivilege(AccountName: String; PrivilegeName: String): Integer;
+const
+  UNICODE_NULL = WCHAR(0);
+  POLICY_CREATE_ACCOUNT = $00000010;
+  POLICY_LOOKUP_NAMES = $00000800;
+var
+  SID: PSID;
+  PolicyHandle: TLSAHandle;
+  LSAPrivilegeName: TLSAUnicodeString;
+  LSAObjectAttributes: TLsaObjectAttributes;
+  pwszPrivilegeName: PWideChar;
+  PrivilegeNameLength: Cardinal;
+  Status: DWORD;
+begin
+  Result := 0;
+
+  GetMem(pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  StringToWideChar(PrivilegeName, pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  ZeroMemory(@LSAObjectAttributes, SizeOf(TLsaObjectAttributes));
+  PrivilegeNameLength := Length(pwszPrivilegeName);
+
+  if PrivilegeNameLength > 0 then
+  begin
+    Result := GetAccountSid(AccountName, SID);
+
+    if Result = 0 then
+    begin
+      LSAPrivilegeName.Length := PrivilegeNameLength * SizeOf(WideChar);
+      LSAPrivilegeName.MaximumLength := LSAPrivilegeName.Length + SizeOf(UNICODE_NULL);
+      LSAPrivilegeName.Buffer := pwszPrivilegeName;
+
+      Status := LsaOpenPolicy(nil, LSAObjectAttributes, POLICY_LOOKUP_NAMES or POLICY_CREATE_ACCOUNT, PolicyHandle);
+
+      try
+        if Status = 0 then
+          Result := LsaRemoveAccountRights(PolicyHandle, Sid, False, @LSAPrivilegeName, 1)
+        else
+          Result := Status;
+      finally
+        LsaClose(PolicyHandle);
+      end;
+    end;
+
+  end;
+    
+  FreeMem(pwszPrivilegeName);
+end;
+
+function EnablePrivilege(PrivilegeName: String): Integer;
+var
+  TokenHandle: THandle;
+  TokenPrivileges: TOKEN_PRIVILEGES;
+  PreviousState: TOKEN_PRIVILEGES;
+  ReturnLength: Cardinal;
+begin
+  Result := 0;
+
+  if OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TokenHandle) then
+  begin
+    try
+
+      if LookupPrivilegeValue(nil, PWideChar(PrivilegeName), TokenPrivileges.Privileges[0].Luid) then
+      begin
+        TokenPrivileges.PrivilegeCount := 1;
+        TokenPrivileges.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
+
+        if not AdjustTokenPrivileges(TokenHandle, False, TokenPrivileges, SizeOf(TokenPrivileges), PreviousState, ReturnLength) then
+          Result := System.GetLastError;
+      end
+      else
+        Result := System.GetLastError;
+
+    finally
+      CloseHandle(TokenHandle);
+    end;
+  end
+  else
+    Result := System.GetLastError;
+
+end;
+
+function DisablePrivilege(PrivilegeName: String): Integer;
+var
+  TokenHandle: THandle;
+  TokenPrivileges: TOKEN_PRIVILEGES;
+  PreviousState: TOKEN_PRIVILEGES;
+  ReturnLength: Cardinal;
+begin
+
+  Result := 0;
+
+  if OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TokenHandle) then
+  begin
+    try
+
+      if LookupPrivilegeValue(nil, PWideChar(PrivilegeName), TokenPrivileges.Privileges[0].Luid) then
+      begin
+        TokenPrivileges.PrivilegeCount := 1;
+        TokenPrivileges.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
+
+        if not AdjustTokenPrivileges(TokenHandle, False, TokenPrivileges, SizeOf(TokenPrivileges), PreviousState, ReturnLength) then
+          Result := System.GetLastError;
+      end
+      else
+        Result := System.GetLastError;
+
+    finally
+      CloseHandle(TokenHandle);
+    end;
+  end
+  else
+    Result := System.GetLastError;
+
+end;
+
+end.

+ 36 - 0
NSIS/Plugins/amd64-unicode/Source/NSIS Plugins.groupproj

@@ -0,0 +1,36 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{0AF40426-B62C-4F43-8B49-19A70AEA0832}</ProjectGuid>
+    </PropertyGroup>
+    <ItemGroup>
+        <Projects Include="SimpleSC.dproj">
+            <Dependencies/>
+        </Projects>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Default.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Default.Personality/>
+        </BorlandProject>
+    </ProjectExtensions>
+    <Target Name="SimpleSC">
+        <MSBuild Projects="SimpleSC.dproj"/>
+    </Target>
+    <Target Name="SimpleSC:Clean">
+        <MSBuild Projects="SimpleSC.dproj" Targets="Clean"/>
+    </Target>
+    <Target Name="SimpleSC:Make">
+        <MSBuild Projects="SimpleSC.dproj" Targets="Make"/>
+    </Target>
+    <Target Name="Build">
+        <CallTarget Targets="SimpleSC"/>
+    </Target>
+    <Target Name="Clean">
+        <CallTarget Targets="SimpleSC:Clean"/>
+    </Target>
+    <Target Name="Make">
+        <CallTarget Targets="SimpleSC:Make"/>
+    </Target>
+    <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
+</Project>

+ 209 - 0
NSIS/Plugins/amd64-unicode/Source/NSIS.pas

@@ -0,0 +1,209 @@
+{
+    Original Code from
+    (C) 2001 - Peter Windridge
+
+    Code in separate unit and some changes
+    2003 by Bernhard Mayer
+
+    Fixed and formatted by Brett Dever
+    http://editor.nfscheats.com/
+
+    simply include this unit in your plugin project and export
+    functions as needed
+}
+
+unit nsis;
+
+interface
+
+uses
+  Winapi.Windows, Winapi.CommCtrl, System.SysUtils;
+
+type
+  VarConstants = (
+    INST_0,       // $0
+    INST_1,       // $1
+    INST_2,       // $2
+    INST_3,       // $3
+    INST_4,       // $4
+    INST_5,       // $5
+    INST_6,       // $6
+    INST_7,       // $7
+    INST_8,       // $8
+    INST_9,       // $9
+    INST_R0,      // $R0
+    INST_R1,      // $R1
+    INST_R2,      // $R2
+    INST_R3,      // $R3
+    INST_R4,      // $R4
+    INST_R5,      // $R5
+    INST_R6,      // $R6
+    INST_R7,      // $R7
+    INST_R8,      // $R8
+    INST_R9,      // $R9
+    INST_CMDLINE, // $CMDLINE
+    INST_INSTDIR, // $INSTDIR
+    INST_OUTDIR,  // $OUTDIR
+    INST_EXEDIR,  // $EXEDIR
+    INST_LANG,    // $LANGUAGE
+    __INST_LAST
+    );
+  TVariableList = INST_0..__INST_LAST;
+
+type
+  PluginCallbackMessages = (
+    NSPIM_UNLOAD,   // This is the last message a plugin gets, do final cleanup
+    NSPIM_GUIUNLOAD // Called after .onGUIEnd
+    );
+  TNSPIM = NSPIM_UNLOAD..NSPIM_GUIUNLOAD;
+
+  //TPluginCallback = function (const NSPIM: Integer): Pointer; cdecl;
+
+  TExecuteCodeSegment = function (const funct_id: Integer; const parent: HWND): Integer;  stdcall;
+  Tvalidate_filename = procedure (const filename: PChar); stdcall;
+  TRegisterPluginCallback = function (const DllInstance: HMODULE; const CallbackFunction: Pointer): Integer; stdcall;
+
+  pexec_flags_t = ^exec_flags_t;
+  exec_flags_t = record
+    autoclose: Integer;
+    all_user_var: Integer;
+    exec_error: Integer;
+    abort: Integer;
+    exec_reboot: Integer;
+    reboot_called: Integer;
+    XXX_cur_insttype: Integer;
+    plugin_api_version: Integer;
+    silent: Integer;
+    instdir_error: Integer;
+    rtl: Integer;
+    errlvl: Integer;
+    alter_reg_view: Integer;
+    status_update: Integer;
+  end;
+
+  pextrap_t = ^extrap_t;
+  extrap_t = record
+    exec_flags: Pointer; // exec_flags_t;
+    exec_code_segment: TExecuteCodeSegment; //  TFarProc;
+    validate_filename: Pointer; // Tvalidate_filename;
+    RegisterPluginCallback: Pointer; //TRegisterPluginCallback;
+  end;
+
+  pstack_t = ^stack_t;
+  stack_t = record
+    next: pstack_t;
+    text: PChar;
+  end;
+
+var
+  g_stringsize: integer;
+  g_stacktop: ^pstack_t;
+  g_variables: PChar;
+  g_hwndParent: HWND;
+  g_hwndList: HWND;
+  g_hwndLogList: HWND;
+  g_extraparameters: pextrap_t;
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+
+function LogMessage(Msg : String): BOOL;
+function Call(NSIS_func : String) : Integer;
+function PopString(): string;
+procedure PushString(const str: string='');
+function GetUserVariable(const varnum: TVariableList): string;
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+
+implementation
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+begin
+  g_stringsize := string_size;
+  g_hwndParent := hwndParent;
+  g_stacktop   := stacktop;
+  g_variables  := variables;
+  g_hwndList   := FindWindowEx(FindWindowEx(g_hwndParent, 0, '#32770', nil), 0,'SysListView32', nil);
+  g_extraparameters := extraparameters;
+end;
+
+
+function Call(NSIS_func : String) : Integer;
+var
+  codeoffset: Integer; //The ID of nsis function
+begin
+  Result := 0;
+  codeoffset := StrToIntDef(NSIS_func, 0);
+  if (codeoffset <> 0) and (g_extraparameters <> nil) then
+    begin
+    codeoffset := codeoffset - 1;
+    Result := g_extraparameters.exec_code_segment(codeoffset, g_hwndParent);
+    end;
+end;
+
+function LogMessage(Msg : String): BOOL;
+var
+  ItemCount : Integer;
+  item: TLVItem;
+begin
+  Result := FAlse;
+  if g_hwndList = 0 then exit;
+  FillChar( item, sizeof(item), 0 );
+  ItemCount := SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
+  item.iItem := ItemCount;
+  item.mask := LVIF_TEXT;
+  item.pszText := PChar(Msg);
+  ListView_InsertItem(g_hwndList, item);
+  ListView_EnsureVisible(g_hwndList, ItemCount, TRUE);
+end;
+
+function PopString(): string;
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop^) <> 0 then begin
+    th := g_stacktop^;
+    Result := PChar(@th.text);
+    g_stacktop^ := th.next;
+    GlobalFree(HGLOBAL(th));
+  end;
+end;
+
+procedure PushString(const str: string='');
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop) <> 0 then begin
+    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + g_stringsize));
+    lstrcpyn(@th.text, PChar(str), g_stringsize);
+    th.next := g_stacktop^;
+    g_stacktop^ := th;
+  end;
+end;
+
+function GetUserVariable(const varnum: TVariableList): string;
+begin
+  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    Result := g_variables + integer(varnum) * g_stringsize
+  else
+    Result := '';
+end;
+
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+begin
+  if (value <> '') and (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    lstrcpy(g_variables + integer(varnum) * g_stringsize, PChar(value))
+end;
+
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+var
+  hwndOwner: HWND;
+begin
+  hwndOwner := g_hwndParent;
+  if not IsWindow(g_hwndParent) then hwndOwner := 0; // g_hwndParent is not valid in NSPIM_[GUI]UNLOAD
+  MessageBox(hwndOwner, PChar(text), PChar(caption), buttons);
+end;
+
+begin
+
+end.
+

Разлика између датотеке није приказан због своје велике величине
+ 1382 - 0
NSIS/Plugins/amd64-unicode/Source/ServiceControl.pas


+ 609 - 0
NSIS/Plugins/amd64-unicode/Source/SimpleSC.dpr

@@ -0,0 +1,609 @@
+library SimpleSC;
+
+uses
+  Winapi.Windows,
+  System.SysUtils,
+  NSIS in 'NSIS.pas',
+  ServiceControl in 'ServiceControl.pas',
+  LSASecurityControl in 'LSASecurityControl.pas';
+
+function BoolToStr(Value: Boolean): String;
+begin
+  if Value then
+    Result := '1'
+  else
+    Result := '0';
+end;
+
+function StrToBool(Value: String): Boolean;
+begin
+  Result := Value = '1';
+end;
+
+procedure InstallService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DisplayName: String;
+  ServiceType: Cardinal;
+  StartType: Cardinal;
+  BinaryPath: String;
+  Dependencies: String;
+  Username: String;
+  Password: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  DisplayName := PopString;
+  ServiceType := StrToInt(PopString);
+  StartType := StrToInt(PopString);
+  BinaryPath := PopString;
+  Dependencies := PopString;
+  Username := PopString;
+  Password := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.InstallService(ServiceName, DisplayName, ServiceType, StartType, BinaryPath, Dependencies, Username, Password));
+  PushString(ServiceResult);
+end;
+
+procedure RemoveService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.RemoveService(ServiceName));
+  PushString(ServiceResult);
+end;
+
+procedure StartService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceArguments: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceArguments := PopString;
+  Timeout := StrToInt(PopString);
+
+  ServiceResult := IntToStr(ServiceControl.StartService(ServiceName, ServiceArguments, Timeout));
+
+  PushString(ServiceResult);
+end;
+
+procedure StopService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  WaitForFileRelease: Boolean;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  WaitForFileRelease := StrToBool(PopString);
+  Timeout := StrToInt(PopString);
+
+  ServiceResult := IntToStr(ServiceControl.StopService(ServiceName, WaitForFileRelease, Timeout));
+  PushString(ServiceResult);
+end;
+
+procedure PauseService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.PauseService(ServiceName, Timeout));
+  PushString(ServiceResult)
+end;
+
+procedure ContinueService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.ContinueService(ServiceName, Timeout));
+  PushString(ServiceResult)
+end;
+
+procedure GetServiceName(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+Var
+  DisplayName: String;
+  ServiceResult: String;
+  ServiceName: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  DisplayName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceName(DisplayName, ServiceName));
+  PushString(ServiceName);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDisplayName(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+Var
+  ServiceName: String;
+  DisplayName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDisplayName(ServiceName, DisplayName));
+  PushString(DisplayName);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceStatus(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Status: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceStatus(ServiceName, Status));
+  PushString(IntToStr(Status));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceBinaryPath(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  BinaryPath: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceBinaryPath(ServiceName, BinaryPath));
+  PushString(BinaryPath);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDescription(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Description: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDescription(ServiceName, Description));
+  PushString(Description);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceStartType(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  StartType: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceStartType(ServiceName, StartType));
+  PushString(IntToStr(StartType));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceLogon(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Username: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceLogon(ServiceName, Username));
+  PushString(Username);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceFailure(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ResetPeriod: DWORD;
+  RebootMessage: String;
+  Command: String;
+  Action1: Integer;
+  ActionDelay1: DWORD;
+  Action2: Integer;
+  ActionDelay2: DWORD;
+  Action3: Integer;
+  ActionDelay3: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceFailure(ServiceName, ResetPeriod, RebootMessage, Command, Action1, ActionDelay1, Action2, ActionDelay2, Action3, ActionDelay3));
+  PushString(IntToStr(ActionDelay3));
+  PushString(IntToStr(Action3));
+  PushString(IntToStr(ActionDelay2));
+  PushString(IntToStr(Action2));
+  PushString(IntToStr(ActionDelay1));
+  PushString(IntToStr(Action1));
+  PushString(Command);
+  PushString(RebootMessage);
+  PushString(IntToStr(ResetPeriod));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceFailureFlag(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  FailureActionsOnNonCrashFailures: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceFailureFlag(ServiceName, FailureActionsOnNonCrashFailures));
+  PushString(BoolToStr(FailureActionsOnNonCrashFailures));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDelayedAutoStartInfo(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DelayedAutostart: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDelayedAutoStartInfo(ServiceName, DelayedAutostart));
+  PushString(BoolToStr(DelayedAutostart));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceDescription(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Description: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Description := PopString;
+  ServiceResult := IntToStr(ServiceControl.SetServiceDescription(ServiceName, Description));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceStartType(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceStartType: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceStartType := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceStartType(ServiceName, ServiceStartType));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceLogon(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Username: String;
+  Password: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Username := PopString;
+  Password := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.SetServiceLogon(ServiceName, Username, Password));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceBinaryPath(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  BinaryPath: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  BinaryPath := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.SetServiceBinaryPath(ServiceName, BinaryPath));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceFailure(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ResetPeriod: DWORD;
+  RebootMessage: String;
+  Command: String;
+  Action1: Integer;
+  ActionDelay1: DWORD;
+  Action2: Integer;
+  ActionDelay2: DWORD;
+  Action3: Integer;
+  ActionDelay3: DWORD;
+  ServiceResult: Integer;
+  PrivilegeResult: Integer;
+const
+  SE_SHUTDOWN_PRIVILEGE = 'SeShutdownPrivilege';
+  SC_ACTION_REBOOT = 2;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ResetPeriod := StrToInt(PopString);
+  RebootMessage := PopString;
+  Command := PopString;
+  Action1 := StrToInt(PopString);
+  ActionDelay1 := StrToInt(PopString);
+  Action2 := StrToInt(PopString);
+  ActionDelay2 := StrToInt(PopString);
+  Action3 := StrToInt(PopString);
+  ActionDelay3 := StrToInt(PopString);
+
+  if (Action1 = SC_ACTION_REBOOT) or (Action2 = SC_ACTION_REBOOT) or (Action3 = SC_ACTION_REBOOT) then
+  begin
+    PrivilegeResult := LSASecurityControl.EnablePrivilege(SE_SHUTDOWN_PRIVILEGE);
+
+    if not PrivilegeResult = 0 then
+    begin
+      PushString(IntToStr(PrivilegeResult));
+      Exit;
+    end;
+  end;
+
+  ServiceResult := ServiceControl.SetServiceFailure(ServiceName, ResetPeriod, RebootMessage, Command, Action1, ActionDelay1,
+                                                    Action2, ActionDelay2, Action3, ActionDelay3);
+
+
+  if (Action1 = SC_ACTION_REBOOT) or (Action2 = SC_ACTION_REBOOT) or (Action3 = SC_ACTION_REBOOT) then
+  begin
+    PrivilegeResult := LSASecurityControl.DisablePrivilege(SE_SHUTDOWN_PRIVILEGE);
+
+    if not PrivilegeResult = 0 then
+    begin
+      PushString(IntToStr(PrivilegeResult));
+      Exit;
+    end;
+  end;
+
+  PushString(IntToStr(ServiceResult));
+
+end;
+
+procedure SetServiceFailureFlag(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  FailureActionsOnNonCrashFailures: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  FailureActionsOnNonCrashFailures := StrToBool(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceFailureFlag(ServiceName, FailureActionsOnNonCrashFailures));
+  PushString(ServiceResult)
+end;
+
+procedure SetServiceDelayedAutoStartInfo(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DelayedAutostart: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  DelayedAutostart := StrToBool(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceDelayedAutoStartInfo(ServiceName, DelayedAutostart));
+  PushString(ServiceResult)
+end;
+
+procedure ServiceIsRunning(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsRunning: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsRunning(ServiceName, IsRunning));
+  PushString(BoolToStr(IsRunning));
+  PushString(ServiceResult);
+end;
+
+procedure ServiceIsStopped(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsStopped: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsStopped(ServiceName, IsStopped));
+  PushString(BoolToStr(IsStopped));
+  PushString(ServiceResult);
+end;
+
+procedure ServiceIsPaused(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsPaused: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsPaused(ServiceName, IsPaused));
+  PushString(BoolToStr(IsPaused));
+  PushString(ServiceResult);
+end;
+
+procedure RestartService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceArguments: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceArguments := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.RestartService(ServiceName, ServiceArguments, Timeout));
+  PushString(ServiceResult);
+end;
+
+procedure ExistsService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.ExistsService(ServiceName));
+  PushString(ServiceResult);
+end;
+
+procedure GrantServiceLogonPrivilege(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  AccountName: String;
+  LSAResult: String;
+const
+  SE_SERVICE_LOGON_RIGHT = 'SeServiceLogonRight';
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  AccountName := PopString;
+
+  LSAResult := IntToStr(LSASecurityControl.GrantPrivilege(AccountName, SE_SERVICE_LOGON_RIGHT));
+  PushString(LSAResult);
+end;
+
+procedure RemoveServiceLogonPrivilege(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  AccountName: String;
+  LSAResult: String;
+const
+  SE_SERVICE_LOGON_RIGHT = 'SeServiceLogonRight';
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  AccountName := PopString;
+
+  LSAResult := IntToStr(LSASecurityControl.RemovePrivilege(AccountName, SE_SERVICE_LOGON_RIGHT));
+  PushString(LSAResult);
+end;
+
+procedure GetErrorMessage(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ErrorCode: Integer;
+  ErrorMessage: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ErrorCode := StrToInt(PopString);
+
+  ErrorMessage := ServiceControl.GetErrorMessage(ErrorCode);
+  PushString(ErrorMessage);
+end;
+
+exports InstallService;
+exports ExistsService;
+exports RemoveService;
+exports StartService;
+exports StopService;
+exports PauseService;
+exports ContinueService;
+exports GetServiceName;
+exports GetServiceDisplayName;
+exports GetServiceStatus;
+exports GetServiceBinaryPath;
+exports GetServiceDescription;
+exports GetServiceStartType;
+exports GetServiceLogon;
+exports GetServiceFailure;
+exports GetServiceFailureFlag;
+exports GetServiceDelayedAutoStartInfo;
+exports SetServiceDescription;
+exports SetServiceStartType;
+exports SetServiceLogon;
+exports SetServiceBinaryPath;
+exports SetServiceFailure;
+exports SetServiceFailureFlag;
+exports SetServiceDelayedAutoStartInfo;
+exports ServiceIsRunning;
+exports ServiceIsStopped;
+exports ServiceIsPaused;
+exports RestartService;
+exports GrantServiceLogonPrivilege;
+exports RemoveServiceLogonPrivilege;
+exports GetErrorMessage;
+
+end.

+ 910 - 0
NSIS/Plugins/amd64-unicode/Source/SimpleSC.dproj

@@ -0,0 +1,910 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{9A1C1FE1-FB44-40C4-9E22-99CAE6325532}</ProjectGuid>
+        <ProjectVersion>18.8</ProjectVersion>
+        <FrameworkType>None</FrameworkType>
+        <MainSource>SimpleSC.dpr</MainSource>
+        <Base>True</Base>
+        <Config Condition="'$(Config)'==''">Release</Config>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+        <TargetedPlatforms>1</TargetedPlatforms>
+        <AppType>Library</AppType>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+        <Base_Win32>true</Base_Win32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+        <Base_Win64>true</Base_Win64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+        <Cfg_2>true</Cfg_2>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+        <Cfg_2_Win32>true</Cfg_2_Win32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base)'!=''">
+        <DCC_UsePackage>bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;bindengine;soaprtl;DBXOracleDriver;dsnap;DBXInformixDriver;IndyCore;fmxase;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IPIndyImpl;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+        <GenDll>true</GenDll>
+        <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+        <DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+        <DCC_E>false</DCC_E>
+        <DCC_N>false</DCC_N>
+        <DCC_S>false</DCC_S>
+        <DCC_F>false</DCC_F>
+        <DCC_K>false</DCC_K>
+        <SanitizedProjectName>SimpleSC</SanitizedProjectName>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win32)'!=''">
+        <Manifest_File>None</Manifest_File>
+        <DCC_ExeOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_ExeOutput>
+        <DCC_DcuOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_DcuOutput>
+        <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+        <DCC_UsePackage>frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;DBXOdbcDriver;svnui;ibxpress;DBXSybaseASEDriver;vclimg;frxDB16;intrawebdb_120_160;fmi;fs16;TeeUI;vclactnband;FMXTee;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;Intraweb_120_160;DBXDb2Driver;websnap;vclribbon;frxe16;fsDB16;vcl;DataSnapConnectors;CloudService;DBXMSSQLDriver;FmxTeeUI;dsnapcon;vclx;webdsnap;svn;bdertl;CodeSiteExpressPkg;adortl;vcldbx;VclSmp;$(DCC_UsePackage)</DCC_UsePackage>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win64)'!=''">
+        <DCC_UsePackage>DBXOdbcDriver;DBXSybaseASEDriver;vclimg;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;DBXDb2Driver;websnap;vcl;DBXMSSQLDriver;dsnapcon;vclx;webdsnap;VclSmp;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2)'!=''">
+        <Manifest_File>None</Manifest_File>
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+        <DCC_ImportedDataReferences>false</DCC_ImportedDataReferences>
+        <VerInfo_Locale>1031</VerInfo_Locale>
+        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+        <DCC_DebugInformation>0</DCC_DebugInformation>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+        <DCC_ExeOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_ExeOutput>
+        <DCC_DcuOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_DcuOutput>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <Manifest_File>(Ohne)</Manifest_File>
+    </PropertyGroup>
+    <ItemGroup>
+        <DelphiCompile Include="$(MainSource)">
+            <MainSource>MainSource</MainSource>
+        </DelphiCompile>
+        <DCCReference Include="NSIS.pas"/>
+        <DCCReference Include="ServiceControl.pas"/>
+        <DCCReference Include="LSASecurityControl.pas"/>
+        <BuildConfiguration Include="Release">
+            <Key>Cfg_2</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Base">
+            <Key>Base</Key>
+        </BuildConfiguration>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Delphi.Personality>
+                <VersionInfo>
+                    <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+                    <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+                    <VersionInfo Name="MajorVer">1</VersionInfo>
+                    <VersionInfo Name="MinorVer">0</VersionInfo>
+                    <VersionInfo Name="Release">0</VersionInfo>
+                    <VersionInfo Name="Build">0</VersionInfo>
+                    <VersionInfo Name="Debug">False</VersionInfo>
+                    <VersionInfo Name="PreRelease">False</VersionInfo>
+                    <VersionInfo Name="Special">False</VersionInfo>
+                    <VersionInfo Name="Private">False</VersionInfo>
+                    <VersionInfo Name="DLL">False</VersionInfo>
+                    <VersionInfo Name="Locale">1031</VersionInfo>
+                    <VersionInfo Name="CodePage">1252</VersionInfo>
+                </VersionInfo>
+                <VersionInfoKeys>
+                    <VersionInfoKeys Name="CompanyName"/>
+                    <VersionInfoKeys Name="FileDescription"/>
+                    <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="InternalName"/>
+                    <VersionInfoKeys Name="LegalCopyright"/>
+                    <VersionInfoKeys Name="LegalTrademarks"/>
+                    <VersionInfoKeys Name="OriginalFilename"/>
+                    <VersionInfoKeys Name="ProductName"/>
+                    <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="Comments"/>
+                </VersionInfoKeys>
+                <Source>
+                    <Source Name="MainSource">SimpleSC.dpr</Source>
+                </Source>
+                <Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
+                </Excluded_Packages>
+            </Delphi.Personality>
+            <Deployment Version="3">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployClass Name="AdditionalDebugSymbols">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidClassesDexFile">
+                    <Platform Name="Android">
+                        <RemoteDir>classes</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>classes</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidFileProvider">
+                    <Platform Name="Android">
+                        <RemoteDir>res\xml</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\xml</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidGDBServer">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeArmeabiFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeArmeabiv7aFile">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeMipsFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\mips</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\mips</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidServiceOutput">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidServiceOutput_Android32">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashImageDef">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStyles">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStylesV21">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values-v21</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values-v21</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_Colors">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_DefaultAppIcon">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon144">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon96">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon24">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon96">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage426">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-small</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-small</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage470">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage640">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage960">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_Strings">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DebugSymbols">
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyFramework">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.framework</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.framework</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyModule">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.dll;.bpl</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Required="true" Name="DependencyPackage">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.bpl</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="File">
+                    <Platform Name="Android">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1024x768">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1536x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668x2388">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048x1536">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048x2732">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2224">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2388x1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2732x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch768x1024">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1125">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1136x640">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242x2688">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1334">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1792">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2208">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2436">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2688x1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch320">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640x1136">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch750">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch828">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectAndroidManifest">
+                    <Platform Name="Android">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceDebug">
+                    <Platform Name="iOSDevice32">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceResourceRules"/>
+                <DeployClass Name="ProjectiOSEntitlements"/>
+                <DeployClass Name="ProjectiOSInfoPList"/>
+                <DeployClass Name="ProjectiOSResource">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOSXDebug"/>
+                <DeployClass Name="ProjectOSXEntitlements"/>
+                <DeployClass Name="ProjectOSXInfoPList"/>
+                <DeployClass Name="ProjectOSXResource">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\Resources</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <RemoteDir>Contents\Resources</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Required="true" Name="ProjectOutput">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Linux64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOutput_Android32">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectUWPManifest">
+                    <Platform Name="Win32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="UWP_DelphiLogo150">
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="UWP_DelphiLogo44">
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
+            </Deployment>
+            <Platforms>
+                <Platform value="Win32">True</Platform>
+                <Platform value="Win64">False</Platform>
+            </Platforms>
+            <ModelSupport>False</ModelSupport>
+        </BorlandProject>
+        <ProjectFileVersion>12</ProjectFileVersion>
+    </ProjectExtensions>
+    <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+    <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
+</Project>

BIN
NSIS/Plugins/amd64-unicode/Source/SimpleSC.res


BIN
NSIS/Plugins/amd64-unicode/nsJSON.dll


+ 21 - 0
NSIS/Plugins/plugin.bat

@@ -0,0 +1,21 @@
+@ECHO OFF
+
+set name=%~1
+set encoding=unicode
+if "%~2" == "ansi" set encoding=ansi
+
+upx --all-methods --compress-icons=0 Win32\Release\%name%
+SET ERROR=%ERRORLEVEL%
+if %ERRORLEVEL% == 2 SET ERROR=0
+if not %ERROR% == 0 pause > NUL
+
+upx --all-methods --compress-icons=0 Win64\Release\%name%
+SET ERROR=%ERRORLEVEL%
+if %ERRORLEVEL% == 2 SET ERROR=0
+if not %ERROR% == 0 pause > NUL
+
+echo Copiyng %encoding% files
+if not exist ".\x86-%encoding%" mkdir ".\x86-%encoding%"
+if not exist ".\x64-%encoding%" mkdir ".\x64-%encoding%"
+copy /Y "Win32\Release\%name%" ".\x86-%encoding%\"
+copy /Y "Win64\Release\%name%" ".\x64-%encoding%\"

+ 3 - 0
NSIS/Plugins/process_ansi.bat

@@ -0,0 +1,3 @@
+@ECHO OFF
+
+call plugin nsMySQL.dll ansi

+ 3 - 0
NSIS/Plugins/process_unicode.bat

@@ -0,0 +1,3 @@
+@ECHO OFF
+
+call plugin nsMySQL.dll unicode

BIN
NSIS/Plugins/x64-ansi/nsMySQL.dll


BIN
NSIS/Plugins/x64-unicode/nsMySQL.dll


BIN
NSIS/Plugins/x86-ansi/EnVar.dll


BIN
NSIS/Plugins/x86-ansi/nsJSON.dll


BIN
NSIS/Plugins/x86-ansi/nsMySQL.dll


BIN
NSIS/Plugins/x86-unicode/EnVar.dll


BIN
NSIS/Plugins/x86-unicode/SimpleSC.dll


+ 259 - 0
NSIS/Plugins/x86-unicode/Source/LSASecurityControl.pas

@@ -0,0 +1,259 @@
+{
+License Agreement
+
+This content is subject to the Mozilla Public License Version 1.1 (the "License");
+You may not use this plugin except in compliance with the License. You may 
+obtain a copy of the License at http://www.mozilla.org/MPL. 
+
+Alternatively, you may redistribute this library, use and/or modify it 
+under the terms of the GNU Lesser General Public License as published 
+by the Free Software Foundation; either version 2.1 of the License, 
+or (at your option) any later version. You may obtain a copy 
+of the LGPL at www.gnu.org/copyleft. 
+
+Software distributed under the License is distributed on an "AS IS" basis, 
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
+for the specific language governing rights and limitations under the License. 
+
+The original code is LSASecurityControl.pas, released April 16, 2007. 
+
+The initial developer of the original code is Rainer Döpke
+(Formerly: Rainer Budde) (https://www.speed-soft.de).
+
+SimpleSC - NSIS Service Control Plugin is written, published and maintained by
+Rainer Döpke (rainer@speed-soft.de).
+}
+unit LSASecurityControl;
+
+interface
+
+uses
+  Winapi.Windows;
+
+  function GrantPrivilege(AccountName: String; PrivilegeName: String): Integer;
+  function RemovePrivilege(AccountName: String; PrivilegeName: String): Integer;
+  function EnablePrivilege(PrivilegeName: String): Integer;
+  function DisablePrivilege(PrivilegeName: String): Integer;
+
+implementation
+
+type
+  LSA_HANDLE = Pointer;
+  TLSAHandle = LSA_HANDLE;
+
+  LSA_UNICODE_STRING = record
+    Length: Word;
+    MaximumLength: Word;
+    Buffer: PWideChar;
+  end;
+  TLSAUnicodeString = LSA_UNICODE_STRING;
+  PLSAUnicodeString = ^TLSAUnicodeString;
+
+  LSA_OBJECT_ATTRIBUTES = record
+    Length: ULONG;
+    RootDirectory: THandle;
+    ObjectName: PLSAUnicodeString;
+    Attributes: ULONG;
+    SecurityDescriptor: Pointer;
+    SecurityQualityOfService: Pointer; 
+  end;
+  TLsaObjectAttributes = LSA_OBJECT_ATTRIBUTES;
+  PLsaObjectAttributes = ^TLsaObjectAttributes;
+
+  function LsaOpenPolicy(SystemName: PLSAUnicodeString; var ObjectAttributes: TLsaObjectAttributes; DesiredAccess: ACCESS_MASK;  var PolicyHandle: LSA_HANDLE): DWORD; stdcall; external 'advapi32.dll';
+  function LsaAddAccountRights(PolicyHandle: LSA_HANDLE; AccountSid: PSID; UserRights: PLSAUnicodeString; CountOfRights: ULONG): DWORD; stdcall; external 'advapi32.dll';
+  function LsaRemoveAccountRights(PolicyHandle: LSA_HANDLE; AccountSid: PSID; AllRights: Boolean; UserRights: PLSAUnicodeString; CountOfRights: ULONG): DWORD; stdcall; external 'advapi32.dll';
+  function LsaClose(ObjectHandle: LSA_HANDLE): DWORD; stdcall; external 'advapi32.dll';
+
+
+function GetAccountSid(const AccountName: String; var Sid: PSID): Integer;
+var
+  DomainSize: LongWord;
+  SidSize: LongWord;
+  Domain: String;
+  Use: SID_NAME_USE;
+begin
+  Result := 0;
+
+  SidSize := 0;
+  DomainSize := 0;
+
+  if not LookupAccountName(nil, PChar(AccountName), nil, SidSize, nil, DomainSize, Use) and (GetLastError = ERROR_INSUFFICIENT_BUFFER) then
+  begin
+    SetLength(Domain, DomainSize);
+    Sid := AllocMem(SidSize);
+
+    if not LookupAccountName(nil, PChar(AccountName), Sid, SidSize, PChar(Domain), DomainSize, Use) then
+    begin
+      Result := GetLastError;
+      FreeMem(Sid);
+      Sid := nil;
+    end;
+  end
+  else
+    Result := GetLastError;
+end;
+
+function GrantPrivilege(AccountName: String; PrivilegeName: String): Integer;
+const
+  UNICODE_NULL = WCHAR(0);
+  POLICY_CREATE_ACCOUNT = $00000010;
+  POLICY_LOOKUP_NAMES = $00000800;
+var
+  SID: PSID;
+  PolicyHandle: TLSAHandle;
+  LSAPrivilegeName: TLSAUnicodeString;
+  LSAObjectAttributes: TLsaObjectAttributes;
+  pwszPrivilegeName: PWideChar;
+  PrivilegeNameLength: Cardinal;
+  Status: DWORD;
+begin
+  Result := 0;
+
+  GetMem(pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  StringToWideChar(PrivilegeName, pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  ZeroMemory(@LSAObjectAttributes, SizeOf(TLsaObjectAttributes));
+  PrivilegeNameLength := Length(pwszPrivilegeName);
+
+  if PrivilegeNameLength > 0 then
+  begin
+    Result := GetAccountSid(AccountName, SID);
+
+    if Result = 0 then
+    begin
+      LSAPrivilegeName.Length := PrivilegeNameLength * SizeOf(WideChar);
+      LSAPrivilegeName.MaximumLength := LSAPrivilegeName.Length + SizeOf(UNICODE_NULL);
+      LSAPrivilegeName.Buffer := pwszPrivilegeName;
+
+      Status := LsaOpenPolicy(nil, LSAObjectAttributes, POLICY_LOOKUP_NAMES or POLICY_CREATE_ACCOUNT, PolicyHandle);
+      try
+        if Status = 0 then
+          Result := LsaAddAccountRights(PolicyHandle, Sid, @LSAPrivilegeName, 1)
+        else
+          Result := Status;
+      finally
+        LsaClose(PolicyHandle);
+      end;
+    end;
+
+  end;
+    
+  FreeMem(pwszPrivilegeName);
+end;
+
+function RemovePrivilege(AccountName: String; PrivilegeName: String): Integer;
+const
+  UNICODE_NULL = WCHAR(0);
+  POLICY_CREATE_ACCOUNT = $00000010;
+  POLICY_LOOKUP_NAMES = $00000800;
+var
+  SID: PSID;
+  PolicyHandle: TLSAHandle;
+  LSAPrivilegeName: TLSAUnicodeString;
+  LSAObjectAttributes: TLsaObjectAttributes;
+  pwszPrivilegeName: PWideChar;
+  PrivilegeNameLength: Cardinal;
+  Status: DWORD;
+begin
+  Result := 0;
+
+  GetMem(pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  StringToWideChar(PrivilegeName, pwszPrivilegeName, Length(PrivilegeName) * SizeOf(WideChar) + 1);
+  ZeroMemory(@LSAObjectAttributes, SizeOf(TLsaObjectAttributes));
+  PrivilegeNameLength := Length(pwszPrivilegeName);
+
+  if PrivilegeNameLength > 0 then
+  begin
+    Result := GetAccountSid(AccountName, SID);
+
+    if Result = 0 then
+    begin
+      LSAPrivilegeName.Length := PrivilegeNameLength * SizeOf(WideChar);
+      LSAPrivilegeName.MaximumLength := LSAPrivilegeName.Length + SizeOf(UNICODE_NULL);
+      LSAPrivilegeName.Buffer := pwszPrivilegeName;
+
+      Status := LsaOpenPolicy(nil, LSAObjectAttributes, POLICY_LOOKUP_NAMES or POLICY_CREATE_ACCOUNT, PolicyHandle);
+
+      try
+        if Status = 0 then
+          Result := LsaRemoveAccountRights(PolicyHandle, Sid, False, @LSAPrivilegeName, 1)
+        else
+          Result := Status;
+      finally
+        LsaClose(PolicyHandle);
+      end;
+    end;
+
+  end;
+    
+  FreeMem(pwszPrivilegeName);
+end;
+
+function EnablePrivilege(PrivilegeName: String): Integer;
+var
+  TokenHandle: THandle;
+  TokenPrivileges: TOKEN_PRIVILEGES;
+  PreviousState: TOKEN_PRIVILEGES;
+  ReturnLength: Cardinal;
+begin
+  Result := 0;
+
+  if OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TokenHandle) then
+  begin
+    try
+
+      if LookupPrivilegeValue(nil, PWideChar(PrivilegeName), TokenPrivileges.Privileges[0].Luid) then
+      begin
+        TokenPrivileges.PrivilegeCount := 1;
+        TokenPrivileges.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
+
+        if not AdjustTokenPrivileges(TokenHandle, False, TokenPrivileges, SizeOf(TokenPrivileges), PreviousState, ReturnLength) then
+          Result := System.GetLastError;
+      end
+      else
+        Result := System.GetLastError;
+
+    finally
+      CloseHandle(TokenHandle);
+    end;
+  end
+  else
+    Result := System.GetLastError;
+
+end;
+
+function DisablePrivilege(PrivilegeName: String): Integer;
+var
+  TokenHandle: THandle;
+  TokenPrivileges: TOKEN_PRIVILEGES;
+  PreviousState: TOKEN_PRIVILEGES;
+  ReturnLength: Cardinal;
+begin
+
+  Result := 0;
+
+  if OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, TokenHandle) then
+  begin
+    try
+
+      if LookupPrivilegeValue(nil, PWideChar(PrivilegeName), TokenPrivileges.Privileges[0].Luid) then
+      begin
+        TokenPrivileges.PrivilegeCount := 1;
+        TokenPrivileges.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
+
+        if not AdjustTokenPrivileges(TokenHandle, False, TokenPrivileges, SizeOf(TokenPrivileges), PreviousState, ReturnLength) then
+          Result := System.GetLastError;
+      end
+      else
+        Result := System.GetLastError;
+
+    finally
+      CloseHandle(TokenHandle);
+    end;
+  end
+  else
+    Result := System.GetLastError;
+
+end;
+
+end.

+ 36 - 0
NSIS/Plugins/x86-unicode/Source/NSIS Plugins.groupproj

@@ -0,0 +1,36 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{0AF40426-B62C-4F43-8B49-19A70AEA0832}</ProjectGuid>
+    </PropertyGroup>
+    <ItemGroup>
+        <Projects Include="SimpleSC.dproj">
+            <Dependencies/>
+        </Projects>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Default.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Default.Personality/>
+        </BorlandProject>
+    </ProjectExtensions>
+    <Target Name="SimpleSC">
+        <MSBuild Projects="SimpleSC.dproj"/>
+    </Target>
+    <Target Name="SimpleSC:Clean">
+        <MSBuild Projects="SimpleSC.dproj" Targets="Clean"/>
+    </Target>
+    <Target Name="SimpleSC:Make">
+        <MSBuild Projects="SimpleSC.dproj" Targets="Make"/>
+    </Target>
+    <Target Name="Build">
+        <CallTarget Targets="SimpleSC"/>
+    </Target>
+    <Target Name="Clean">
+        <CallTarget Targets="SimpleSC:Clean"/>
+    </Target>
+    <Target Name="Make">
+        <CallTarget Targets="SimpleSC:Make"/>
+    </Target>
+    <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
+</Project>

+ 209 - 0
NSIS/Plugins/x86-unicode/Source/NSIS.pas

@@ -0,0 +1,209 @@
+{
+    Original Code from
+    (C) 2001 - Peter Windridge
+
+    Code in separate unit and some changes
+    2003 by Bernhard Mayer
+
+    Fixed and formatted by Brett Dever
+    http://editor.nfscheats.com/
+
+    simply include this unit in your plugin project and export
+    functions as needed
+}
+
+unit nsis;
+
+interface
+
+uses
+  Winapi.Windows, Winapi.CommCtrl, System.SysUtils;
+
+type
+  VarConstants = (
+    INST_0,       // $0
+    INST_1,       // $1
+    INST_2,       // $2
+    INST_3,       // $3
+    INST_4,       // $4
+    INST_5,       // $5
+    INST_6,       // $6
+    INST_7,       // $7
+    INST_8,       // $8
+    INST_9,       // $9
+    INST_R0,      // $R0
+    INST_R1,      // $R1
+    INST_R2,      // $R2
+    INST_R3,      // $R3
+    INST_R4,      // $R4
+    INST_R5,      // $R5
+    INST_R6,      // $R6
+    INST_R7,      // $R7
+    INST_R8,      // $R8
+    INST_R9,      // $R9
+    INST_CMDLINE, // $CMDLINE
+    INST_INSTDIR, // $INSTDIR
+    INST_OUTDIR,  // $OUTDIR
+    INST_EXEDIR,  // $EXEDIR
+    INST_LANG,    // $LANGUAGE
+    __INST_LAST
+    );
+  TVariableList = INST_0..__INST_LAST;
+
+type
+  PluginCallbackMessages = (
+    NSPIM_UNLOAD,   // This is the last message a plugin gets, do final cleanup
+    NSPIM_GUIUNLOAD // Called after .onGUIEnd
+    );
+  TNSPIM = NSPIM_UNLOAD..NSPIM_GUIUNLOAD;
+
+  //TPluginCallback = function (const NSPIM: Integer): Pointer; cdecl;
+
+  TExecuteCodeSegment = function (const funct_id: Integer; const parent: HWND): Integer;  stdcall;
+  Tvalidate_filename = procedure (const filename: PChar); stdcall;
+  TRegisterPluginCallback = function (const DllInstance: HMODULE; const CallbackFunction: Pointer): Integer; stdcall;
+
+  pexec_flags_t = ^exec_flags_t;
+  exec_flags_t = record
+    autoclose: Integer;
+    all_user_var: Integer;
+    exec_error: Integer;
+    abort: Integer;
+    exec_reboot: Integer;
+    reboot_called: Integer;
+    XXX_cur_insttype: Integer;
+    plugin_api_version: Integer;
+    silent: Integer;
+    instdir_error: Integer;
+    rtl: Integer;
+    errlvl: Integer;
+    alter_reg_view: Integer;
+    status_update: Integer;
+  end;
+
+  pextrap_t = ^extrap_t;
+  extrap_t = record
+    exec_flags: Pointer; // exec_flags_t;
+    exec_code_segment: TExecuteCodeSegment; //  TFarProc;
+    validate_filename: Pointer; // Tvalidate_filename;
+    RegisterPluginCallback: Pointer; //TRegisterPluginCallback;
+  end;
+
+  pstack_t = ^stack_t;
+  stack_t = record
+    next: pstack_t;
+    text: PChar;
+  end;
+
+var
+  g_stringsize: integer;
+  g_stacktop: ^pstack_t;
+  g_variables: PChar;
+  g_hwndParent: HWND;
+  g_hwndList: HWND;
+  g_hwndLogList: HWND;
+  g_extraparameters: pextrap_t;
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+
+function LogMessage(Msg : String): BOOL;
+function Call(NSIS_func : String) : Integer;
+function PopString(): string;
+procedure PushString(const str: string='');
+function GetUserVariable(const varnum: TVariableList): string;
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+
+implementation
+
+procedure Init(const hwndParent: HWND; const string_size: integer; const variables: PChar; const stacktop: pointer; const extraparameters: pointer = nil);
+begin
+  g_stringsize := string_size;
+  g_hwndParent := hwndParent;
+  g_stacktop   := stacktop;
+  g_variables  := variables;
+  g_hwndList   := FindWindowEx(FindWindowEx(g_hwndParent, 0, '#32770', nil), 0,'SysListView32', nil);
+  g_extraparameters := extraparameters;
+end;
+
+
+function Call(NSIS_func : String) : Integer;
+var
+  codeoffset: Integer; //The ID of nsis function
+begin
+  Result := 0;
+  codeoffset := StrToIntDef(NSIS_func, 0);
+  if (codeoffset <> 0) and (g_extraparameters <> nil) then
+    begin
+    codeoffset := codeoffset - 1;
+    Result := g_extraparameters.exec_code_segment(codeoffset, g_hwndParent);
+    end;
+end;
+
+function LogMessage(Msg : String): BOOL;
+var
+  ItemCount : Integer;
+  item: TLVItem;
+begin
+  Result := FAlse;
+  if g_hwndList = 0 then exit;
+  FillChar( item, sizeof(item), 0 );
+  ItemCount := SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
+  item.iItem := ItemCount;
+  item.mask := LVIF_TEXT;
+  item.pszText := PChar(Msg);
+  ListView_InsertItem(g_hwndList, item);
+  ListView_EnsureVisible(g_hwndList, ItemCount, TRUE);
+end;
+
+function PopString(): string;
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop^) <> 0 then begin
+    th := g_stacktop^;
+    Result := PChar(@th.text);
+    g_stacktop^ := th.next;
+    GlobalFree(HGLOBAL(th));
+  end;
+end;
+
+procedure PushString(const str: string='');
+var
+  th: pstack_t;
+begin
+  if integer(g_stacktop) <> 0 then begin
+    th := pstack_t(GlobalAlloc(GPTR, SizeOf(stack_t) + g_stringsize));
+    lstrcpyn(@th.text, PChar(str), g_stringsize);
+    th.next := g_stacktop^;
+    g_stacktop^ := th;
+  end;
+end;
+
+function GetUserVariable(const varnum: TVariableList): string;
+begin
+  if (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    Result := g_variables + integer(varnum) * g_stringsize
+  else
+    Result := '';
+end;
+
+procedure SetUserVariable(const varnum: TVariableList; const value: string);
+begin
+  if (value <> '') and (integer(varnum) >= 0) and (integer(varnum) < integer(__INST_LAST)) then
+    lstrcpy(g_variables + integer(varnum) * g_stringsize, PChar(value))
+end;
+
+procedure NSISDialog(const text, caption: string; const buttons: integer);
+var
+  hwndOwner: HWND;
+begin
+  hwndOwner := g_hwndParent;
+  if not IsWindow(g_hwndParent) then hwndOwner := 0; // g_hwndParent is not valid in NSPIM_[GUI]UNLOAD
+  MessageBox(hwndOwner, PChar(text), PChar(caption), buttons);
+end;
+
+begin
+
+end.
+

Разлика између датотеке није приказан због своје велике величине
+ 1382 - 0
NSIS/Plugins/x86-unicode/Source/ServiceControl.pas


+ 609 - 0
NSIS/Plugins/x86-unicode/Source/SimpleSC.dpr

@@ -0,0 +1,609 @@
+library SimpleSC;
+
+uses
+  Winapi.Windows,
+  System.SysUtils,
+  NSIS in 'NSIS.pas',
+  ServiceControl in 'ServiceControl.pas',
+  LSASecurityControl in 'LSASecurityControl.pas';
+
+function BoolToStr(Value: Boolean): String;
+begin
+  if Value then
+    Result := '1'
+  else
+    Result := '0';
+end;
+
+function StrToBool(Value: String): Boolean;
+begin
+  Result := Value = '1';
+end;
+
+procedure InstallService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DisplayName: String;
+  ServiceType: Cardinal;
+  StartType: Cardinal;
+  BinaryPath: String;
+  Dependencies: String;
+  Username: String;
+  Password: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  DisplayName := PopString;
+  ServiceType := StrToInt(PopString);
+  StartType := StrToInt(PopString);
+  BinaryPath := PopString;
+  Dependencies := PopString;
+  Username := PopString;
+  Password := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.InstallService(ServiceName, DisplayName, ServiceType, StartType, BinaryPath, Dependencies, Username, Password));
+  PushString(ServiceResult);
+end;
+
+procedure RemoveService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.RemoveService(ServiceName));
+  PushString(ServiceResult);
+end;
+
+procedure StartService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceArguments: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceArguments := PopString;
+  Timeout := StrToInt(PopString);
+
+  ServiceResult := IntToStr(ServiceControl.StartService(ServiceName, ServiceArguments, Timeout));
+
+  PushString(ServiceResult);
+end;
+
+procedure StopService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  WaitForFileRelease: Boolean;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  WaitForFileRelease := StrToBool(PopString);
+  Timeout := StrToInt(PopString);
+
+  ServiceResult := IntToStr(ServiceControl.StopService(ServiceName, WaitForFileRelease, Timeout));
+  PushString(ServiceResult);
+end;
+
+procedure PauseService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.PauseService(ServiceName, Timeout));
+  PushString(ServiceResult)
+end;
+
+procedure ContinueService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.ContinueService(ServiceName, Timeout));
+  PushString(ServiceResult)
+end;
+
+procedure GetServiceName(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+Var
+  DisplayName: String;
+  ServiceResult: String;
+  ServiceName: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  DisplayName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceName(DisplayName, ServiceName));
+  PushString(ServiceName);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDisplayName(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+Var
+  ServiceName: String;
+  DisplayName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDisplayName(ServiceName, DisplayName));
+  PushString(DisplayName);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceStatus(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Status: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceStatus(ServiceName, Status));
+  PushString(IntToStr(Status));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceBinaryPath(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  BinaryPath: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceBinaryPath(ServiceName, BinaryPath));
+  PushString(BinaryPath);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDescription(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Description: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDescription(ServiceName, Description));
+  PushString(Description);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceStartType(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  StartType: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceStartType(ServiceName, StartType));
+  PushString(IntToStr(StartType));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceLogon(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Username: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceLogon(ServiceName, Username));
+  PushString(Username);
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceFailure(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ResetPeriod: DWORD;
+  RebootMessage: String;
+  Command: String;
+  Action1: Integer;
+  ActionDelay1: DWORD;
+  Action2: Integer;
+  ActionDelay2: DWORD;
+  Action3: Integer;
+  ActionDelay3: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceFailure(ServiceName, ResetPeriod, RebootMessage, Command, Action1, ActionDelay1, Action2, ActionDelay2, Action3, ActionDelay3));
+  PushString(IntToStr(ActionDelay3));
+  PushString(IntToStr(Action3));
+  PushString(IntToStr(ActionDelay2));
+  PushString(IntToStr(Action2));
+  PushString(IntToStr(ActionDelay1));
+  PushString(IntToStr(Action1));
+  PushString(Command);
+  PushString(RebootMessage);
+  PushString(IntToStr(ResetPeriod));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceFailureFlag(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  FailureActionsOnNonCrashFailures: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceFailureFlag(ServiceName, FailureActionsOnNonCrashFailures));
+  PushString(BoolToStr(FailureActionsOnNonCrashFailures));
+  PushString(ServiceResult);
+end;
+
+procedure GetServiceDelayedAutoStartInfo(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DelayedAutostart: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.GetServiceDelayedAutoStartInfo(ServiceName, DelayedAutostart));
+  PushString(BoolToStr(DelayedAutostart));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceDescription(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Description: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Description := PopString;
+  ServiceResult := IntToStr(ServiceControl.SetServiceDescription(ServiceName, Description));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceStartType(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceStartType: DWORD;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceStartType := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceStartType(ServiceName, ServiceStartType));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceLogon(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  Username: String;
+  Password: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  Username := PopString;
+  Password := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.SetServiceLogon(ServiceName, Username, Password));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceBinaryPath(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  BinaryPath: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  BinaryPath := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.SetServiceBinaryPath(ServiceName, BinaryPath));
+  PushString(ServiceResult);
+end;
+
+procedure SetServiceFailure(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ResetPeriod: DWORD;
+  RebootMessage: String;
+  Command: String;
+  Action1: Integer;
+  ActionDelay1: DWORD;
+  Action2: Integer;
+  ActionDelay2: DWORD;
+  Action3: Integer;
+  ActionDelay3: DWORD;
+  ServiceResult: Integer;
+  PrivilegeResult: Integer;
+const
+  SE_SHUTDOWN_PRIVILEGE = 'SeShutdownPrivilege';
+  SC_ACTION_REBOOT = 2;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ResetPeriod := StrToInt(PopString);
+  RebootMessage := PopString;
+  Command := PopString;
+  Action1 := StrToInt(PopString);
+  ActionDelay1 := StrToInt(PopString);
+  Action2 := StrToInt(PopString);
+  ActionDelay2 := StrToInt(PopString);
+  Action3 := StrToInt(PopString);
+  ActionDelay3 := StrToInt(PopString);
+
+  if (Action1 = SC_ACTION_REBOOT) or (Action2 = SC_ACTION_REBOOT) or (Action3 = SC_ACTION_REBOOT) then
+  begin
+    PrivilegeResult := LSASecurityControl.EnablePrivilege(SE_SHUTDOWN_PRIVILEGE);
+
+    if not PrivilegeResult = 0 then
+    begin
+      PushString(IntToStr(PrivilegeResult));
+      Exit;
+    end;
+  end;
+
+  ServiceResult := ServiceControl.SetServiceFailure(ServiceName, ResetPeriod, RebootMessage, Command, Action1, ActionDelay1,
+                                                    Action2, ActionDelay2, Action3, ActionDelay3);
+
+
+  if (Action1 = SC_ACTION_REBOOT) or (Action2 = SC_ACTION_REBOOT) or (Action3 = SC_ACTION_REBOOT) then
+  begin
+    PrivilegeResult := LSASecurityControl.DisablePrivilege(SE_SHUTDOWN_PRIVILEGE);
+
+    if not PrivilegeResult = 0 then
+    begin
+      PushString(IntToStr(PrivilegeResult));
+      Exit;
+    end;
+  end;
+
+  PushString(IntToStr(ServiceResult));
+
+end;
+
+procedure SetServiceFailureFlag(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  FailureActionsOnNonCrashFailures: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  FailureActionsOnNonCrashFailures := StrToBool(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceFailureFlag(ServiceName, FailureActionsOnNonCrashFailures));
+  PushString(ServiceResult)
+end;
+
+procedure SetServiceDelayedAutoStartInfo(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  DelayedAutostart: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  DelayedAutostart := StrToBool(PopString);
+  ServiceResult := IntToStr(ServiceControl.SetServiceDelayedAutoStartInfo(ServiceName, DelayedAutostart));
+  PushString(ServiceResult)
+end;
+
+procedure ServiceIsRunning(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsRunning: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsRunning(ServiceName, IsRunning));
+  PushString(BoolToStr(IsRunning));
+  PushString(ServiceResult);
+end;
+
+procedure ServiceIsStopped(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsStopped: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsStopped(ServiceName, IsStopped));
+  PushString(BoolToStr(IsStopped));
+  PushString(ServiceResult);
+end;
+
+procedure ServiceIsPaused(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  IsPaused: Boolean;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceResult := IntToStr(ServiceControl.ServiceIsPaused(ServiceName, IsPaused));
+  PushString(BoolToStr(IsPaused));
+  PushString(ServiceResult);
+end;
+
+procedure RestartService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceArguments: String;
+  Timeout: Integer;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+  ServiceArguments := PopString;
+  Timeout := StrToInt(PopString);
+  ServiceResult := IntToStr(ServiceControl.RestartService(ServiceName, ServiceArguments, Timeout));
+  PushString(ServiceResult);
+end;
+
+procedure ExistsService(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ServiceName: String;
+  ServiceResult: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ServiceName := PopString;
+
+  ServiceResult := IntToStr(ServiceControl.ExistsService(ServiceName));
+  PushString(ServiceResult);
+end;
+
+procedure GrantServiceLogonPrivilege(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  AccountName: String;
+  LSAResult: String;
+const
+  SE_SERVICE_LOGON_RIGHT = 'SeServiceLogonRight';
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  AccountName := PopString;
+
+  LSAResult := IntToStr(LSASecurityControl.GrantPrivilege(AccountName, SE_SERVICE_LOGON_RIGHT));
+  PushString(LSAResult);
+end;
+
+procedure RemoveServiceLogonPrivilege(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  AccountName: String;
+  LSAResult: String;
+const
+  SE_SERVICE_LOGON_RIGHT = 'SeServiceLogonRight';
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  AccountName := PopString;
+
+  LSAResult := IntToStr(LSASecurityControl.RemovePrivilege(AccountName, SE_SERVICE_LOGON_RIGHT));
+  PushString(LSAResult);
+end;
+
+procedure GetErrorMessage(const hwndParent: HWND; const string_size: integer;
+  const variables: PChar; const stacktop: pointer); cdecl;
+var
+  ErrorCode: Integer;
+  ErrorMessage: String;
+begin
+  Init(hwndParent, string_size, variables, stacktop);
+
+  ErrorCode := StrToInt(PopString);
+
+  ErrorMessage := ServiceControl.GetErrorMessage(ErrorCode);
+  PushString(ErrorMessage);
+end;
+
+exports InstallService;
+exports ExistsService;
+exports RemoveService;
+exports StartService;
+exports StopService;
+exports PauseService;
+exports ContinueService;
+exports GetServiceName;
+exports GetServiceDisplayName;
+exports GetServiceStatus;
+exports GetServiceBinaryPath;
+exports GetServiceDescription;
+exports GetServiceStartType;
+exports GetServiceLogon;
+exports GetServiceFailure;
+exports GetServiceFailureFlag;
+exports GetServiceDelayedAutoStartInfo;
+exports SetServiceDescription;
+exports SetServiceStartType;
+exports SetServiceLogon;
+exports SetServiceBinaryPath;
+exports SetServiceFailure;
+exports SetServiceFailureFlag;
+exports SetServiceDelayedAutoStartInfo;
+exports ServiceIsRunning;
+exports ServiceIsStopped;
+exports ServiceIsPaused;
+exports RestartService;
+exports GrantServiceLogonPrivilege;
+exports RemoveServiceLogonPrivilege;
+exports GetErrorMessage;
+
+end.

+ 910 - 0
NSIS/Plugins/x86-unicode/Source/SimpleSC.dproj

@@ -0,0 +1,910 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{9A1C1FE1-FB44-40C4-9E22-99CAE6325532}</ProjectGuid>
+        <ProjectVersion>18.8</ProjectVersion>
+        <FrameworkType>None</FrameworkType>
+        <MainSource>SimpleSC.dpr</MainSource>
+        <Base>True</Base>
+        <Config Condition="'$(Config)'==''">Release</Config>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
+        <TargetedPlatforms>1</TargetedPlatforms>
+        <AppType>Library</AppType>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+        <Base_Win32>true</Base_Win32>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+        <Base_Win64>true</Base_Win64>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+        <Cfg_2>true</Cfg_2>
+        <CfgParent>Base</CfgParent>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
+        <Cfg_2_Win32>true</Cfg_2_Win32>
+        <CfgParent>Cfg_2</CfgParent>
+        <Cfg_2>true</Cfg_2>
+        <Base>true</Base>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base)'!=''">
+        <DCC_UsePackage>bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;bindengine;soaprtl;DBXOracleDriver;dsnap;DBXInformixDriver;IndyCore;fmxase;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IPIndyImpl;$(DCC_UsePackage)</DCC_UsePackage>
+        <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+        <GenDll>true</GenDll>
+        <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+        <DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+        <DCC_E>false</DCC_E>
+        <DCC_N>false</DCC_N>
+        <DCC_S>false</DCC_S>
+        <DCC_F>false</DCC_F>
+        <DCC_K>false</DCC_K>
+        <SanitizedProjectName>SimpleSC</SanitizedProjectName>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win32)'!=''">
+        <Manifest_File>None</Manifest_File>
+        <DCC_ExeOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_ExeOutput>
+        <DCC_DcuOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_DcuOutput>
+        <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+        <DCC_UsePackage>frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;DBXOdbcDriver;svnui;ibxpress;DBXSybaseASEDriver;vclimg;frxDB16;intrawebdb_120_160;fmi;fs16;TeeUI;vclactnband;FMXTee;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;Intraweb_120_160;DBXDb2Driver;websnap;vclribbon;frxe16;fsDB16;vcl;DataSnapConnectors;CloudService;DBXMSSQLDriver;FmxTeeUI;dsnapcon;vclx;webdsnap;svn;bdertl;CodeSiteExpressPkg;adortl;vcldbx;VclSmp;$(DCC_UsePackage)</DCC_UsePackage>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Base_Win64)'!=''">
+        <DCC_UsePackage>DBXOdbcDriver;DBXSybaseASEDriver;vclimg;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;DBXDb2Driver;websnap;vcl;DBXMSSQLDriver;dsnapcon;vclx;webdsnap;VclSmp;$(DCC_UsePackage)</DCC_UsePackage>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2)'!=''">
+        <Manifest_File>None</Manifest_File>
+        <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+        <DCC_ImportedDataReferences>false</DCC_ImportedDataReferences>
+        <VerInfo_Locale>1031</VerInfo_Locale>
+        <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+        <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+        <DCC_DebugInformation>0</DCC_DebugInformation>
+    </PropertyGroup>
+    <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
+        <DCC_ExeOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_ExeOutput>
+        <DCC_DcuOutput>C:\Developing\NSIS Simple Service Control - Unicode\</DCC_DcuOutput>
+        <VerInfo_Locale>1033</VerInfo_Locale>
+        <Manifest_File>(Ohne)</Manifest_File>
+    </PropertyGroup>
+    <ItemGroup>
+        <DelphiCompile Include="$(MainSource)">
+            <MainSource>MainSource</MainSource>
+        </DelphiCompile>
+        <DCCReference Include="NSIS.pas"/>
+        <DCCReference Include="ServiceControl.pas"/>
+        <DCCReference Include="LSASecurityControl.pas"/>
+        <BuildConfiguration Include="Release">
+            <Key>Cfg_2</Key>
+            <CfgParent>Base</CfgParent>
+        </BuildConfiguration>
+        <BuildConfiguration Include="Base">
+            <Key>Base</Key>
+        </BuildConfiguration>
+    </ItemGroup>
+    <ProjectExtensions>
+        <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+        <Borland.ProjectType/>
+        <BorlandProject>
+            <Delphi.Personality>
+                <VersionInfo>
+                    <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+                    <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+                    <VersionInfo Name="MajorVer">1</VersionInfo>
+                    <VersionInfo Name="MinorVer">0</VersionInfo>
+                    <VersionInfo Name="Release">0</VersionInfo>
+                    <VersionInfo Name="Build">0</VersionInfo>
+                    <VersionInfo Name="Debug">False</VersionInfo>
+                    <VersionInfo Name="PreRelease">False</VersionInfo>
+                    <VersionInfo Name="Special">False</VersionInfo>
+                    <VersionInfo Name="Private">False</VersionInfo>
+                    <VersionInfo Name="DLL">False</VersionInfo>
+                    <VersionInfo Name="Locale">1031</VersionInfo>
+                    <VersionInfo Name="CodePage">1252</VersionInfo>
+                </VersionInfo>
+                <VersionInfoKeys>
+                    <VersionInfoKeys Name="CompanyName"/>
+                    <VersionInfoKeys Name="FileDescription"/>
+                    <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="InternalName"/>
+                    <VersionInfoKeys Name="LegalCopyright"/>
+                    <VersionInfoKeys Name="LegalTrademarks"/>
+                    <VersionInfoKeys Name="OriginalFilename"/>
+                    <VersionInfoKeys Name="ProductName"/>
+                    <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+                    <VersionInfoKeys Name="Comments"/>
+                </VersionInfoKeys>
+                <Source>
+                    <Source Name="MainSource">SimpleSC.dpr</Source>
+                </Source>
+                <Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
+                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
+                </Excluded_Packages>
+            </Delphi.Personality>
+            <Deployment Version="3">
+                <DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="OSX32">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
+                    <Platform Name="iOSSimulator">
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
+                <DeployClass Name="AdditionalDebugSymbols">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidClassesDexFile">
+                    <Platform Name="Android">
+                        <RemoteDir>classes</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>classes</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidFileProvider">
+                    <Platform Name="Android">
+                        <RemoteDir>res\xml</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\xml</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidGDBServer">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeArmeabiFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeArmeabiv7aFile">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidLibnativeMipsFile">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\mips</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\mips</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidServiceOutput">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidServiceOutput_Android32">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashImageDef">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStyles">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="AndroidSplashStylesV21">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values-v21</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values-v21</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_Colors">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_DefaultAppIcon">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon144">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-ldpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_LauncherIcon96">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon24">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-mdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon36">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-hdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon48">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon72">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_NotificationIcon96">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage426">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-small</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-small</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage470">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-normal</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage640">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-large</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_SplashImage960">
+                    <Platform Name="Android">
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\drawable-xlarge</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="Android_Strings">
+                    <Platform Name="Android">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>res\values</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DebugSymbols">
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyFramework">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.framework</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.framework</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="DependencyModule">
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.dll;.bpl</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Required="true" Name="DependencyPackage">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                        <Extensions>.dylib</Extensions>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                        <Extensions>.bpl</Extensions>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="File">
+                    <Platform Name="Android">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>0</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1024x768">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1536x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668x2388">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048x1536">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048x2732">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2224">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2388x1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2732x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch768x1024">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1125">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1136x640">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242x2688">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1334">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1792">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2208">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2436">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2688x1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch320">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch640x1136">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch750">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch828">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectAndroidManifest">
+                    <Platform Name="Android">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceDebug">
+                    <Platform Name="iOSDevice32">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectiOSDeviceResourceRules"/>
+                <DeployClass Name="ProjectiOSEntitlements"/>
+                <DeployClass Name="ProjectiOSInfoPList"/>
+                <DeployClass Name="ProjectiOSResource">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOSXDebug"/>
+                <DeployClass Name="ProjectOSXEntitlements"/>
+                <DeployClass Name="ProjectOSXInfoPList"/>
+                <DeployClass Name="ProjectOSXResource">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\Resources</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <RemoteDir>Contents\Resources</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Required="true" Name="ProjectOutput">
+                    <Platform Name="Android">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Linux64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="OSX64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win32">
+                        <Operation>0</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectOutput_Android32">
+                    <Platform Name="Android64">
+                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="ProjectUWPManifest">
+                    <Platform Name="Win32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="UWP_DelphiLogo150">
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="UWP_DelphiLogo44">
+                    <Platform Name="Win32">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="Win64">
+                        <RemoteDir>Assets</RemoteDir>
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
+                <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
+                <ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
+            </Deployment>
+            <Platforms>
+                <Platform value="Win32">True</Platform>
+                <Platform value="Win64">False</Platform>
+            </Platforms>
+            <ModelSupport>False</ModelSupport>
+        </BorlandProject>
+        <ProjectFileVersion>12</ProjectFileVersion>
+    </ProjectExtensions>
+    <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+    <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
+</Project>

+ 0 - 0
NSIS/Plugins/x86-unicode/Source/SimpleSC.res


Неке датотеке нису приказане због велике количине промена