Author Archives: admin

Chained MSIs in InstallShield 2009

0
Filed under Installations

One of the big features new to Windows Installer 4.5 and InstallShield 2009 is the ability to chain MSI files. If you’re not familiar with the concept, MSI chaining is the ability for your installation to seamlessly install other installation packages without resorting to special case merge modules or other trickery.

Say your application needs to install SQL Express 2005. Set SQL Express up as a chained MSI and it will be seamlessly installed when your app is installed.

Now, at least some of this was possible under older versions of Windows Installer, but it wasn’t particularly pretty, or seamless.

However, start playing with it and the shine quickly wears off to reveal that, as usual, it’s a half-implemented feature.

The biggest problem I’ve run into so far? VSTO3.0.

Microsoft released VSTO 3.0 as a single SETUP.EXE. You can’t chain a SETUP.EXE though.

Strike one.

But, you CAN start the VSTO 3.0 installation, wait till it gets to it’s first screen, then grab all the contents of the installation that get dumped to a temp folder on the C: drive. In that bunch of files is the actual MSI that gets installed.

That MSI, you can chain just fine.

Ah, first base.

Try and deploy though and you’ll likely get messages about an interface having to do with SmartTags being missing. Come to find out, that was a big oops in the first release of VSTO 3.0, so Microsoft released VSTO 3.0 SP1. It also is a SETUP.EXE, but, upon extracting it, it actually consists of an MSP file (a PATCH) and not an MSI file.

And you cannot  chain a patch file.

Strike 2.

Now, normally, patches can be applied to an MSI as a transform to create a new MSI, complete with the patch. But it appears that the VSTO 3.0 SP1 patch wasn’t authored with that in mind, as I could never, even with the help of Accresso support, actually apply the patch to my VSTO 3.0 MSI file.

Strike 3. Game over.

In the end, I had to resort to InstallShield Prerequisites, workable, but not near as clean as chained MSI installations.

Getting InstallShield Prerequisite Conditions to Function Properly

435
Filed under Installations

Here’s the “Prerequisite condition editor” dialog from InstallShield 2009:

image

The first snag I ran into was determining what the difference was between a registry entry having a “specified value” and one having a “specified version value”.

It’s certainly not clear from this dialog, since both options show the same set of properties at the bottom of the screen.

It’s also not in the help file or documentation online anywhere that I could find.

Come to find out, the former performs a “stringwise” comparison, whereas the latter performs a numeric comparison. Pretty important distinction.

Then there’s that “Run this prerequisite if the specified registry value data has the following relationship to the existing data” frame. huhwha?

I had to read that one more than a few times to grok what it’s actually trying to say, and that’s never a good sign.

Top it off with the fact that a call to InstallShield support verified that the sentence logic itself is backwards. Even the developers couldn’t read it right!

End result. Let’s say you want to install your prerequisite if registry value x is non-existent or 1.

In that case, you’d need to set the condition as a “Registry entry has a specified version value” type condition, you’d set the registry key and value names appropriately, and finally you’d set a “value data” to 1 and set the relationship to “is less than”, even though that is the opposite of what the dialog reads.

Fonts that Won’t Install

0
Filed under Fonts

image I’ve collected a good number of fonts over the years, but recently, when I went looking for a font for a particular purpose, I noticed that a sizable number wouldn’t install under Vista, the installation process responding with a message indicating that the font was corrupted.

My first thought was VIRUS! But after checking a number of files, they all appears more or less like TTF files that would install.

It was highly unlikely that this number of fonts just “became” corrupted, so I started researching the problem.

Come to find out, true type font files contain a number of descriptive fields such as the name, family of the font, style and so on.

Under Windows 95, Win2K and even earlier Windows XP, these extra fields were essentially ignored.

BUT, under Windows Vista (and, apparently Windows XP SP2), these fields MUST BE FILLED or Windows will indicate that the font is corrupt.

So the question became, “How the heck do I fill in those fields?”

Font Creator to the rescue.

This is a nifty little program that allows you to edit TTF files, glyphs and all. Now, I’m no professional typographer, but I’d played with Font Creator several times in the past to cobble together special purpose fonts for one reason or another.

I downloaded the newest 5.6 eval version, installed and tried loading a font. Sure enough Font Creator could load all these “corrupted” fonts just fine.

So I started poking around until I came across the Tools/AutoNaming menu option.

Select it, let it suggestion names for all the various font descriptive fields, and the save the font.

Bam! The font is fixed and installed just like it’s supposed to.

Very cool.

Full Hard Disk Backup under Vista

0
Filed under Uncategorized

Finally, something that actually works fairly nicely under Vista

