Windows SDK installation woes. Update: Solved, sort of.

My computer doesn’t have a dxsdkver.h file. That should be in the DirectX SDK. Except that no longer exists, and is now part of the Windows SDK (latest version: 7.1). That should have been installed with Visual Studio, but somehow my computer is very special, once again.

So today I tried installing the Windows SDK, and I get this feeling of deja vu:

A problem occurred while installing selected Windows SDK components.

Setup could not find the file WinSDKhelpWinSDKHelp_x86.msi at any of the specified source locations http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup

I cannot install the Windows SDK, and I have been here before! In fact, my Firefox history still remembers half the links that a cursory Google search lists as visited. I hope it doesn’t mean I have to reinstall Visual Studio.

Update 1: I downloaded the Windows SDK 7.1 ISO, ran the setup from that, and now I get this message:

Installation of the “Microsoft Windows SDK for Windows 7” product has reported the following error: Please refer to SamplesSetupHTMLConfigDetails.htm document for further information.

What the Hell? That tells me nothing. Google points me to this page of regedit fuckery, which seems like something I tried last time I was here, but will be the next thing I try.

Update 2: Well, that didn’t work either. The next advice I followed was from this forum post, which suggested to uncheck the compilers (since I believe I have the SP1 compiler installed), but again, no dice. Time to try installing one component at a time, and fine-combing the log file each time one fails.

Update 3: Never mind what I just wrote. It turns out even when I deselect every single option in the installer, the installation still fails.

=== Logging started: 2/19/2012  18:05:16 ===

Action start 18:05:16: INSTALL.

Action start 18:05:16: DDSE_CA_Uninstall_InstallExecuteSequenceStarts_x86.

02/19/12 18:05:16 DDSet_Status: LANGID: 1033

02/19/12 18:05:16 DDSet_Entry: ImmediateDispatch: DDSE_CA_Uninstall_InstallExecuteSequenceStarts entry

02/19/12 18:05:16 DDSet_Error: Patch Hooks: Missing required property ‘ProductFamily’: Setup cannot continue.

02/19/12 18:05:16 DDSet_Warning: Setup failed while calling ‘getDLLName’. System error: Cannot create a file when that file already exists.

Every log file has entries like this, which seems to indicate that something that’s already installed is causing an issue with this installer. WTF.

Update 4: Progress!

Further on, the log file said that

vcredist_x86.exe installation failed with return code 5100

On a whim, I uninstalled the Visual C++ 2010 x86 Redistributable from the control panel, then tried the “empty” installation again, and Heureka! It worked.

Maybe now I can install the full product?

Installation of the “Microsoft Windows SDK for Windows 7 Compilers for x86” product has reported the following error: Fatal error during installation.

Let me just uninstall “Microsoft Visual C++ Compilers 2010 SP1 Standard – x86. I’m pretty sure I can install them again later. and oh wonder, the installation finishes!

Still doesn’t include dxsdkver.h, though. I think my initial research must have been faulty.

The problem with tolua++ and DLLs (solved!)

Today I was going to make a tiny DLL that binds some C code with tolua++, and I ran into this error message:

lua: error loading module ‘foo’ from file ‘daisydebugfoo.dll’:

        The specified procedure could not be found.

That looks like my DLL isn’t exporting the luaopen_foo function correctly. That is the function lua calls to initialize the package it just opened, and tolua++ was not declaring it properly:

TOLUA_API int luaopen_foo (lua_State* tolua_S) {
  return tolua_foo_open(tolua_S);
};

TOLUA_APIis defined toextern, which doesn’t mean that it will be exported by the DLL, because on windows, the magic incantation for that is__declspec(dllexport). The tolua++ header has no special treatment for Windows, so I’m guessing that problem has just never come up for them.

Once the problem is understood, the solution is easy: I added another function to dllmain.cpp that has the correct export declaration and calls the generated one.

