Windows 8 Build 7777.0.fbl grfx.100708-2000:修订间差异

第 53 行: 第 53 行:
{{hatnote|请参阅 [[Windows 8 Build 7776.0.fbl_grfx_dev1.100708-1700#Windows 应用商店 2|Windows 8 Build 7776#发现#Windows 应用商店#访问应用商店]]}}
{{hatnote|请参阅 [[Windows 8 Build 7776.0.fbl_grfx_dev1.100708-1700#Windows 应用商店 2|Windows 8 Build 7776#发现#Windows 应用商店#访问应用商店]]}}


==== Functionality ====
==== 功能 ====
This build adds a Windows Store related service simply named Windows Store Service (otherwise known as <code>WSService.dll</code>) along with a Winstore Store Licensing Client (<code>WSClient.dll</code>) library used to communicate with that service. The Windows Store itself does not use the library at all in this build, making the service unused.
此版本新增了一个与 Windows 应用商店相关的服务,名为 Windows Store Service(也称为 <code>WSService.dll</code>),以及一个用于与此服务通信的 Winstore 商店许可客户端(<code>WSClient.dll</code>)库。在此版本中,Windows 应用商店本身根本不使用此库,因此此服务处于未使用状态。


The Uniform Resource Identifier (URI) for the <code>paulke86-srv</code> server can now be checked for inside the code for the app, and is named <code>BaseUrl</code>. Using this URI, it can be seen that the folder structure of the <code>winstore</code> folder on the server is:<code><nowiki>http://paulke86-srv/winstore/{clientSubVersion}/{market}/{locale}/{channelPartner}/{hardwareClass}</nowiki></code>, which matches up with the structure of previously seen directories in build 7776, such as <code><nowiki>http://paulke86-srv/winstore/win8/usa/en-us/ms/non-touch</nowiki></code>.
<code>paulke86-srv</code> 服务器的统一资源标识符(URI)现在可以在应用程序代码中检查,其名称为 <code>BaseUrl</code>。使用此 URI,可以看到服务器上 <code>winstore</code> 文件夹的文件结构为:<code><nowiki>http://paulke86-srv/winstore/{clientSubVersion}/{market}/{locale}/{channelPartner}/{hardwareClass}</nowiki></code>,这与在 Build 7776 中之前看到的目录结构相匹配,例如 <code><nowiki>http://paulke86-srv/winstore/win8/usa/en-us/ms/non-touch</nowiki></code>。


A <code>DiscoveryService</code> URI is present alongside the <code>paulke86</code> one as well (the service is not used for anything at this point of development however). The default link for this URI is <code><nowiki>http://go.microsoft.com/fwlink/?LinkID=195322&clcid=0x409</nowiki></code>, and both of the <code>BaseUrl</code> and <code>DiscoveryService</code> URIs can be modified by using a <code>winstore.ini</code> file placed in the same directory as <code>WinStore.exe</code>. The format of that file is as follows (more on <code>NoWaitOnDiscovery</code> later in the article):
除了 <code>paulke86</code> 的 URI 之外,还存在一个 <code>DiscoveryService</code> URI(不过在这一开发阶段,此服务尚未用于任何用途)。此 URI 的默认链接为 <code><nowiki>http://go.microsoft.com/fwlink/?LinkID=195322&clcid=0x409</nowiki></code>,并且可以通过将 <code>winstore.ini</code> 文件放置在 <code>WinStore.exe</code> 所在的相同目录下,修改 BaseUrl 和 DiscoveryService URI。该文件的格式如下(关于 <code>NoWaitOnDiscovery</code> 的更多内容将在本文之后说明):


<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
[browse]
[browse]
DiscoveryService=<insert custom discovery service URI here>
DiscoveryService=<在此处插入自定义发现服务 URI>
BaseUrl=<insert custom base URI here>
BaseUrl=<在此处插入自定义基础 URI>
   
   
[Overrides]
[Overrides]
NoWaitOnDiscovery=<insert either 0 or 1 here, 1 to disable>
NoWaitOnDiscovery=<在此处输入 0 或 1,输入 1 以禁用>
</syntaxhighlight>
</syntaxhighlight>


At the start, the Windows Store performs an HTTP request to the DiscoveryService URI, expecting that URI to be a redirect to the actual discovery service server. After doing so, it sends an [[w:HTTP|HTTP]] request to the discovery service server requesting just <code>/</code>, likely to check if the server is currently up. If the program receives HTTP 200 (OK), it will make another request, requesting the <code>/{osVersion}/{clientVersion}/Discovery</code> directory (<code>osVersion</code> and <code>clientVersion</code> are replaced with proper values), and once done, it once again expects HTTP 200, and an XML file containing API endpoints. The <code>A</code> tag in the file contains a path (e.g. <code>/api-endpoint</code>), while the <code>U</code> tag contains the hostname for a server (e.g. <code><nowiki>https://example.com</nowiki></code>). These tags would combine together to create a full URI, although the original URIs are not known as the server that had them was never publicly available. It is also unknown as to what the <code>Dsr</code>, <code>S</code>, <code>A</code>, <code>As</code> and <code>U</code> tags stand for, and the format for the XML file is as follows:
一开始,Windows 应用商店会对 DiscoveryService URI 发起 HTTP 请求,期望此 URI 能重定向到实际的发现服务服务器。完成后,它会向发现服务服务器发送一个 HTTP 请求,只请求 <code>/</code>,很可能是为了检查服务器当前是否联机。如果程序收到 HTTP 200(OK),它会再次发起请求,请求 <code>/{osVersion}/{clientVersion}/Discovery</code> 目录(<code>osVersion</code> 和 <code>clientVersion</code> 会被替换为相应的值),完成后,它再次期望收到 HTTP 200 和包含 API 端点的 XML 文件。文件中的 <code>A</code> 标识包含一个路径(例如 <code>/api-endpoint</code>),而 <code>U</code> 标识包含服务器的主机名(例如 <code><nowiki>https://example.com</nowiki></code>)。这些标签会组合在一起以创建完整的 URI,尽管原始 URI 不为人知,原因是拥有它们的服务器从未公开过。<code>Dsr</code>、<code>S</code>、<code>A</code>、<code>As</code> 和 <code>U</code> 标识具体代表什么也不得而知,XML 文件的格式如下:


<syntaxhighlight lang="ini">
<syntaxhighlight lang="ini">
第 108 行: 第 108 行:
</syntaxhighlight>
</syntaxhighlight>


The Windows Store now shows two new strings on startup due to the Discovery Service - <code>offline.htm?id=5</code> and <code>offline.htm?id=6</code>. The former string says "Loading the Windows Store" and appears when the application is waiting for the Discovery Service, while the latter string says "The Windows Store could not be contacted, please try again shortly.", and appears when the Discovery Service is unable to be accessed. The <code>NoWaitOnDiscovery</code> argument in the <code>winstore.ini</code> file can be used to disable this loading screen, resulting in the app attempting to open the <code>whats-fresh.htm</code> page on startup instead (this obviously fails due to the lack of the <code>paulke86</code> server assets, causing the previous "Your computer is offline. [...]" message to display as seen in build 7776 as a replacement). An additional <code>offline.htm?id=7</code> string can also be seen in the <code>WinStoreUI.dll.mui</code> file and reads: "The Windows Store has encountered a problem and must close", even though the <code>WinStoreUI.dll</code> library lacks any code to display it. The application’s user interface remains unchanged from build 7776, except for the fact that the Store will no longer show scroll bars if it doesn’t fit on screen.
由于发现服务(Discovery Service),Windows 应用商店现在在启动时显示两个新字符串 —— <code>offline.htm?id=5</code> 和 <code>offline.htm?id=6</code>。前者字符串显示“Loading the Windows Store(正在加载 Windows 应用商店)”,当应用等待发现服务时会出现,而后者字符串显示“The Windows Store could not be contacted, please try again shortly.(无法联系 Windows 应用商店,请稍后重试。)”,当无法访问发现服务时显示。可以使用 <code>winstore.ini</code> 文件中的 <code>NoWaitOnDiscovery</code> 参数来禁用此加载屏幕,从而使应用在启动时尝试打开 <code>whats-fresh.htm</code> 页面(由于缺少 <code>paulke86</code> 服务器资源,这显然会失败,从而显示之前在 Build 7776 中看到的“Your computer is offline. [...](你的计算机处于离线状态。[...])”消息作为替代)。在 <code>WinStoreUI.dll.mui</code> 文件中,还可以看到额外的 <code>offline.htm?id=7</code> 字符串,内容为:“The Windows Store has encountered a problem and must close(Windows 应用商店遇到问题,必须关闭)”,尽管 <code>WinStoreUI.dll</code> 库没有任何显示它的代码。应用的用户界面与 Build 7776 相比保持不变,只是如果应用商店内容超出屏幕,滚动条将不再显示。


A new Commerce API has been added, which serves the purpose of managing payment-related tasks, like buying apps or managing payment info. This API does not use the Discovery Service, and is used by the later mentioned PDP page. The API always contacts the internal server of <code>sikwan3.redmond.corp.microsoft.com</code>, with the API endpoints for it being: <code>/Commerce/DefaultPI</code>, <code>/Commerce/Purchase/<product GUID></code>, <code>/Commerce/FinalPrice/p/<product GUID>/t/<count></code> and <code>/Commerce/FinalPrice/p/<product GUID>/t/<count>/pi/<payment info></code>. It has been speculated that the <code><count></code> value in this context means the amount of licenses for the app that the user wants to buy, even though the value of such is always set to <code>1</code>. The API also expects an XML response if the status HTTP 200 is returned, just like the Discovery Service.
A new Commerce API has been added, which serves the purpose of managing payment-related tasks, like buying apps or managing payment info. This API does not use the Discovery Service, and is used by the later mentioned PDP page. The API always contacts the internal server of <code>sikwan3.redmond.corp.microsoft.com</code>, with the API endpoints for it being: <code>/Commerce/DefaultPI</code>, <code>/Commerce/Purchase/<product GUID></code>, <code>/Commerce/FinalPrice/p/<product GUID>/t/<count></code> and <code>/Commerce/FinalPrice/p/<product GUID>/t/<count>/pi/<payment info></code>. It has been speculated that the <code><count></code> value in this context means the amount of licenses for the app that the user wants to buy, even though the value of such is always set to <code>1</code>. The API also expects an XML response if the status HTTP 200 is returned, just like the Discovery Service.新增了一个 Commerce API(商务 API),用于管理与支付相关的任务,比如购买应用或管理支付信息。此 API 不使用 Discovery Service,并由后面提到的 PDP 页面使用。此 API 始终联系内部服务器 sikwan3.redmond.corp.microsoft.com,其 API 端点为:/Commerce/DefaultPI、/Commerce/Purchase/<product GUID>、/Commerce/FinalPrice/p/<product GUID>/t/<count> 以及 /Commerce/FinalPrice/p/<product GUID>/t/<count>/pi/<payment info>。有人推测此处的 <count> 值表示用户想要购买的应用许可证数量,尽管此值总是设置为 1。此 API 还期望在返回 HTTP 200 状态时获取 XML 响应,就像 Discovery Service 一样。


Unlike build 7776, a user agent string is present inside the code for the app - the code specifies that the application uses WinHTTP (specifically to make API calls), and that the user agent for the app is <code>Windows Store/1.0</code>, symbolizing that the version of the Windows Store found in these builds is <code>1.0</code>.
Unlike build 7776, a user agent string is present inside the code for the app - the code specifies that the application uses WinHTTP (specifically to make API calls), and that the user agent for the app is <code>Windows Store/1.0</code>, symbolizing that the version of the Windows Store found in these builds is <code>1.0</code>.