Microsoft includes a tool with Vista (I have Vista Ultimate, I’m not sure if this is included on all versions of Vista or not), that can backup your entire harddisk (usually one at a time, but for most people these days, drive C IS their harddrive) all at once, WITHOUT resorting to funky dos boot disks and the like.

It’s called Backup Your Entire Computer (catchy, eh?), and it’s located in the Backup and Restore Center on the Control Panel.

image

Basically, grab yourself a USB drive big enough to hold your entire C drive, open this window and click the Back up Computer” button.

It could take a while, so USB 2.0 is best, esp if you have several hundred gig to back up.

But, there’s an even handier way to work with it!

The command line utility wbadmin (Windows Backup Administrator) allows you to perform a complete computer backup directly via command line (or, more conveniently, via a batch file).

You run it like this:

wbadmin start backup -backuptarget:k: -allcritical -quiet -vssFull

where k: is the drive letter of the USB drive that you want to backup onto.

Couple that with the Task Scheduler to run this batch file automatically every night and you have a nice, simple way to guarantee that your drive is completely backed up.

And finally, Windows Backup creates a VHD file from your harddrive as the backup. Anyone familiar with Virtual PC might recognize VHD files as Virtual HardDisks.

And that might also mean you could open that vhd file without actually having to restore the entire thing. And you’d be right! Very cool. The details on doing so are fairly involved, but mainly it requires that you install the free Microsoft Virtual Server, if only for the Mount Virtual Hard Disk tool, which comes with Virtual Server.

Once you have that tool installed, you can mount a VHD back up file and it will appear to be just another harddrive on your computer. You can actually copy files from it or to it at will.

It’s not as easy as it should be, but it’s not too tough. Bart DeSmet has a really good description of doing exactly this on his site.

Debugging VSTO problems

0
Filed under Uncategorized

If you’ve ever worked on a VSTO addin, you may know how frustrating it can be to try debugging problems with them, especially problems of the “my addin isn’t being loaded” variety.

There is a way to get a little more information on the process, however.

Just set the environment variable VSTO_SUPRESSDISPLAYALERTS to “0”, and then restart the Office app of you choice.

Now, instead of just quietly failing, the VSTO loader should be a little more verbose about what’s happening.

In my particular case, it didn’t help all that much, but I could definitely see it helping in many cases.

Microsoft also has a KB article about it, but you’d almost never find it unless you knew what your were looking for up front.

Vista, XP, SQL Server 2005, Workgroups and Connections

6
Filed under Uncategorized

Whew! The title says it all.

imageI recently had a little problem with my server. Notice the 3 blown caps.

I had my 5 year old daughter take a look. Without pointing out anything in particular, I asked her “Ok, this computer isn’t working right. Any idea why?”

She looked around with a flashlight for about a minute and states “Those 3 batteries look like they’ve gotten dirty. Maybe you need to clean then up?”<g>

So, I’ve got no server as of now.

Fortunately, all my SQL databases I use for testing get backed up every night, so I still have them all. Unfortunately, the SQL Server installation itself was on that blown machine<sigh>.

I’d been wanting to virtualize my server for some time now, so this was the perfect opportunity. I fired up VMWare, cloned an existing XP VM I often use for testing, cleaned it up, put SQL Server 2005 on it, ran the SQL SP2 update, then restored all my DB backups. No problem.

With the VM running on my workstation, I loaded SQL Server Management Studio on my workstation and tried to connect to the virtual server.

image

(for search purposes, the message is “Login failed for user ‘argos\guest’. (Microsoft SQL Server, Error: 18456)”)

Hmm. I was pretty sure I had things set up right. So I tried SQL Authentication with the SA user and password.

I’m in.

Ok. That’s odd. And why is it trying to connect me as guest? Wait… Originally, my server was running Win2003 Server, so it had DNS setup. With it gone, I’m in workgroup mode. Ah! I didn’t have matching user accounts on this new virtual server and on my workstation. Set up a matching account, and try a remote connection request to the SQL Server from my workstation. Still no dice.

I checked the SQL ERRORLOG file (you can typically find it in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG), and I end up with this:

2009-02-05 16:11:36.36 Logon       Error: 18456, Severity: 14, State: 11.
2009-02-05 16:11:36.36 Logon       Login failed for user ‘ARGOS\Guest’. [CLIENT: 192.168.100.110]

That STATE number is the key. A state of 11 means “Valid login but server access failure” (There’s a really good table of error states here).

That was the clue I needed. After way too much googling, scratching my head and trying random things, I eventually came across this post by Jens Suessmeyer.

