Various technical articles, IT-related tutorials, software information, and development journals
Monday, July 9, 2018
Setting the icon for an entry in the New context menu
Entries in the New submenu of the Explorer right-click menu are generated by ShellNew subkeys in the Registry. One user wanted to know how the icon for those entries is determined. By default, Explorer will use the file type's icon, but this can be overridden by placing an IconPath string value in the ShellNew key. The format is the same as most resource identifiers: the path to the file containing the icon, a comma, and the numeric resource ID. For example, %ProgramFiles%\Windows Mail\wab.exe,10 is an open book icon. Changes to the New-related Registry entries require a restart of Explorer before taking effect.
Sunday, July 8, 2018
Making a shortcut to troubleshoot compatibility for a specific program
One user wanted a fast way to open the Program Compatibility Troubleshooter and start troubleshooting a specific program. The PCT window is provided by msdt.exe, but Process Explorer reveals that it doesn't get passed the path to the program to be troubleshot. Rather, it receives a path to an XML file written by the very short-lived pcwrun.exe. That process exits so fast that I couldn't get a command line out of it, but simply passing the path to the incompatible program's EXE works just like clicking the "run compatibility troubleshooter" button in the Properties window.
Friday, July 6, 2018
Policy Plus gets its first pull request
This morning, a Policy Plus user submitted a pull request. Apparently, some ADMX files (like the Office ones) have blank values for some XML attributes specifying numeric default values. I'm pretty sure that's not compliant with the ADMX specification, but if the Local Group Policy Editor supports it, Policy Plus should too. The pull request fixes the problem by assuming the appropriate type's default (in the .NET sense) value if the attribute cannot be parsed into that type.
Thursday, July 5, 2018
Keen Modding Live - URL parsing expansion
The only part of Abiathar Live Studio that needs to know about the non-API parts of the Keen Modding Live web site is the URL format of the level and version pages. The dialog for selecting a level is supposed to be able to extract level or version information from the URL on the clipboard, which it can only do if its idea of what the web site is doing matches up with reality. So today I expanded the pasted-URL parser to deal with level information pages (in addition to version player pages).
While testing, I accidentally chose a Keen 1 level and found that the level picker was happy to go ahead with it. The level search dialog filters out levels of non-Abiathar-compatible episodes, but the URL-pasting route did no such checks. I'm sure all kinds of bizarre behavior would occur if a Vorticons level was selected, so I added some logic to stop that.
While testing, I accidentally chose a Keen 1 level and found that the level picker was happy to go ahead with it. The level search dialog filters out levels of non-Abiathar-compatible episodes, but the URL-pasting route did no such checks. I'm sure all kinds of bizarre behavior would occur if a Vorticons level was selected, so I added some logic to stop that.
Wednesday, July 4, 2018
Keen Modding Live - New versions via web
A conspicuously absent feature from the Keen Modding Live web site up to this point was the ability to upload new versions of existing levels. It was possible in Abiathar Live Studio through the API, but no such program exists for Vorticons levels. Today I set to work adding that feature to the web site.
I decided that, to avoid duplicating effort, I would extend the existing level upload page to optionally take a level ID as an URL parameter. I started off with a light sprinkle of embedded PHP to pre-fill and disable the fields that were already determined at the level's creation if a level is specified. While I was at it, I added fields for version comment and level description, which weren't possible to set via the web before.
To populate the list of versions (from which to choose the base version for the new one), I embedded a larger chunk of PHP that echoes a JSON array into a JavaScript fragment that then populates the dropdown with it. I would have just used the API from JavaScript like I did with the episode and zone dropdowns, but I wanted to show the usernames of the version authors, and doing that from JavaScript would require at least one more round trip. And I would have had PHP render the <option> tags, but I didn't want to risk messing up the escaping and causing security issues.
I successfully used this new system to upload a new version of my tiny Keen 6 test level, after which I noticed that I forgot to add a way to mark the new version as recommended. So that's the next step.
I decided that, to avoid duplicating effort, I would extend the existing level upload page to optionally take a level ID as an URL parameter. I started off with a light sprinkle of embedded PHP to pre-fill and disable the fields that were already determined at the level's creation if a level is specified. While I was at it, I added fields for version comment and level description, which weren't possible to set via the web before.
To populate the list of versions (from which to choose the base version for the new one), I embedded a larger chunk of PHP that echoes a JSON array into a JavaScript fragment that then populates the dropdown with it. I would have just used the API from JavaScript like I did with the episode and zone dropdowns, but I wanted to show the usernames of the version authors, and doing that from JavaScript would require at least one more round trip. And I would have had PHP render the <option> tags, but I didn't want to risk messing up the escaping and causing security issues.
I successfully used this new system to upload a new version of my tiny Keen 6 test level, after which I noticed that I forgot to add a way to mark the new version as recommended. So that's the next step.
Tuesday, July 3, 2018
Keen Modding Live - ZXC fix
Today while poking around the Keen Modding Live site, I found that Keen 1 and Keen 4 levels were completely failing to load when the keyboard preference was Z/X/C (as opposed to Ctrl/Alt/Space). The problem was that I had mistakenly kept the CTLPANEL/CONFIG file in the game folder while packaging those episodes. When the ZXC-enabled configuration file was injected, the DOSBox JavaScript thingy I'm using complained about a duplicate file and keeled over. Deleting extra files and repackaging fixed the problem.
Monday, July 2, 2018
Keen Modding Live - Cleaning up files
With Abiathar Live Studio effectively done, it's time to give Keen Modding Live an actual web site. The pages and scripts that are there made reference to several pages that are either blank placeholders or not there whatsoever. Apparently when I first started arranging things, I had plans for a "dashboard" page for logged-in users, distinct from the homepage. Now I think it would be nicer and simpler to just have a feed of recently published levels be the homepage for guests and members, with another feed showing up on the side for members' personal events. So I went through and cleaned up all the redirects to the nonexistent dashboard page.
Subscribe to:
Posts (Atom)