renpy/doc/updater.html
2023-01-18 23:13:55 +01:00

393 lines
23 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Updater &#8212; Ren&#39;Py Documentation</title>
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Android" href="android.html" />
<link rel="prev" title="Building Distributions" href="build.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
Ren&#39;Py Documentation</a>
<span class="navbar-text navbar-version pull-left"><b>7.5.3</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li><a href="https://www.renpy.org">Home Page</a></li>
<li><a href="https://www.renpy.org/doc/html/">Online Documentation</a></li>
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="gui.html">GUI Customization Guide</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="language_basics.html">Language Basics</a></li>
<li class="toctree-l1"><a class="reference internal" href="label.html">Labels &amp; Control Flow</a></li>
<li class="toctree-l1"><a class="reference internal" href="dialogue.html">Dialogue and Narration</a></li>
<li class="toctree-l1"><a class="reference internal" href="displaying_images.html">Displaying Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="menus.html">In-Game Menus</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="conditional.html">Conditional Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="audio.html">Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="movie.html">Movie</a></li>
<li class="toctree-l1"><a class="reference internal" href="voice.html">Voice</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="text.html">Text</a></li>
<li class="toctree-l1"><a class="reference internal" href="translation.html">Translation</a></li>
<li class="toctree-l1"><a class="reference internal" href="displayables.html">Displayables</a></li>
<li class="toctree-l1"><a class="reference internal" href="transforms.html">Transforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="transitions.html">Transitions</a></li>
<li class="toctree-l1"><a class="reference internal" href="atl.html">Animation and Transformation Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="matrixcolor.html">Matrixcolor</a></li>
<li class="toctree-l1"><a class="reference internal" href="layeredimage.html">Layered Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="3dstage.html">3D Stage</a></li>
<li class="toctree-l1"><a class="reference internal" href="live2d.html">Live2D Cubism</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="style.html">Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="style_properties.html">Style Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="screens.html">Screens and Screen Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_actions.html">Screen Actions, Values, and Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_special.html">Special Screen Names</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_optimization.html">Screen Language Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="preferences.html">Preference Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="store_variables.html">Store Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="mouse.html">Custom Mouse Cursors</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="launcher.html">Launcher</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="director.html">Interactive Director</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="nvl_mode.html">NVL-Mode Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="input.html">Text Input</a></li>
<li class="toctree-l1"><a class="reference internal" href="side_image.html">Side Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="rooms.html">Image Gallery, Music Room, and Replay Actions</a></li>
<li class="toctree-l1"><a class="reference internal" href="drag_drop.html">Drag and Drop</a></li>
<li class="toctree-l1"><a class="reference internal" href="sprites.html">Sprites</a></li>
<li class="toctree-l1"><a class="reference internal" href="keymap.html">Customizing the Keymap</a></li>
<li class="toctree-l1"><a class="reference internal" href="achievement.html">Achievements</a></li>
<li class="toctree-l1"><a class="reference internal" href="history.html">Dialogue History</a></li>
<li class="toctree-l1"><a class="reference internal" href="multiple.html">Multiple Character Dialogue</a></li>
<li class="toctree-l1"><a class="reference internal" href="splashscreen_presplash.html">Splashscreen and Presplash</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="statement_equivalents.html">Statement Equivalents</a></li>
<li class="toctree-l1"><a class="reference internal" href="save_load_rollback.html">Saving, Loading, and Rollback</a></li>
<li class="toctree-l1"><a class="reference internal" href="persistent.html">Persistent Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="trans_trans_python.html">Transforms and Transitions in Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="gui_advanced.html">Advanced GUI</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_python.html">Screens and Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="modes.html">Modes</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdd.html">Creator-Defined Displayables</a></li>
<li class="toctree-l1"><a class="reference internal" href="cds.html">Creator-Defined Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom_text_tags.html">Custom Text Tags</a></li>
<li class="toctree-l1"><a class="reference internal" href="character_callbacks.html">Character Callbacks</a></li>
<li class="toctree-l1"><a class="reference internal" href="file_python.html">File Access</a></li>
<li class="toctree-l1"><a class="reference internal" href="color_class.html">Color Class</a></li>
<li class="toctree-l1"><a class="reference internal" href="matrix.html">Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="model.html">Model-Based Rendering</a></li>
<li class="toctree-l1"><a class="reference internal" href="other.html">Other Functions and Variables</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="build.html">Building Distributions</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Web Updater</a></li>
<li class="toctree-l1"><a class="reference internal" href="android.html">Android</a></li>
<li class="toctree-l1"><a class="reference internal" href="chromeos.html">Chrome OS/Chromebook</a></li>
<li class="toctree-l1"><a class="reference internal" href="ios.html">iOS</a></li>
<li class="toctree-l1"><a class="reference internal" href="iap.html">In-App Purchasing</a></li>
<li class="toctree-l1"><a class="reference internal" href="gesture.html">Gestures</a></li>
<li class="toctree-l1"><a class="reference internal" href="raspi.html">Raspberry Pi</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="problems.html">Dealing with Problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="environment_variables.html">Environment Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="self_voicing.html">Self-Voicing</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="editor.html">Text Editor Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="skins.html">Skins</a></li>
<li class="toctree-l1"><a class="reference internal" href="translating_renpy.html">Translating Ren'Py</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog (Ren'Py 7.x-)</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog6.html">Changelog (Ren'Py 6.11 - 6.99)</a></li>
<li class="toctree-l1"><a class="reference internal" href="incompatible.html">Incompatible Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="distributor.html">Distributor Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="sponsors.html">Ren'Py Development Sponsors</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="thequestion.html">Script of The Question</a></li>
<li class="toctree-l1"><a class="reference internal" href="thequestion_nvl.html">NVL-mode script for The Question</a></li>
</ul>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary"><ul>
<li><a class="reference internal" href="#">Web Updater</a><ul>
<li><a class="reference internal" href="#server-requirements">Server Requirements</a></li>
<li><a class="reference internal" href="#building-an-update">Building an Update</a></li>
<li><a class="reference internal" href="#functions">Functions</a></li>
<li><a class="reference internal" href="#screen">Screen</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-9 content">
<div class="section" id="web-updater">
<h1>Web Updater<a class="headerlink" href="#web-updater" title="Permalink to this headline"> link</a></h1>
<p>Ren'Py includes an updater that can automatically download and install
updates to a Ren'Py game hosted at a website. This can be useful in
keeping a large game up to date.</p>
<p>The Ren'Py updater works by automatically performing the following
steps:</p>
<ol class="arabic simple">
<li>Downloading an index file that controls what is updated.</li>
<li>Asking the user if he or she wants to proceed with the update.</li>
<li>Producing an archive file from the files on disk.</li>
<li>Downloading a zsync control file from the server.</li>
<li>Using the zsync tool to update the archive file to the version on
the server. Zsync automatically computes the differences between
the two files, and attempts to only download the portions that
have changed.</li>
<li>Unpacking the archive, replacing the files on disk.</li>
<li>Deleting files that have been removed between the old and new
versions.</li>
<li>Restarting the game.</li>
</ol>
<p>The Ren'Py updater shows an updater screen during this process,
prompting the user to proceed and allowing the user to cancel
when appropriate.</p>
<div class="section" id="server-requirements">
<h2>Server Requirements<a class="headerlink" href="#server-requirements" title="Permalink to this headline"> link</a></h2>
<p>The updater requires that you provide your own hosting. You should be
able to download the update files by going to the appropriate URL
directly, and your server must support HTTP range queries.</p>
<p>HTTPS is not supported for patching.</p>
<p>(This means paying for web hosting, as &quot;sharing&quot; sites tend not to
support the required features.)</p>
<p>If the <cite>patch</cite> parameter is set to False, or an https url is given,
the updater will not attempt to patch the game. Instead, it will
download the full archive, and unpack that update. While this is a larger
download, it will work with many more web servers.</p>
</div>
<div class="section" id="building-an-update">
<h2>Building an Update<a class="headerlink" href="#building-an-update" title="Permalink to this headline"> link</a></h2>
<p>Updates are built automatically when distributions are built. To build
an update, set <a class="reference internal" href="build.html#var-build.include_update"><code class="xref std std-var docutils literal notranslate"><span class="pre">build.include_update</span></code></a> to True in options.rpy. This will
unlock the &quot;Build Updates&quot; option in the &quot;Build Distributions&quot; section
of the launcher. Check this option, and Ren'Py will create the update
files.</p>
<p>The update files consist of:</p>
<dl class="docutils">
<dt>updates.json</dt>
<dd>An index of available updates and their versions.</dd>
<dt><em>package</em>.sums</dt>
<dd>Contains checksums for each block in the package.</dd>
<dt><em>package</em>.update.gz</dt>
<dd>Contains the update data for the given package.</dd>
<dt><em>package</em>.update.json</dt>
<dd>Contains a list of the files in each package, which the updater
uses when downloading DLC.</dd>
<dt><em>package</em>.zsync</dt>
<dd>This is a control file that's used by zsync to manage the download.</dd>
</dl>
<p>You must upload all these files to a single directory on your web
server.</p>
</div>
<div class="section" id="functions">
<h2>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"> link</a></h2>
<p>To cause an update to occur, invoke either updater.update or the
updater.Update action.</p>
<dl class="function">
<dt id="updater.Update">
<code class="descclassname">updater.</code><code class="descname">Update</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#updater.Update" title="Permalink to this definition"> link</a></dt>
<dd><p>An action that calls <a class="reference internal" href="#updater.update" title="updater.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">updater.update()</span></code></a>. All arguments are
stored and passed to that function.</p>
</dd></dl>
<dl class="function">
<dt id="updater.UpdateVersion">
<code class="descclassname">updater.</code><code class="descname">UpdateVersion</code><span class="sig-paren">(</span><em>url</em>, <em>check_interval=21600</em>, <em>simulate=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#updater.UpdateVersion" title="Permalink to this definition"> link</a></dt>
<dd><p>This function contacts the server at <cite>url</cite>, and determines if there is
a newer version of software available at that url. If there is, this
function returns the new version. Otherwise, it returns None.</p>
<p>Since contacting the server can take some time, this function launches
a thread in the background, and immediately returns the version from
the last time the server was contacted, or None if the server has never
been contacted. The background thread will restart the current interaction
once the server has been contacted, which will cause screens that call
this function to update.</p>
<p>Each url will be contacted at most once per Ren'Py session, and not
more than once every <cite>check_interval</cite> seconds. When the server is not
contacted, cached data will be returned.</p>
<p>Additional keyword arguments (including <cite>simulate</cite>) are passed to the
update mechanism as if they were given to <a class="reference internal" href="#updater.update" title="updater.update"><code class="xref py py-func docutils literal notranslate"><span class="pre">updater.update()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="updater.can_update">
<code class="descclassname">updater.</code><code class="descname">can_update</code><span class="sig-paren">(</span><em>base=None</em><span class="sig-paren">)</span><a class="headerlink" href="#updater.can_update" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns true if it's possible that an update can succeed. Returns false
if updating is totally impossible. (For example, if the update directory
was deleted.)</p>
<p>Note that this does not determine if an update is actually available.
To do that, use <a class="reference internal" href="#updater.UpdateVersion" title="updater.UpdateVersion"><code class="xref py py-func docutils literal notranslate"><span class="pre">updater.UpdateVersion()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="updater.get_installed_packages">
<code class="descclassname">updater.</code><code class="descname">get_installed_packages</code><span class="sig-paren">(</span><em>base=None</em><span class="sig-paren">)</span><a class="headerlink" href="#updater.get_installed_packages" title="Permalink to this definition"> link</a></dt>
<dd><p>Returns a list of installed DLC package names.</p>
<dl class="docutils">
<dt><cite>base</cite></dt>
<dd>The base directory to update. Defaults to the current project's
base directory.</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="updater.update">
<code class="descclassname">updater.</code><code class="descname">update</code><span class="sig-paren">(</span><em>url</em>, <em>base=None</em>, <em>force=False</em>, <em>public_key=None</em>, <em>simulate=None</em>, <em>add=[]</em>, <em>restart=True</em>, <em>confirm=True</em>, <em>patch=True</em><span class="sig-paren">)</span><a class="headerlink" href="#updater.update" title="Permalink to this definition"> link</a></dt>
<dd><p>Updates this Ren'Py game to the latest version.</p>
<dl class="docutils">
<dt><cite>url</cite></dt>
<dd>The URL to the updates.json file.</dd>
<dt><cite>base</cite></dt>
<dd>The base directory that will be updated. Defaults to the base
of the current game. (This can usually be ignored.)</dd>
<dt><cite>force</cite></dt>
<dd>Force the update to occur even if the version numbers are
the same. (Used for testing.)</dd>
<dt><cite>public_key</cite></dt>
<dd>The path to a PEM file containing a public key that the
update signature is checked against. (This can usually be ignored.)</dd>
<dt><cite>simulate</cite></dt>
<dd><p class="first">This is used to test update guis without actually performing
an update. This can be:</p>
<ul class="last simple">
<li>None to perform an update.</li>
<li>&quot;available&quot; to test the case where an update is available.</li>
<li>&quot;not_available&quot; to test the case where no update is available.</li>
<li>&quot;error&quot; to test an update error.</li>
</ul>
</dd>
<dt><cite>add</cite></dt>
<dd>A list of packages to add during this update. This is only necessary
for dlc.</dd>
<dt><cite>restart</cite></dt>
<dd>Restart the game after the update.</dd>
<dt><cite>confirm</cite></dt>
<dd>Should Ren'Py prompt the user to confirm the update? If False, the
update will proceed without confirmation.</dd>
<dt><cite>patch</cite></dt>
<dd>If true, Ren'Py will attempt to patch the game, downloading only
changed data. If false, Ren'Py will download a complete copy of
the game, and update from that. This is set to false automatically
when the url does not begin with &quot;http:&quot;.</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="screen">
<h2>Screen<a class="headerlink" href="#screen" title="Permalink to this headline"> link</a></h2>
<p>To customize the look of the updater, you may override the <code class="docutils literal notranslate"><span class="pre">updater</span></code>
screen. The default screen is defined in common/00updater.rpy.</p>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2012-2022, Tom Rothamel.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.6.<br/>
</p>
</div>
</footer>
</body>
</html>