The short of it is that, under XP anyway, if you are running in a workgroup (ie non-domain) and you have Simplified File Sharing turned on, this will cause SQL Server to ALWAYS force remote authentication requests to fall back to the Guest user. It was only after I’d found the above post that I came across this MSKB article that describes the problem in more detail.

So, it’s off to the Folder Options dialog, I uncheck the Use Simple File Sharing option:

image

And, no more connection failures!

So, to sum up. If:

  1. You’re using SQL Server 2005 (and likely other versions as well).
  2. You’re running in a WORKGROUP environment
  3. You need or want to use WINDOWS AUTHENTICATION and not just SQL Authentication
  4. You set up a login on your server and your remote machine that exactly match in username and password
  5. You’ve enabled SQL Ports 1433 and 1434 through your firewall.
  6. You can connect via Windows Auth just fine when you run SQL Management Studio from the server
  7. BUT you get a connection error indicating that your trying to connect as GUEST, when you were expecting to connect as your current username.

Then you most likely need to turn OFF Simple File Sharing on the SQL Server machine.

.NET Interop and InstallShield

0
Filed under .NET, Installations

I’ve got a VSTO Com Addin for Word that I’m building an installation for. In the past, the addin had been handled via a DOT file, which is effective, but isn’t really the best way to build addins for Word, especially not now with VSTO.

At any rate, the product is working great, so I was putting an installation together.

I marked the particular assembly as .NET Interop, and when I built, IS complained that it couldn’t get the interop info from the assembly.

image

Huh? After some digging, turns out that InstallShield runs REGASM.EXE with the /REGFILE: switch to extract the COM registry information from the assembly, and then saves that in the MSI.

So, I tried running REGASM on my dev machine with the assembly.

REGASM MyName.MyAsm.dll /REGFILE:TestFile.reg

Worked perfectly.

So I tried it on my IS2009 box with the same assembly.

RegAsm : error RA0000 : Could not load file or assembly ‘Extensibility, Version=
7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its depe
ndencies. The system cannot find the file specified.

Hrm?

After scratching my head for a bit, I realized that my assemblies were compiled with .NET Framework 3.5, and that they definitely use some of the 3.5 specific features. It’d make sense that not having .NET 3.5 on the IS box could cause this.

So, a painstakingly lengthy .NET 3.5 install later, and I try the same regasm on my IS box.

No joy. Grrr.

So, I do what I should have done in the first place, open the project in Visual Studio and check the references. Sure enough, it points to an Extensibility.dll from the VSTO installation. Duh.

So, I go and install VSTO (to the InstallShield box, another grrr…)

No problems there, but still no joy.

Another look in the project and this Extensibility.dll lives with the VSTO V9.0 stuff. If I’m not mistaken, that means it’s an Office 2007 thing, not 2003 (which just happens to be the version of Office on the IS box).

Ok, maybe if I install the Office 2007 Primary Interop Assemblies?

image

More Grrr…

At this point, things are just irritating. I don’t want to install Office 2007 on what should ideally remain a more or less pristine dev box for doing install builds, so what next.

I know where this Extensibility.dll lives on my dev machine, I’m just not sure how REGASM looks for it, the GAC maybe, a search path (not likely), or some other arcana?

Screw it, I grab a copy of Extensibility.dll off my dev machine and copy it to the same folder as the DLL I’m trying to run regasm on.

RegAsm : error RA0000 : Could not load file or assembly ‘Microsoft.VisualStudio.
Tools.Applications.Runtime.v9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToke
n=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file
specified.

Aha! Similar message, different DLL! Now we’re getting somewhere.

Grab a copy of this “‘Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll” file off my dev machine, copy it to the same place and regasm again.

Repeat for another two dlls and REGASM will finally run through with no errors.

I’ve already had to pull TLBs and OLBs from Office installs for reference purposes in the application (for use on some dev boxes that don’t have either Office 2003 or 2007 installed), so grabbing a few more dlls for referencing purposes isn’t a big deal; they don’t have to be shipped with the application (they come with either VSTO or Office itself), and they can be checked into version control just like anything else.

In the end, I’m still not entirely convinced VSTO is a good way to build commercial addins for Office applications. It’s fine for quick and dirty internal projects, but it just seems to add a lot of additional complexity to releasing a commercial app. It’s harder to build a non-VSTO addin, but the end results may justify the extra effort.

Your mileage may vary.

WinIPAC controller software isn’t quite right

0
Filed under Arcade, Hardware, Troubleshooting

image Here’s an example of the “When software doesn’t work right, it can cost loads and load of time” type bug.

I’m using an Ultimarc WinIPAC controller board for a project I’m working on. This is an awesome little controller board that looks like a USB keyboard, and supports mapping of up to 56 switch inputs to any normal keyboard key. It also has LED outputs for driving LED’s or other applicable circuits.

