Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

centralized version management, providing iisnode_version to the app

  • Loading branch information...
commit 0c9934ae22559a725f768737829527ae53b3b041 1 parent c0badfb
@tjanczuk tjanczuk authored
View
3  .gitignore
@@ -8,4 +8,5 @@ ipch/
*.suo
*.user
log.out
-*.js.logs
+*.js.logs
+version_autogenerated.*
View
8 src/iisnode/cnodeprocess.cpp
@@ -97,10 +97,10 @@ HRESULT CNodeProcess::Initialize(IHttpContext* context)
do {
while (*(currentEnvironment + environmentSize++) != 0);
} while (*(currentEnvironment + environmentSize++) != 0);
- ErrorIf(NULL == (newEnvironment = (LPCH)new char[environmentSize + 256 + 1 + 1]), ERROR_NOT_ENOUGH_MEMORY);
- _tcscpy(newEnvironment, _T("PORT="));
- _tcscat(newEnvironment, this->namedPipe);
- memcpy(newEnvironment + 6 + strlen(this->namedPipe), currentEnvironment, environmentSize);
+ ErrorIf(NULL == (newEnvironment = (LPCH)new char[environmentSize + 256]), ERROR_NOT_ENOUGH_MEMORY);
+ sprintf(newEnvironment, "PORT=%s", this->namedPipe);
+ sprintf(newEnvironment + 6 + strlen(this->namedPipe), "IISNODE_VERSION=%s", IISNODE_VERSION);
+ memcpy(newEnvironment + 6 + strlen(this->namedPipe) + 17 + strlen(IISNODE_VERSION), currentEnvironment, environmentSize);
FreeEnvironmentStrings(currentEnvironment);
currentEnvironment = NULL;
View
13 src/iisnode/iisnode.vcxproj
@@ -105,6 +105,9 @@ copy /y $(SolutionDir)\..\config\* $(SolutionDir)\..\..\build\$(Configuration)\$
<BuildLog>
<Path>$(IntDir)\$(MSBuildProjectName).log</Path>
</BuildLog>
+ <PreBuildEvent>
+ <Command>"$(ProjectDir)\scripts\genVersionHeader.bat" &gt; "$(ProjectDir)\version_autogenerated.h"</Command>
+ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -136,6 +139,9 @@ copy /y $(SolutionDir)\..\config\* $(SolutionDir)\..\..\build\$(Configuration)\$
<BuildLog>
<Path>$(IntDir)\$(MSBuildProjectName).log</Path>
</BuildLog>
+ <PreBuildEvent>
+ <Command>"$(ProjectDir)\scripts\genVersionHeader.bat" &gt; "$(ProjectDir)\version_autogenerated.h"</Command>
+ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
@@ -160,6 +166,9 @@ copy /y $(SolutionDir)\..\config\* $(SolutionDir)\..\..\build\$(Configuration)\$
<BuildLog>
<Path>$(IntDir)\$(MSBuildProjectName).log</Path>
</BuildLog>
+ <PreBuildEvent>
+ <Command>"$(ProjectDir)\scripts\genVersionHeader.bat" &gt; "$(ProjectDir)\version_autogenerated.h"</Command>
+ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -184,6 +193,9 @@ copy /y $(SolutionDir)\..\config\* $(SolutionDir)\..\..\build\$(Configuration)\$
<BuildLog>
<Path>$(IntDir)\$(MSBuildProjectName).log</Path>
</BuildLog>
+ <PreBuildEvent>
+ <Command>"$(ProjectDir)\scripts\genVersionHeader.bat" &gt; "$(ProjectDir)\version_autogenerated.h"</Command>
+ </PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="cactiverequestpool.cpp" />
@@ -292,6 +304,7 @@ copy /y $(SolutionDir)\..\config\* $(SolutionDir)\..\..\build\$(Configuration)\$
<ClInclude Include="cprotocolbridge.h" />
<ClInclude Include="precomp.h" />
<ClInclude Include="utils.h" />
+ <ClInclude Include="version_autogenerated.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
View
3  src/iisnode/iisnode.vcxproj.filters
@@ -182,6 +182,9 @@
<ClInclude Include="cfilewatcher.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="version_autogenerated.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="iisnode.def">
View
2  src/iisnode/precomp.h
@@ -12,6 +12,8 @@
#include <queue>
#include <list>
+#include "version_autogenerated.h" // this is generated in the pre-build step
+
// IIS7 Server API header file
#include "httpserv.h"
View
3  src/iisnode/scripts/genVersionHeader.bat
@@ -0,0 +1,3 @@
+@echo off
+for /F "tokens=*" %%i in (%~dp0\..\..\version.txt) do set IISNODE_VERSION=%%i
+echo #define IISNODE_VERSION ^"%IISNODE_VERSION%^"
View
2  src/samples/helloworld/hello.js
@@ -2,5 +2,5 @@ var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
- res.end('Hello, world! [helloworld sample]');
+ res.end('Hello, world! [helloworld sample; iisnode version is ' + process.env.IISNODE_VERSION + ']');
}).listen(process.env.PORT);
View
3  src/setup/iisnode-express-msi/iisnode-express-msi.wixproj
@@ -57,6 +57,9 @@
<Content Include="removeiisnodesection.js" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
+ <PropertyGroup>
+ <PreBuildEvent>"$(ProjectDir)\..\scripts\genVersionWxi.bat" &gt; "$(ProjectDir)\version_autogenerated.wxi"</PreBuildEvent>
+ </PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
View
3  src/setup/iisnode-express-msi/iisnode.wxs
@@ -4,9 +4,8 @@
<!-- creating MSIs for local apps http://blogs.msdn.com/b/astebner/archive/2007/11/18/6385121.aspx -->
<?define sourcedir="$(var.SolutionDir)..\..\build\$(var.Configuration)\x86\" ?>
-
- <?define version="0.1.5.0"?>
+ <?include version_autogenerated.wxi ?> <!-- generated in pre-build steps -->
<Product Id="cc6c176e-e26c-48ec-8970-f58bd1d046cd"
Name="iisnode for iis express 7.x"
View
6 src/setup/iisnode-express-msi/iisnodefiles.wxi
@@ -18,16 +18,10 @@
<Component Id="cmpBFBC3A88B5FB1B48E1CB3DBC62C46CAB" Guid="0EC0F08E-89B3-4C35-A286-8DB8598597F2">
<File Id="fil98FE22082D3964939C1CB4060FC2A0C6" KeyPath="no" Source="$(var.sourcedir)\iisnode_schema.xml" />
<Condition><![CDATA[NOT(VersionNT64)]]></Condition>
- <RegistryKey Root="HKCU" Key="Software\Microsoft\iisnode" Action="createAndRemoveOnUninstall">
- <RegistryValue Name="iisnode_schema.xml" Value="[ProductVersion]" Type="string" KeyPath="yes"/>
- </RegistryKey>
</Component>
<Component Id="cmpCFBC3A88B5FB1B48E1CB3DBC62C46CAB" Guid="1EC0F08E-89B3-4C35-A286-8DB8598597F2">
<File Id="fil08FE22082D3964939C1CB4060FC2A0C6" KeyPath="no" Source="$(var.sourcedir)\iisnode_schema_x64.xml" Name="iisnode_schema.xml"/>
<Condition><![CDATA[VersionNT64]]></Condition>
- <RegistryKey Root="HKCU" Key="Software\Microsoft\iisnode" Action="createAndRemoveOnUninstall">
- <RegistryValue Name="iisnode_schema_x64.xml" Value="[ProductVersion]" Type="string" KeyPath="yes"/>
- </RegistryKey>
</Component>
</Directory>
</Directory>
View
3  src/setup/iisnode-msi/iisnode-msi.wixproj
@@ -82,6 +82,9 @@
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
+ <PropertyGroup>
+ <PreBuildEvent>"$(ProjectDir)\..\scripts\genVersionWxi.bat" &gt; "$(ProjectDir)\version_autogenerated.wxi"</PreBuildEvent>
+ </PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
View
4 src/setup/iisnode-msi/iisnode.wxs
@@ -7,9 +7,9 @@
<?elseif $(var.Platform) = x64 ?>
<?define sourcedir="$(var.SolutionDir)..\..\build\$(var.Configuration)\amd64\" ?>
<?define isWin64="yes" ?>
- <?endif?>
+ <?endif?>
- <?define version="0.1.5.0"?>
+ <?include version_autogenerated.wxi ?> <!-- generated in pre-build steps -->
<!-- 64 bit installers:
http://blogs.msdn.com/b/astebner/archive/2007/08/09/4317654.aspx,
View
3  src/setup/scripts/genVersionWxi.bat
@@ -0,0 +1,3 @@
+@echo off
+for /F "tokens=*" %%i in (%~dp0\..\..\version.txt) do set NODEIIS_VERSION=%%i
+echo ^<Include xmlns=^"http://schemas.microsoft.com/wix/2006/wi^"^>^<^?define version=^"%NODEIIS_VERSION%.0^"^?^>^</Include^>
View
1  src/version.txt
@@ -0,0 +1 @@
+0.1.6
View
2  test/functional/tests/parts/200_samples.js
@@ -5,7 +5,7 @@ Testing samples
var iisnodeassert = require("iisnodeassert");
iisnodeassert.sequence([
- iisnodeassert.get(10000, "/node/helloworld/hello.js", 200, "Hello, world! [helloworld sample]"),
+ iisnodeassert.get(10000, "/node/helloworld/hello.js", 200),
iisnodeassert.get(10000, "/node/configuration/hello.js", 200, "Hello, world! [configuration sample]"),
iisnodeassert.get(10000, "/node/logging/hello.js", 200, "Hello, world! [logging sample]"),
iisnodeassert.get(10000, "/node/defaultdocument/", 200, "You have reached the default node.js application at index.js! [defaultdocument sample]"),
Please sign in to comment.
Something went wrong with that request. Please try again.