Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2011-03-04 Steve Falkenburg <sfalken@apple.com>
        Reviewed by Darin Adler.

        Adopt VersionStamper tool for Windows WebKit DLLs
        https://bugs.webkit.org/show_bug.cgi?id=55784

        Calculate the WebKit version for the useragent via autoversion.h
        instead of reading it back from the DLL.

        We now use a tool to stamp the version number onto the Apple WebKit DLLs
        during the post-build step.

        * WebKit.vcproj/WebKit.rc: Removed. This file wasn't used.
        * WebKit.vcproj/WebKitLibCommon.vsprops: Fetch version from a string resource.
        * WebView.cpp:
        (WebView::standardUserAgentWithApplicationName): Use __BUILD_NUMBER_SHORT__ for the version.
        (osVersion): Removed
2011-03-04  Steve Falkenburg  <sfalken@apple.com>

        Reviewed by Darin Adler.

        Adopt VersionStamper tool for Windows WebKit DLLs
        https://bugs.webkit.org/show_bug.cgi?id=55784
        <rdar://problem/9021320>

        We now use a tool to stamp the version number onto the Apple WebKit DLLs
        during the post-build step.

        Fetch the WebKit version from a string resource instead of the version resource.

        * UIProcess/win/WebPageProxyWin.cpp:
        (WebKit::userVisibleWebKitVersionString): Fetch version from a string resource.
        * win/WebKit2.rc: Removed version, added stringtable.
        * win/WebKit2WebProcess.rc: Removed.
        * win/WebKit2WebProcess.vcproj:
        * win/WebKit2WebProcessPostBuild.cmd: Don't run autoversion script. It isn't used in this project.
        * win/WebKit2WebProcessPreBuild.cmd: Stamp version.
        * win/WebKitPostBuild.cmd: Stamp version.


Canonical link: https://commits.webkit.org/70289@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Steve Falkenburg committed Mar 5, 2011
1 parent c2dbd02 commit 5291038
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 252 deletions.
19 changes: 19 additions & 0 deletions Source/WebKit/win/ChangeLog
@@ -1,3 +1,22 @@
2011-03-04 Steve Falkenburg <sfalken@apple.com>

Reviewed by Darin Adler.

Adopt VersionStamper tool for Windows WebKit DLLs
https://bugs.webkit.org/show_bug.cgi?id=55784

Calculate the WebKit version for the useragent via autoversion.h
instead of reading it back from the DLL.

We now use a tool to stamp the version number onto the Apple WebKit DLLs
during the post-build step.

* WebKit.vcproj/WebKit.rc: Removed. This file wasn't used.
* WebKit.vcproj/WebKitLibCommon.vsprops: Fetch version from a string resource.
* WebView.cpp:
(WebView::standardUserAgentWithApplicationName): Use __BUILD_NUMBER_SHORT__ for the version.
(osVersion): Removed

2011-03-03 Anders Carlsson <andersca@apple.com>

Reviewed by Sam Weinig.
Expand Down
89 changes: 0 additions & 89 deletions Source/WebKit/win/WebKit.vcproj/WebKit.rc

This file was deleted.

4 changes: 0 additions & 4 deletions Source/WebKit/win/WebKit.vcproj/WebKitLibCommon.vsprops
Expand Up @@ -15,8 +15,4 @@
DisableSpecificWarnings="4819"
ForcedIncludeFiles="WebKitPrefix.h;ICUVersion.h"
/>
<Tool
Name="VCResourceCompilerTool"
AdditionalIncludeDirectories="$(ConfigurationBuildDir)\obj\WebKit\"
/>
</VisualStudioPropertySheet>
40 changes: 6 additions & 34 deletions Source/WebKit/win/WebView.cpp
Expand Up @@ -59,6 +59,7 @@
#include "WebPreferences.h"
#include "WebScriptWorld.h"
#include "WindowsTouch.h"
#include "resource.h"
#include <JavaScriptCore/APICast.h>
#include <JavaScriptCore/InitializeThreading.h>
#include <JavaScriptCore/JSLock.h>
Expand Down Expand Up @@ -2361,40 +2362,11 @@ static String osVersion()