Anyway, the IPAC comes with a simple keyboard mapper/programmer that you use to layout your buttons, then assign which key to which button and finally to upload the mapping to the IPAC (It saves the mapping in non-volatile ram on the board, which is even more fantastic).

Anyway, I’d mapped a particular key to the ENTER key, as shown here.

image

But when I was testing all my mappings out, it didn’t work. Actually, it’d flash sometimes but not consistently. Every other key worked flawlessly.

I spent the better part of 3 hours trying to debug what the heck was happening, swapping wires, using a test meter to verify connections, switch operation, etc.

I even pulled the latest version of their website, but still no joy.

In the end, I discovered that it’s the WinIPAC software  that doesn’t quite handle ENTER keypresses properly. I opened up NOTEPAD and just started pressing buttons and all of them, including the switch I had mapped to ENTER, worked perfectly.

<sigh>

<UPDATE> I emailed with Andy at Ultimarc (these guys get back to you quickly! Very nice support). Anyway, his comment was that the WinIPAC software isn’t intended as a test application, only for programming.

I pointed out that if that’s the case, there really ought to be a warning somewhere to that effect, especially if you map keys whose actions can’t be displayed properly in the application. My rationale was, well, it DOES properly display keyboard status for virtually all the mappable keys so why wouldn’t any normal person assume it could be used as a test app? But, in the end, it’s easy enough to use notepad for those tested, IF you know enough to realize you need to!

Changing the Windows XP Product Key

0
Filed under Uncategorized

I was working with a quite old inherited virtual machine today (VMs have a nasty habit of getting old and unpatched), and I needed to have SP2 (actually XP SP3 is out now) on it (to install SQL Express, among other things).

The problem was, this VM had a installation of XP, no service packs, using a product key who’s ancestry was, shall we say, questionable, at best.

Of course, I have several valid product keys from MSDN subscriptions, so I’m completely legit. But I needed to get this VM squared up so I could get products installed on it.

In the past, I’ve used a technique I found online whereby you edit a registry entry to invalidate your current activation (and thus force Windows to want to reactivate itself), then you run the msoobe.exe application with a certain command line to relaunch the activation process. Not to hard, but it didn’t work with my legitimate WinXP product keys. I have no idea why not, and there was nothing in any of the messages to indicate what was wrong.

Then I happened across a link to the Windows Product Key Update Tool.

A quick download and it worked perfectly. It properly accepted the product key for XP from my MSDN subscription, updated Windows and reactivated it straight away.

Certainly, a very handy tool to have in the stable!

Don’t Forget About the Task Scheduler

0
Filed under Utilities

A little known facet of Windows that’s been there since the early days of NT is the Task Scheduler (I seem to recall actually using the AT scheduler it under NT4, but my memory is sketchy back that far<g>).

image

It’s part of the Control Panel, and it essentially lets you schedule applications, scripts, etc to be run automatically, using a particular set of login credentials, at particular times.

Many applications out there can be run as Services, which means they run all the time, in the background, even before anyone has logged into the system.

But for many types of applications, running as a service isn’t necessary and just takes up memory and processor time from other applications that do need to run all the time.

I happen to use a backup utility called FileBack PC. They have a service module that allows it to run as a service, complete with scheduling etc. But they charge extra for that module.

I was really wanting to schedule my backups to run late at night, and I really wanted them to happen regardless of whether I’d logged into my server or not.

That’s when I remembered the Task Scheduler. Here’s an example screen of a configuration to run a backup job called “NearLine Backups” every morning at 7:00am.

image

In order to setup a scheduled task, you double click on “Add Scheduled Task” and walk through the wizard that follows:

First, the introductions screen:

image

Next, select the application you want to run, in my case, it’ll be FileBack.exe.

image

Choose to run it daily:

image

Set the time:

image

And finally, set the user name and password for the account that this task will be run as:

image

It’s quite important to get the account and password right, since the task that is run will run with those credentials. Also, if the task needs access to certain network resources or drives, that account will have to have access to those resources.

Once you have these bits set, you can always dblclick on the task from the Scheduled Tasks list and edit various details, such as additional command line parameters for the executable being run, etc. In my case, I had to add the name of the backup job I wanted to run, like so:

c:\program files\FileBack PC\FileBack.exe “NearLine Backups”

But every application will be different.

And that’s it.

If you are logged in as the user that the task will run as, and the task is scheduled to run, you’re likely to actually see it start and run.

If no one is logged in, or if you’re logged in as another user, you won’t see anything happening.

As always, you’ll want to test and verify that what you think should be happening actually is. But, using the Task Scheduler is certainly something to keep stashed in the toolkit!