Silverlight Curation: Difference between revisions

From Flashpoint Datahub
Jump to navigation Jump to search
(Updated article to mention Basilisk instead of K-Meleon)
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This guide will show you how to curate Silverlight games and animations using Flashpoint Core.
This guide will show you how to curate Silverlight games and animations using Flashpoint.


== Recognizing Silverlight ==
== Recognizing Silverlight ==
Line 8: Line 8:
== Installing Silverlight ==
== Installing Silverlight ==


Before curating a Silverlight application, you may want to check whether it functions properly on its original website. First, install Silverlight from [https://www.microsoft.com/getsilverlight/Get-Started/Install/Default here]. Be sure to uncheck any additional offers in the installer. Once the installer finishes, use a compatible web browser to navigate to the page with the Silverlight application. Compatible browsers include Internet Explorer (which comes with all versions of Windows, including Windows 10), [https://www.waterfox.net/releases/ Waterfox], [https://basilisk-browser.org/download.shtml Basilisk], [https://www.palemoon.org/download.shtml Pale Moon], and [https://www.seamonkey-project.org/releases/ SeaMonkey].
Before curating a Silverlight application, you may want to check whether it functions properly on its original website. First, install Silverlight from [https://www.microsoft.com/getsilverlight/Get-Started/Install/Default here]. Be sure to uncheck any additional offers in the installer. Once the installer finishes, use a compatible web browser to navigate to the page with the Silverlight application. Compatible browsers include Internet Explorer (which comes with all versions of Windows, including Windows 10), [https://classic.waterfox.net/ Waterfox Classic], [https://basilisk-browser.org/download.shtml Basilisk], and [https://www.palemoon.org/download.shtml Pale Moon].


Although we have not yet encountered this problem, a few Silverlight applications may require an earlier version of Silverlight. You may test this by installing an earlier version from [http://www.oldversion.com/windows/silverlight/ OldVersion.com].
Although we have not yet encountered this problem, a few Silverlight applications may require an earlier version of Silverlight. You may test this by installing an earlier version from [http://www.oldversion.com/windows/silverlight/ OldVersion.com].
Line 14: Line 14:
== Curation Steps ==
== Curation Steps ==


Flashpoint comes with a copy of Silverlight installed in the portable Basilisk browser. This section explains how to create and test a basic Silverlight curation. We will use Diver 2 as an example: http://farseergames.azurewebsites.net/Diver2.html
Flashpoint comes with a copy of Silverlight installed in its Basilisk-based browser. This section explains how to create and test a basic Silverlight curation. We will use Diver 2 as an example: http://farseergames.azurewebsites.net/Diver2.html


<ol>
<ol>
Line 66: Line 66:
</li>
</li>
<li>
<li>
In your Flashpoint Core directory, navigate to <code>Server\htdocs</code>. In htdocs, create a directory or series of directories to match the original site's structure. In this case, we'd simply create a folder called <code>farseergames.azurewebsites.net</code>. Finally, move your HTML and XAP files to this new folder.
In your Flashpoint directory, navigate to <code>Legacy\htdocs</code>. In htdocs, create a directory or series of directories to match the original site's structure. In this case, we'd simply create a folder called <code>farseergames.azurewebsites.net</code>. Finally, move your HTML and XAP files to this new folder.
</li>
</li>
<li>
<li>
Now, we are ready to test the game in Flashpoint Core. Click the "New Game" button on the bottom right corner and enter the game's title, platform, application path and launch command. In this case, they would be:  
Now, we are ready to test the game in Flashpoint. Click the "New Game" button on the bottom right corner and enter the game's title, platform, application path and launch command. In this case, they would be:  
<pre>
<pre>
Title: Diver 2
Title: Diver 2
Platform: Silverlight
Platform: Silverlight
Application Path: FPSoftware\Basilisk-Portable\Basilisk-Portable.exe
Application Path: FPSoftware\fpnavigator-portable\FPNavigator.exe
Launch Command: http://farseergames.azurewebsites.net/Diver2.html
Launch Command: http://farseergames.azurewebsites.net/Diver2.html
</pre>
</pre>
The Application Path will always be the same. The Launch Command will always be an HTTP (not HTTPS) URL pointing to the HTML you created.
The Application Path will always be the same. The Launch Command will always be an HTTP (not HTTPS) URL pointing to the HTML you created.
You can run the game by double clicking its thumbnail in the launcher. You should now see the game running in Basilisk.
You can run the game by double clicking its thumbnail in the launcher. You should now see the game running in FPNavigator.
</li>
</li>
<li>
<li>
Line 87: Line 87:


You may be surprised to learn that Silverlight XAP files are really just renamed ZIP files. As such, they can easily be extracted using 7-zip or any other extractor program. The image below shows the contents of the <code>DiverGame2.xap</code> file mentioned previously.
You may be surprised to learn that Silverlight XAP files are really just renamed ZIP files. As such, they can easily be extracted using 7-zip or any other extractor program. The image below shows the contents of the <code>DiverGame2.xap</code> file mentioned previously.
[[File:XAPContents.png|center|600px|The contents of an XAP file, as displayed by Bandizip.]]
[[File:XAPContents.png|center|600px|The contents of an XAP file.]]


As you can see, a Silverlight XAP contains, at minimum, an <code>AppManifest.xaml</code> file and one or more DLL files. These DLL files contain the application code. Any additional game assets may be included in subfolders of the XAP. If a game requests many external assets, they are likely referenced in an XML file inside the XAP. To find external assets, you may extract the XAP and open the XML file(s) in a text editor.
As you can see, a Silverlight XAP contains, at minimum, an <code>AppManifest.xaml</code> file and one or more DLL files. These DLL files contain the application code. Any additional game assets may be included in subfolders of the XAP. If a game requests many external assets, they are likely referenced in an XML file inside the XAP. To find external assets, you may extract the XAP and open the XML file(s) in a text editor. This is particularly useful for HTTPS assets because HTTPS requests from Silverlight applications do not show up in the logs/network tab. If you find references to HTTPS assets, just replace such occurrences with HTTP.


=== Editing the manifest ===
=== Editing the manifest ===
Line 100: Line 100:
<ol>
<ol>
<li>
<li>
Download the [https://www.techulator.com/attachments/silverlight-games/82/KrestikNolik.xap KrestikNolik.xap] file. Open it with an archive extractor program like 7-zip or Bandizip.
Download the [https://www.techulator.com/attachments/silverlight-games/82/KrestikNolik.xap KrestikNolik.xap] file. Open it with an archive extractor program like 7-Zip.
</li>
</li>
<li>
<li>
Drag the <code>AppManifest.xaml</code> file from the Bandizip window onto your desktop (or any other folder). This will extract the manifest from the XAP.
Drag the <code>AppManifest.xaml</code> file from the 7-Zip window onto your desktop (or any other folder). This will extract the manifest from the XAP.
</li>
</li>
<li>
<li>
Line 122: Line 122:
</li>
</li>
<li>
<li>
Drag your modifed <code>AppManifest.xaml</code> file back into the Bandizip window. When prompted, choose to replace the original file. The game should now work! When you create your final curation, be sure to mark the game as hacked.
Drag your modifed <code>AppManifest.xaml</code> file back into the 7-Zip window. When prompted, choose to replace the original file. The game should now work! When you create your final curation, be sure to mark the game as hacked.
</li>
</li>
</ol>
</ol>
<noinclude>
[[Category:Curation Guides]]
</noinclude>

Latest revision as of 12:52, 8 October 2023

This guide will show you how to curate Silverlight games and animations using Flashpoint.

Recognizing Silverlight

If you're using a typical web browser, the most obvious indication that you've found a Silverlight application is an image like the one on the right.

The typical placeholder image for a Silverlight application.

Silverlight applications are always embedded on a webpage using an object tag, regardless of the browser being used. If you search the page HTML and find application/x-silverlight-2 or .xap, you've probably found a Silverlight application.

Installing Silverlight

Before curating a Silverlight application, you may want to check whether it functions properly on its original website. First, install Silverlight from here. Be sure to uncheck any additional offers in the installer. Once the installer finishes, use a compatible web browser to navigate to the page with the Silverlight application. Compatible browsers include Internet Explorer (which comes with all versions of Windows, including Windows 10), Waterfox Classic, Basilisk, and Pale Moon.

Although we have not yet encountered this problem, a few Silverlight applications may require an earlier version of Silverlight. You may test this by installing an earlier version from OldVersion.com.

Curation Steps

Flashpoint comes with a copy of Silverlight installed in its Basilisk-based browser. This section explains how to create and test a basic Silverlight curation. We will use Diver 2 as an example: http://farseergames.azurewebsites.net/Diver2.html

  1. Open this page in your browser. Right-click anywhere on the page, click "Inspect Element", and search for .xap. You should see an object tag, the beginning of which looks like this:
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
    		  <param name="source" value="DiverGame2.xap">
    		  <param name="onError" value="onSilverlightError">
    		  <param name="background" value="White">
    		  <param name="minRuntimeVersion" value="3.0.40818.0">
    		  
    		  <param name="maxframerate" value="60">
    		  <param name="enableFrameRateCounter" value="false">
    		  <param name="enableCacheVisualization" value="false">
    		  <param name="enableGPUAcceleration" value="true">
    		  
    		  <param name="autoUpgrade" value="true">
    
  2. Copy the page HTML and paste it into a text editor. Eliminate the unnecessary parts, like the latter part of the object tag. (The original page's object tag includes a section that embeds a YouTube video, but this is not needed for Flashpoint.) Your code should look like this:
    <style>
       #gameContainer
       {      
          width: 1000px;
          height: 700px;    
       }  
    </style> 
    <div id="gameContainer">
            <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
    		  <param name="source" value="DiverGame2.xap">
    		  <param name="onError" value="onSilverlightError">
    		  <param name="background" value="White">
    		  <param name="minRuntimeVersion" value="3.0.40818.0">	  
    		  <param name="maxframerate" value="60">
    		  <param name="enableFrameRateCounter" value="false">
    		  <param name="enableCacheVisualization" value="false">
    		  <param name="enableGPUAcceleration" value="true">	  
    		  <param name="autoUpgrade" value="true">
    	</object>
    </div>
    
  3. Save the file as a new HTML. In this case, we named it Diver2.html.
  4. Download the XAP file referenced in the object tag. Since the game URL is http://farseergames.azurewebsites.net/Diver2.html, and the object tag references DiverGame2.xap, the URL of the XAP file is http://farseergames.azurewebsites.net/DiverGame2.xap.
  5. In your Flashpoint directory, navigate to Legacy\htdocs. In htdocs, create a directory or series of directories to match the original site's structure. In this case, we'd simply create a folder called farseergames.azurewebsites.net. Finally, move your HTML and XAP files to this new folder.
  6. Now, we are ready to test the game in Flashpoint. Click the "New Game" button on the bottom right corner and enter the game's title, platform, application path and launch command. In this case, they would be:
    Title: Diver 2
    Platform: Silverlight
    Application Path: FPSoftware\fpnavigator-portable\FPNavigator.exe
    Launch Command: http://farseergames.azurewebsites.net/Diver2.html
    

    The Application Path will always be the same. The Launch Command will always be an HTTP (not HTTPS) URL pointing to the HTML you created. You can run the game by double clicking its thumbnail in the launcher. You should now see the game running in FPNavigator.

  7. Create a curation by following the Curation Format. Then, follow the steps explained in Instructions for Curating to submit the game.

Advanced Techniques

You may be surprised to learn that Silverlight XAP files are really just renamed ZIP files. As such, they can easily be extracted using 7-zip or any other extractor program. The image below shows the contents of the DiverGame2.xap file mentioned previously.

The contents of an XAP file.

As you can see, a Silverlight XAP contains, at minimum, an AppManifest.xaml file and one or more DLL files. These DLL files contain the application code. Any additional game assets may be included in subfolders of the XAP. If a game requests many external assets, they are likely referenced in an XML file inside the XAP. To find external assets, you may extract the XAP and open the XML file(s) in a text editor. This is particularly useful for HTTPS assets because HTTPS requests from Silverlight applications do not show up in the logs/network tab. If you find references to HTTPS assets, just replace such occurrences with HTTP.

Editing the manifest

A Silverlight XAP's AppManifest.xaml contains information necessary for Silverlight to run the application. To see this information, simply open the file in a text editor. In some cases, this information needs to be edited. This section describes a typical case of this in detail.

When you open this game, you will receive the following error:

A typical error caused by an XAP manifest referencing a beta version of Silverlight.

This error occurs because the manifest references a beta version of Silverlight. Silverlight manifests are only allowed to reference stable versions of Silverlight, or the latest beta version. To resolve this error, we must edit the AppManifest.xaml file to reference a stable version of Silverlight. The steps to do this are below.

  1. Download the KrestikNolik.xap file. Open it with an archive extractor program like 7-Zip.
  2. Drag the AppManifest.xaml file from the 7-Zip window onto your desktop (or any other folder). This will extract the manifest from the XAP.
  3. Open the AppManifest.xaml file in a text editor like Notepad. You should see this code:
    <Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="KrestikNolik" EntryPointType="KrestikNolik.App" RuntimeVersion="3.0.40307.0">
      <Deployment.Parts>
        <AssemblyPart x:Name="KrestikNolik" Source="KrestikNolik.dll" />
        <AssemblyPart x:Name="System.Net" Source="System.Net.dll" />
        <AssemblyPart x:Name="System.Runtime.Serialization" Source="System.Runtime.Serialization.dll" />
        <AssemblyPart x:Name="System.Windows.Controls" Source="System.Windows.Controls.dll" />
      </Deployment.Parts>
    </Deployment>
    
  4. Open the Silverlight Release History page. Find the version number on that page closest to the version number referenced in the manifest. In this case, the manifest references version 3.0.40307.0, and the closest version on the Silverlight Release History page is 3.0.40624.0. Using your text editor, replace 3.0.40307.0 with 3.0.40624.0 and save the file.
  5. Drag your modifed AppManifest.xaml file back into the 7-Zip window. When prompted, choose to replace the original file. The game should now work! When you create your final curation, be sure to mark the game as hacked.