static String webKitVersion()
{
String versionStr = "420+";
void* data = 0;

struct LANGANDCODEPAGE {
WORD wLanguage;
WORD wCodePage;
} *lpTranslate;

TCHAR path[MAX_PATH];
GetModuleFileName(gInstance, path, WTF_ARRAY_LENGTH(path));
DWORD handle;
DWORD versionSize = GetFileVersionInfoSize(path, &handle);
if (!versionSize)
goto exit;
data = malloc(versionSize);
if (!data)
goto exit;
if (!GetFileVersionInfo(path, 0, versionSize, data))
goto exit;
UINT cbTranslate;
if (!VerQueryValue(data, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate))
goto exit;
TCHAR key[256];
_stprintf_s(key, WTF_ARRAY_LENGTH(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage);
LPCTSTR productVersion;
UINT productVersionLength;
if (!VerQueryValue(data, (LPTSTR)(LPCTSTR)key, (void**)&productVersion, &productVersionLength))
goto exit;
versionStr = String(productVersion, productVersionLength - 1);

exit:
if (data)
free(data);
return versionStr;
LPWSTR buildNumberStringPtr;
if (!::LoadStringW(gInstance, BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr)
return "534+";

return buildNumberStringPtr;
}

const String& WebView::userAgentForKURL(const KURL&)
Expand Down
22 changes: 22 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,25 @@
2011-03-04 Steve Falkenburg <sfalken@apple.com>

Reviewed by Darin Adler.

Adopt VersionStamper tool for Windows WebKit DLLs
https://bugs.webkit.org/show_bug.cgi?id=55784
<rdar://problem/9021320>

We now use a tool to stamp the version number onto the Apple WebKit DLLs
during the post-build step.

Fetch the WebKit version from a string resource instead of the version resource.

* UIProcess/win/WebPageProxyWin.cpp:
(WebKit::userVisibleWebKitVersionString): Fetch version from a string resource.
* win/WebKit2.rc: Removed version, added stringtable.
* win/WebKit2WebProcess.rc: Removed.
* win/WebKit2WebProcess.vcproj:
* win/WebKit2WebProcessPostBuild.cmd: Don't run autoversion script. It isn't used in this project.
* win/WebKit2WebProcessPreBuild.cmd: Stamp version.
* win/WebKitPostBuild.cmd: Stamp version.

2011-03-04 Jeff Miller <jeffm@apple.com>

Reviewed by Darin Adler.
Expand Down
38 changes: 5 additions & 33 deletions Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp
Expand Up @@ -26,6 +26,7 @@
#include "config.h"
#include "WebPageProxy.h"

#include "resource.h"
#include <tchar.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <wtf/StdLibExtras.h>
Expand Down Expand Up @@ -61,40 +62,11 @@ static String windowsVersion()

static String userVisibleWebKitVersionString()
{
String versionStr = "420+";
void* data = 0;
LPWSTR buildNumberStringPtr;
if (!::LoadStringW(instanceHandle(), BUILD_NUMBER, reinterpret_cast<LPWSTR>(&buildNumberStringPtr), 0) || !buildNumberStringPtr)
return "534+";

struct LANGANDCODEPAGE {
WORD wLanguage;
WORD wCodePage;
} *lpTranslate;

TCHAR path[MAX_PATH];
::GetModuleFileName(instanceHandle(), path, WTF_ARRAY_LENGTH(path));
DWORD handle;
DWORD versionSize = ::GetFileVersionInfoSize(path, &handle);
if (!versionSize)
goto exit;
data = fastMalloc(versionSize);
if (!data)
goto exit;
if (!::GetFileVersionInfo(path, 0, versionSize, data))
goto exit;
UINT cbTranslate;
if (!::VerQueryValue(data, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate))
goto exit;
TCHAR key[256];
_stprintf_s(key, WTF_ARRAY_LENGTH(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage);
LPCTSTR productVersion;
UINT productVersionLength;
if (!::VerQueryValue(data, (LPTSTR)(LPCTSTR)key, (void**)&productVersion, &productVersionLength))
goto exit;
versionStr = String(productVersion, productVersionLength - 1);

exit:
if (data)
fastFree(data);
return versionStr;
return buildNumberStringPtr;
}

String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent)
Expand Down
48 changes: 10 additions & 38 deletions Source/WebKit2/win/WebKit2.rc
Expand Up @@ -9,44 +9,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION __VERSION_MAJOR__,__VERSION_MINOR__,__VERSION_TINY__,__VERSION_BUILD__
PRODUCTVERSION __VERSION_MAJOR__,__VERSION_MINOR__,__VERSION_TINY__,__VERSION_BUILD__
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "WebKit Dynamic Link Library"
VALUE "FileVersion", __VERSION_TEXT__
VALUE "CompanyName", "Apple Inc."
VALUE "InternalName", "WebKit"
VALUE "LegalCopyright", "Copyright Apple Inc. 2003-" __COPYRIGHT_YEAR_END_TEXT__
VALUE "OriginalFilename", "WebKit.dll"
VALUE "ProductName", "WebKit"
VALUE "ProductVersion", __BUILD_NUMBER_SHORT__
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

/////////////////////////////////////////////////////////////////////////////
//
// PNG
Expand Down Expand Up @@ -78,3 +40,13 @@ IDR_FS_VIDEO_AUDIO_VOLUME_LOW PNG "fsVideoAudioVolumeLow.
IDR_FS_VIDEO_EXIT_FULLSCREEN PNG "fsVideoExitFullscreen.png"
IDR_FS_VIDEO_PAUSE PNG "fsVideoPause.png"
IDR_FS_VIDEO_PLAY PNG "fsVideoPlay.png"

/////////////////////////////////////////////////////////////////////////////
//
// STRINGTABLE
//

STRINGTABLE
BEGIN
BUILD_NUMBER __BUILD_NUMBER_SHORT__
END
2 changes: 1 addition & 1 deletion Source/WebKit2/win/WebKit2Common.vsprops
Expand Up @@ -6,7 +6,7 @@
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="WebKit2Prefix.h"
Expand Down
47 changes: 0 additions & 47 deletions Source/WebKit2/win/WebKit2WebProcess.rc

This file was deleted.

4 changes: 0 additions & 4 deletions Source/WebKit2/win/WebKit2WebProcess.vcproj
Expand Up @@ -401,10 +401,6 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<File
RelativePath=".\WebKit2WebProcess.rc"
>
</File>
</Files>
<Globals>
</Globals>
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit2/win/WebKit2WebProcessPostBuild.cmd
@@ -1,4 +1,5 @@
mkdir 2>NUL "%OUTDIR%\..\bin\WebKit2WebProcess.resources"
xcopy /y /d "%PROJECTDIR%\WebKit2WebProcess.resources\*" "%OUTDIR%\..\bin\WebKit2WebProcess.resources"
if exist "%WEBKITLIBRARIESDIR%\tools\VersionStamper\VersionStamper.exe" "%WEBKITLIBRARIESDIR%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%"

if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"
2 changes: 0 additions & 2 deletions Source/WebKit2/win/WebKit2WebProcessPreBuild.cmd
Expand Up @@ -4,5 +4,3 @@ cmd /c
if exist "%CONFIGURATIONBUILDDIR%\buildfailed" grep XX%PROJECTNAME%XX "%CONFIGURATIONBUILDDIR%\buildfailed"
if errorlevel 1 exit 1
echo XX%PROJECTNAME%XX > "%CONFIGURATIONBUILDDIR%\buildfailed"

bash "%WEBKITLIBRARIESDIR%\tools\scripts\auto-version.sh" "%INTDIR%"
1 change: 1 addition & 0 deletions Source/WebKit2/win/WebKitPostBuild.cmd
@@ -1 +1,2 @@
if exist "%WEBKITLIBRARIESDIR%\tools\VersionStamper\VersionStamper.exe" "%WEBKITLIBRARIESDIR%\tools\VersionStamper\VersionStamper.exe" --verbose "%TARGETPATH%"
if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed"

0 comments on commit 5291038

Please sign in to comment.