Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Computername?

By Level 11 Flexeran
Level 11 Flexeran
Hi All,

I'm new to installshield but not to packaging. I've taken a snapshot of a clean image, installed the packaged and captured the changes.

Now after examining the irp the application I am repackaging puts an entry in the registry that is equal to the computername of the computer it was installed on.

How can I put in a variable such as %Computername% . I’ve tried %computernamer% in the registry key but it takes that value literally.

I then skipped that app and moved on to another but this one creates files using the computername. Arrghhh!


Please Help
(9) Replies
MSI defines a property called ComputerName, and you can place the value [ComputerName] in a registry key, where MSI will expand the property at run time. (To expand the environment variable, you can use [%COMPUTERNAME].)

(If you have a copy of Administrator's Introduction to Application Repackaging and Software Deployment using Windows Installer --- --- this MSI "Formatted" data type is described in Chapter 8...)
By Level 11 Flexeran
Level 11 Flexeran
Thanks for that mate. I'll give it a try and let you know how we get on.

All the best
On a related question. Acrobat writer creates a dsspooler using the computername. but using the DNSDOMAIN and standard DOMAIN variables.

can we use any envinroment variables or just computername?

If not is it easy enough to create a null value or 3 in the MSI database and use a custom VB action to read the registry/env. vars. and write them into those values at runtime? i assume it would them also have to be placed between costinitialise and finalise? or can it simply go right into the beginning as nothing really denends on it as such?
You can use any Environment variable with the syntax [%VariableName].
Hi guys,

I have now tried:

none of these actually resolve? they just make a registry entry of the same value i.e:

[%COMPUTERNAME].[%USERDNSDOMAIN] should go into the registry as: but goes as:


the same with all the other combinations I tried. any more info here?

does this mean then that i have to create a type 51 custom action called for instance [pcname] and make a custom action early in the install process which then sets this value to the [%COMPUTERNAME] value and then actually use the:

[pcname].[pcdomain] thing instead of

If you look in the Registry table using the Direct Editor view of Developer, do you see [%COMPUTERNAME].[%USERDNSDOMAIN]?
ok I have it done now 🙂 Was a little confusing at first..but works everytime now.

In case anyone else is wondering I have attatched a TXT file (no word, hate macro alarms) with step by step instructions (well okay, not entirely step by step). but it will get you through.

Finally a distiller that works everywhere 🙂
I had a very similar situation with a package, and with AdminStudio quirks. The machine name needed to read dynamically during the install. Yes, I finally figured out that you use "[%computername]" for that, but I had tried replacing the Property Clientname, in this case, with [%computername], but when Clientname was used to set a registry entry, of course it put in literally "[%computername]". So I either had to put "[%computername]" in for the registry entries (not a very good way of doing it) or use "[[Clientname]]" so that the value of Clientname was inserted, and then THAT was interpreted to be the actual machine name.

The AdminStudio quirk was this: I did all that and it still wasn't working. I was modifying the MST in Developer because of the additional capabilities it offers over Tuner. Everything I tried, the registry was always stamped with literally "[%computername]". Finally, I opened the same MST in Tuner, and looking at the same fields in there, it wasn't "[%comptuername]", but something more like "[[/]%computername[/]]". It did NOT show up that way in Developer and was driving me nuts. Just thought maybe someone else might find that useful or may have seen the same thing before.