Hi Jeff,
Let me try to answer your questions:
1) Why did it work on XP?
No, it shouldn't. I did the same test on various platforms - XP / Vista /
7, each with different versions of Windows Installer - 3.01 on XP, 4.0 on
Vista and 5.0 on Windows 7, got consistent error message. Since I can't see
your setup project, I'm not sure why exactly it works for you on XP. If
you'd like to, you can send me a small sample so I can check it up.
2) If in the Registry builder - I am adding a STRING value per the context
menu of the compiler, why does it not know that I am entering a string and
not an integer?
3) If the Registry builder is a string value - why doesnt the compiler
accept this and build it accordingly for the installer package.
Let me combine the 2nd & 3rd questions' answer together: It does know what
type of data you're entering. The problem is how the MSI package stores
these data.
Let's study a simple sample:
Say we have three values to write to the registry: TestString, TestBinary,
TestDWORD. In Visual Studio, we create three corresponding keys, and enter
their values.
Please note that the TestDWORD will not accept "10AD", we'll have to enter
"0x10AD" - the hex form, and it will be transformed into dec from 4269
automatically.
Then we compile the setup project, use Orca (yeah we have to use it again
to see what exactly happened) to open the compiled MSI, find the Registry
section, we'll see how these keys are stored:
TestString 10AD
TestBinary #x10AD
TestDWORD #4269
So, it is clear now in MSI it uses prefix like #x & # to differentiate data
types. There is no way for Visual Studio to make MSI remeber the data type
except using these prefixes. The only problem within Visual Studio Setup
Project editor is, it doesn't check whether or not a String value we
entered starts with a # sign. It will be better to warn us at compile time
with information like "if you want to start your string with the # sign,
the string value entry must be preceded by ## not #.".
One more interesting test: if we create a *string* key in the editor, with
its value #123, after we installed the MSI, we'll find the value type is
DWORD instead of string!
If you're interested in the details of the prefix rules, this is the
document for it:
http://msdn.microsoft.com/en-us/library/aa371168.aspx
4) Do I need to keep the same logic when setting the string value
programatically - for example #8:00:00 AM# to be stored in a REG_SZ value -
using the My.Computer.Registry.SetValue function?
No. As we said, this is the MSI rule, which doesn't apply to VB programming.
Hope this answered your questions clearly. But again, if you have more
questions or concerns, don't hesitate to post here.
Regards,
Jie Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.