extern "C" {
  int tolua_bar_open(lua_State*);
  int __declspec(dllexport) luaopen_foo (lua_State* L) {
    return tolua_bar_open(L);
  };
}

There’s one caveat, because tolua++ has already created a function named luaopen_foo, so I had to tell it to name things differently, for which there is a command-line argument:

tolua++ -n bar foo.pkg > foo.c

Free Stuff beats Warez

WinZip, WinRar, MIRC, Nero. There is some software that we see installed on PCs over and over again, that either displays nag screen along the line of “This is day 398 of your 30 day trial” or where it’s obvious the user used crackz or serialz or a warez version of the software because he’s too cheap (or frankly, too lazy) to pay the few dollars it costs to register.

Please don’t do that. It makes you and your computer look cheap. Instead, why not hit two birds with one stone and exchange those programs with something that is free and better? Here is some free Windows software I use that does the job much better than the whiny commercial competition:

  • Irfanview (replaces: ACDSee)
    I used to love ACDSee, and then they started bloating it with all kinds of camera and image manipulation features I had no interest in. All I wanted was an image viewer/converter! Irfanview is exactly that, and it’s really fast. Favourite features: Paste from clipboard, crop, resize, convert.
  • 7-Zip (replaces: WinZip, WinRAR)
    The built-in ZIP management in Windows XP is crap, so I understand the need for something else, especially to open rar and gz giles. Winzip suffers from bloat, WinRar from being ugly. 7-Zip is no beauty eiter, but it’s free, small and just works.
  • MegaIRC (replaces: MIRC)
    When Looking for a MIRC replacement, most people go for xchat. If you want crazy scripts, lots of colors and a marching band then that’s probably your best bet. Me, I want to chat with people. MegaIRC does a few more things than that, probably not very many, but I don’t care. It has everything I need.
  • Notepad++ (replaces: Textpad)
    For a long time, Textpad was my Notepad replacement of choice. But aside from the license costs, the syntax highlighting in Notepad++ is better, and it has an options dialog that makes it easy to change file assosizations so all those .ini, .inf and .txt files get opened with the program I want. Sadly, the regular expression support is not as good, but I’ll make that one sacrifice.
  • Pidgin (Replaces: MSN, AIM, ICQ, Trillian)
    I hardly ever see people use the original ICQ client anymore. The advertising must have killed it. Sadly, the same cannot be said for the MSN client. Pidgin is the rare case of a GTK program that I do not mind using on Windows – Usually, they look hideous, but the Pidgin developers are doing a good job. For all your combined IM needs, give it a spin. Or possibly Miranda, but don’t even think about Trillian!
  • VLC (replaces: Mediaplayer, WinDVD)
    Mediaplayer never has the codecs I need, WinDVD has some weird licensing thing going. VLC just works, and it’s long been the cure-all for video problems. Plus I can bring a portable version on my USB stick
  • CDBurnerXP (replaces: Nero)
    I hardly ever burn CDs, and never DVDs. I don’t see the point. But when I do (let’s say CDs for the car radio) then this program gives me everything I want. I can’t imagine what else I could want, really.
  • Paint.NET (replaces: MS Paint, Photoshop)
    Okay, I admit: I’m not a Photoshop power user. In fact, most of my drawing needs require something easy geometrical. And I find it hard getting Photoshop to draw a simple line that’s one pixel wide, not anti-aliased. Too advanced for me. Paint.NET saves me from doing this kind of thing in Paint, and is just those two steps more evolved that make drawing “coder graphics” fun again.
  • Inkscape (Replaces: Corel Draw, Illustrator)
    What I just said about Photoshop goes double for Corel Draw: I liked it up until Version 2, and then they lost me with their features. Plus, all my old files are no longer readable by anything today. Fail. Inkscape uses open formats, has few but powerful tools (that I understand) and for the few things I do, it’s totally adequate.

Your mileage may vary, but I’m happier with these programs than their commercial competition. Happy enough to spend time writing about it 🙂