<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Posts about Windows</title><link>https://chriswarrick.com/</link><atom:link href="https://chriswarrick.com/blog/tags/cat_windows.xml" rel="self" type="application/rss+xml" /><description>A rarely updated blog, mostly about programming.</description><lastBuildDate>Sun, 27 Dec 2015 11:15:00 GMT</lastBuildDate><generator>https://github.com/Kwpolska/YetAnotherBlogGenerator</generator><item><title>Windows 10 November Upgrade: Windows as a (Dis-)service</title><dc:creator>Chris Warrick</dc:creator><link>https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/</link><pubDate>Sun, 27 Dec 2015 11:15:00 GMT</pubDate><guid>https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/</guid><description>





The About Windows screen.


I upgraded Windows 10 from the RTM version (build 10240, July 2015) to the
November Upgrade version (1511/build 10560). It took me a good two hours,
multiple reboots, and a BSOD.
</description><content:encoded><![CDATA[
<figure class="float-md-right" style="width: 20%">
<a class="reference external image-reference" href="https://chriswarrick.com/images/Windows10-1511.png">
<img alt="/images/Windows10-1511.thumbnail.png" src="https://chriswarrick.com/images/Windows10-1511.thumbnail.png">
</a>
<figcaption>
<p>The <em>About Windows</em> screen.</p>
</figcaption>
</figure>
<p>I upgraded Windows 10 from the RTM version (build 10240, July 2015) to the
<em>November Upgrade</em> version (1511/build 10560). It took me a good two hours,
multiple reboots, and a BSOD.</p>



<p>I upgraded to Windows 10 (from Windows 10) back in August. The upgrade
experience was okay. The main issue I had was that the error messages were a
bit uninformative. There was one error, Windows 10 claimed it <em>couldn’t check
available disk space</em>, which is a really strange way to say <em>your active
partition is a Linux one and you have a Linux bootloader set up</em>. But after
switching to the Windows bootloader, it worked fine. I only had to fight a bit
with the display drivers, but other than that, it succeeded.</p>
<p>Windows 10 claims to be <em>Windows as a Service</em>: a fast update cycle with
new Windows builds released often. Now, Linux users are accustomed to this.
Depending on your distribution, you get new versions somewhere between “every
day” (rolling release: Arch Linux, Gentoo, Debian sid), “every 6 months” (Ubuntu, Fedora), or some other time
scale.
(Three months and two weeks passed between the two “general” builds of Windows 10.)
And most of the time, the upgrades are fast and relatively painless.</p>
<p>With Windows 10, this is not the case. I booted to Windows yesterday, to set up
some new hardware and mess around with the OS. It offered the upgrade in
Windows Update. After downloading it (3 GB, according to Microsoft), it started
installing, without success. There were no error messages, and “Error” or
“Failed to install” were all I could get.</p>
<p>I found the setup log files. The error log ended with “failed to
resurrect new system”. Which didn’t make a lot of sense to me, even though I’m
quite proficient with this sort of things.</p>
<p>This can be dangerous, so I backed up my drives with Clonezilla, which is
really useful — and it ships with the Arch Linux ISO, which helped a lot.</p>
<p>So, I tried my trusty friend, the Media Creation Tool. I needed it to get the
original install to work, and it came useful now. After yet another download,
I got a USB stick with Windows 10 on it. So, I rebooted to the installer, which
told me I can’t use it and I need to start it from within Windows.</p>
<p>I rebooted back into Windows, started the installer. It took it a while to
begin the installation process (including waiting forever to get updates,
so I restarted the process and disabled updating now, and another long wait to
make sure it will work on my machine), but then it went quite fast and was at 70%
after less than 10 minutes. Sadly, that’s too good to be true. It rebooted and
started counting from zero. 90 minutes passed since I started, and the login
screen came up. Username, password, log in.</p>
<p><em>Hi, we’ve updated your PC.</em> Six more minutes, but at long last, I got my
desktop. There’s just one problem though: 1024×768 is not the screen resolution
I started the install with (oddly enough, the “Updating Windows” part was
running at 1080p for part of the process, and then went back to 768p after a
reboot). I tried installing NVIDIA drivers, and it failed — however, Windows
managed to install something and wanted a reboot (what is this, Windows 95?).
Fine, let’s reboot and get a fully functional Windows environment?</p>
<p>:( <em>Your PC ran into a problem and needs to restart.</em> A blue screen of death,
on the second boot, talking about <em>critical structure corruption in CI.dll</em>. Well, shit.
I rebooted, but I first took a little detour to the Arch Linux USB stick I
prepared before to get a sane bootloader back. I’ve done this before, and
usually requires three commands.</p>
<div class="code"><pre class="code console"><a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-1" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-1" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-1"></a><span class="gp"># </span>mount<span class="w"> </span>/dev/sda2<span class="w"> </span>/mnt
<a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-2" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-2" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-2"></a><span class="go">Metadata kept in Windows cache, refused to mount.</span>
<a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-3" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-3" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-3"></a><span class="go">Failed to mount &#39;/dev/sda2&#39;: Operation not permitted</span>
<a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-4" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-4" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-4"></a><span class="go">The NTFS partition is in an unsafe state. Please resume and shutdown</span>
<a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-5" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-5" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-5"></a><span class="go">Windows fully (no hibernation or fast restarting), or mount the volume</span>
<a id="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-6" name="rest_code_fa94c0ac7abc4e0ea04f530945b05c35-6" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_fa94c0ac7abc4e0ea04f530945b05c35-6"></a><span class="go">read-only with the &#39;ro&#39; mount option.</span>
</pre></div>
<p>Wait, what?! I remember my hard drive layout, and <code class="docutils literal">/dev/sda2</code> is my Linux
ext4 partition! I checked <code class="docutils literal">cfdisk</code>, and apparently I now have a <em>Hidden NTFS WinRE</em>, with Linux moved to <code class="docutils literal">/dev/sda3</code> and my extended partition moved to <code class="docutils literal">/dev/sda4</code> (what would happen if I already had four partitions?). This is typical Windows misbehaviour: <strong>not caring about other OSes that might be installed</strong>.</p>
<p>I accepted this defeat, mounted <code class="docutils literal">/dev/sda3</code>, ran <code class="docutils literal"><span class="pre">arch-chroot</span> /mnt</code> and
<code class="docutils literal"><span class="pre">syslinux-install_update</span> <span class="pre">-i</span> <span class="pre">-a</span> <span class="pre">-m</span></code> (I’m not a fan of GRUB 2, and I have a MBR
drive layout). I should test this out by rebooting into Linux.</p>
<div class="code"><pre class="code console"><a id="rest_code_501f298e96904fbcacf4959713042dfe-1" name="rest_code_501f298e96904fbcacf4959713042dfe-1" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_501f298e96904fbcacf4959713042dfe-1"></a><span class="go">Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)</span>
<a id="rest_code_501f298e96904fbcacf4959713042dfe-2" name="rest_code_501f298e96904fbcacf4959713042dfe-2" href="https://chriswarrick.com/blog/2015/12/27/windows-10-november-upgrade-windows-as-a-dis-service/#rest_code_501f298e96904fbcacf4959713042dfe-2"></a><span class="go">Welcome to emergency mode!</span>
</pre></div>
<p>systemd <strong>really</strong> values <code class="docutils literal">/etc/fstab</code>, and you can’t boot if any entry fails
to mount, which was the case with the Windows drive in <code class="docutils literal">/dev/sda1</code> and my
other NTFS partition (note that the error message is very unhelpful)</p>
<p>I guess I have to get into Windows first. I tried booting Windows again, this
time it worked (in glorious 1080p, which was the case on the previous boot
too).</p>
<p>So, Windows re-enabled Fast Boot (a.k.a. hibernation instead of clean shutdown)
as part of the upgrade. I hunted down the setting and restored sanity.
But when I was doing that, I noticed things were spelt (or spelled) a bit
differently than two hours ago. You see, the original Windows 7 system was US
English. After the upgrade to Windows 10, I took the opportunity to install the
British and Polish language packs (it’s a multi-user machine). Both of which
were gone. I had to fix that, too.</p>
<p>And all I got out of it were colourful window borders, which are not even in my
desired colour (Windows has a limited colour palette, even though I explicitly
set it to <a class="reference external" href="https://chriswarrick.com/brand/">#00AADD</a>). What a great way to waste a Saturday!</p>
<p>This leaves me wondering, how does this work for Windows Insiders (Microsoft’s
community beta testers)? Is the process better if Windows Update manages to
perform the install? Or is it substantially faster if you’re running on a SSD?
Perhaps the testers have dedicated machines and don’t run experimental builds
on their daily drivers. But I doubt that, because that’s a significant
investment without any financial gain from helping out a corporation. So,
virtual machines? I have no idea how they cope.</p>
<p>By the way, <code class="docutils literal">cmd.exe</code> and <code class="docutils literal">winver.exe</code> claims it’s <em>Copyright © 2016</em>. Previously, Windows copyright
notices were outdated. Now, they’re in the future.</p>
]]></content:encoded><category>Windows</category><category>rant</category><category>review</category><category>Windows</category></item><item><title>Adventures in Windows: Music Player Daemon</title><dc:creator>Chris Warrick</dc:creator><link>https://chriswarrick.com/blog/2013/09/01/mpd-on-windows/</link><pubDate>Sun, 01 Sep 2013 17:15:00 GMT</pubDate><guid>https://chriswarrick.com/blog/2013/09/01/mpd-on-windows/</guid><description>
Recently, I had to reinstall Windows.  One of the things I had to set up
was MPD, the Music Player Daemon.
This is a short guide on how to do this.
</description><content:encoded><![CDATA[
<p>Recently, I had to reinstall Windows.  One of the things I had to set up
was MPD, the <a class="reference external" href="http://musicpd.org/">Music Player Daemon</a>.</p>
<p>This is a short guide on how to do this.</p>



<section id="step-1-get-mpd-and-mpc">
<h1>Step 1: get MPD and MPC</h1>
<p>Download <a class="reference external" href="http://musicpd.org/download/win32/">MPD</a> (<code class="docutils literal"><span class="pre">mpd-x.y.z-win32.zip</span></code>, replacing <code class="docutils literal">x.y.z</code> with whatever is the current available version of this file) and <a class="reference external" href="http://musicpd.org/download/mpc/">MPC</a> (<code class="docutils literal"><span class="pre">mpc-x.y-win32-zip</span></code>).  I suggest using
<code class="docutils literal"><span class="pre">C:\mpd</span></code> as your base path.  This post assumes you actually used this
value.</p>
<p>Put everything from the <code class="docutils literal"><span class="pre">/mpd-x.y.z-win32/bin/</span></code> directory of the
<code class="docutils literal"><span class="pre">mpd-x.y.z-win32.zip</span></code> archive into your base path (<code class="docutils literal"><span class="pre">C:\mpd</span></code>).  From
the <code class="docutils literal"><span class="pre">mpc-x.y-win32.zip</span></code> archive, take <code class="docutils literal">mpc.exe</code> and
<code class="docutils literal"><span class="pre">libmpdclient-2.dll</span></code> and put them there.</p>
</section>
<section id="step-1-5-optional-but-recommended-get-gmpc">
<h1>Step 1.5 (optional, but recommended): get GMPC</h1>
<p>If you want a nice, easy, graphical interface for MPD, you should install
GMPC, the <a class="reference external" href="http://gmpclient.org/">Gnome Music Player Client</a>.  The installation is very
straightforward, so I’ll leave the details out.</p>
</section>
<section id="step-2-create-a-config-file">
<h1>Step 2: create a config file</h1>
<p>You need to create a configuration file.  A sample one is included in
<code class="docutils literal"><span class="pre">/mpd-x.y.z-win32/doc/mpdconf.sample</span></code>.  Use the <code class="docutils literal">winmm</code> output type.</p>
<p><strong>Warning:</strong> Windows Notepad will not work, because it does not understand
Unix-style line endings (<code class="docutils literal">\n</code> instead of <code class="docutils literal">\r\n</code>).</p>
<p>For <code class="docutils literal">db_file</code> and <code class="docutils literal">log_file</code>, I recommend a file in <code class="docutils literal"><span class="pre">C:\mpd\data\</span></code>.
I also recommend saving your config as <code class="docutils literal"><span class="pre">C:\mpd\data\mpd.conf</span></code> (in fact,
this is yet another assumption we make in this guide)</p>
<section id="multi-boot-corner-keep-parts-of-the-config-the-same">
<h2>Multi Boot Corner: keep parts of the config the same</h2>
<p>Because I have a dual-boot system, there are some directions for
multi-boot users.</p>
<p>Your <code class="docutils literal">music_directory</code>, <code class="docutils literal">playlist_directory</code> and <code class="docutils literal">state_file</code> <em>must</em> be the same on all the systems in your multi-boot environment.  It is recommended to use the same <code class="docutils literal">db_file</code>.</p>
<p>Your audio outputs must have the same names.</p>
</section>
</section>
<section id="step-3-test-your-configuration">
<h1>Step 3: test your configuration</h1>
<p>Open up two Command Prompt windows.  In the first one, run:</p>
<pre class="literal-block">cd C:\mpd
mpd data\mpd.conf</pre>
<p>If you see this message:</p>
<pre class="literal-block">Failed to load database: Failed to open database file &quot;&lt;name&gt;&quot;: No such file or directory</pre>
<p>then you can ignore it.  If you see another message, fix whatever it
states.  You may also use <code class="docutils literal"><span class="pre">--stdout</span></code> or <code class="docutils literal"><span class="pre">-v</span></code> to get more output
messages.</p>
<section id="multi-boot-path">
<h2>Multi Boot path</h2>
<p>If you followed the Multi Boot instructions correctly, you might be
hearing music already.  If you do not, use your other Command Prompt window and
run:</p>
<pre class="literal-block">cd C:\mpd
mpc play</pre>
<p>If it outputs the name of a song, a <code class="docutils literal">[playing]</code> line, all is well (if you
cannot hear music, unmute your audio).</p>
<p>If you do not have a mpd database yet, use the <em>Single path</em>.</p>
<p><strong>If MPD works, press Ctrl+C in the window where you ran ``mpd
datampd.conf.``</strong></p>
</section>
<section id="single-path">
<h2>Single path</h2>
<p>In the other Command Prompt window, run:</p>
<pre class="literal-block">cd C:\mpd
mpc update
mpc add &quot;FILENAME&quot;
mpc play</pre>
<p>(FILENAME should be a name of a file in your music library.  Make sure to
keep the quotes.)</p>
<p>And now you should hear music.  If you do not, try to unmute, then read
the output of <code class="docutils literal">mpc</code> and try to fix it.</p>
<p><strong>If MPD works, press Ctrl+C in the window where you ran ``mpd
datampd.conf.``</strong></p>
</section>
</section>
<section id="step-3-5-test-gmpc">
<h1>Step 3.5: test GMPC</h1>
<p>Start the Gnome Music Player Client.  Click <em>Forward</em>, <em>Connect</em>,
<em>Forward</em>, <em>Close</em> and all should be well.</p>
</section>
<section id="step-4-create-a-windows-service">
<h1>Step 4: create a Windows service</h1>
<p>In order to run the daemon in the <em>daemon</em> mode, i.e. hidden, you need to
perform some extra steps.  You cannot use Startup in the Start Menu, you
also cannot use the Run registry keys (this results in an ugly Command Prompt
window running all the time that you cannot close or hide in the tray).</p>
<p>How to solve this problem?  Just run it as a Windows service.  That is
very easy to do.</p>
<p>Open a Command Prompt window as an administrator (right-click on <em>Command
Prompt</em> in the Start Menu/on the Start Screen and choose <em>Run as administrator</em>).</p>
<p>In that window, run one very easy command (make sure to copy-paste this
exactly!):</p>
<pre class="literal-block">sc create mpd binPath= &quot;c:\mpd\mpd.exe c:\mpd\data\mpd.conf&quot;</pre>
<p>If it said:</p>
<ul class="simple">
<li><p><code class="docutils literal">[SC] CreateService SUCCESS</code>, congratulations — you are almost done!  Skip down to <em>Service configuration.</em></p></li>
<li><p><code class="docutils literal">[SC] OpenSCManager FAILED 5: Access is denied.</code>, you need an
<strong>Administrator</strong> Command Prompt.</p></li>
<li><p>something else, check your spelling or Google the error.</p></li>
</ul>
<section id="service-configuration">
<h2>Service configuration</h2>
<p>That is the easiest part of this guide.</p>
<p>Start the <em>Services</em> console.  You can get to it by typing
<code class="docutils literal">services.msc</code> into the Start Menu/Screen search (<em>Run</em> for XP or
older).</p>
<p>In the tool, find the <code class="docutils literal">mpd</code> service.  Go to the <em>Log On</em> tab, choose
<em>This account:</em> and enter your credentials there.  Hit <em>Apply</em> and go to
the <em>General</em> tab, on which you should choose the <em>Startup type</em> to be
<em>Automatic (Delayed Start)</em>.  Finish by pressing <em>Start</em>.  MPD should be
running and configured properly.  You can now hit <em>OK</em> and close the
<em>Services</em> window, along with the command prompts you have open.</p>
<p><strong>Warning:</strong> if you change your Windows password, you need to change your
password in the <em>Services</em> console as well!</p>
</section>
<section id="just-in-case-uninstalling-the-service">
<h2>Just in case: uninstalling the service</h2>
<p>First off, stop the service (in the Services console or through <code class="docutils literal">sc stop
mpd</code> in an administrator command prompt).</p>
<p>Then, run <code class="docutils literal">sc delete mpd</code>.</p>
</section>
</section>
]]></content:encoded><category>Windows</category><category>guide</category><category>mpd</category><category>Windows</category></item></channel></rss>