PC Review


Reply
Thread Tools Rate Thread

how do I get localized string in immediate Custom Action?

 
 
Bob K
Guest
Posts: n/a
 
      13th Feb 2006
I find that I sometimes need to get a localized string during the UI phase
of setup, in a Custom Action. For instance, if I need to fill a combo box
with some static text entries. There doesn't seem to be any easy way to
access the string table.

My solution is to write a routine that does the following:

1. Get the current language (MsiGetLanguage)
2. Open Database (MsiGetActiveDatabase)
3. Open a view and select the record (MsiDatabaseOpenView)
4. Execute the query (MsiViewExecute)
5. Get the record (MsiViewFetch)

Seems pretty straightforward, except I can't get past step 3. I am creating
a query that looks like this:

SELECT * FROM ISString WHERE (ISString.ISString='ID_STRING1') AND
(ISString.ISLanguage_='1033')

MsiDatabaseOpenView returns ERROR_BAD_QUERY_SYNTAX.

The string table is defined as:

<table name="ISString">
<col key="yes" def="s255">ISString</col>
<col key="yes" def="s50">ISLanguage_</col>
<col def="S0">Value</col>
<col def="I2">Encoded</col>
<col def="S0">Comment</col>
<col def="I4">TimeStamp</col>

Thanks for any ideas,

Bob



 
Reply With Quote
 
 
 
 
Stefan Krueger [MVP]
Guest
Posts: n/a
 
      13th Feb 2006
Why don't you use a localizavble property (in Property Manager)?
Did you check your .msi file to see if the ISString table is in it? I don't
think it will be.

--
Stefan Krueger
Microsoft Windows Installer MVP

Please post your questions in the newsgroup or vist one of these web sites:

Windows Installer FAQ
http://www.msifaq.com - http://www.msifaq.de

InstallSite - Resources for Setup Developers
http://www.installsite.org
http://www.installsite.de (GERMAN)

"Bob K" <(E-Mail Removed)> schrieb im Newsbeitrag
news:%(E-Mail Removed)...
>I find that I sometimes need to get a localized string during the UI phase
> of setup, in a Custom Action. For instance, if I need to fill a combo box
> with some static text entries. There doesn't seem to be any easy way to
> access the string table.
>
> My solution is to write a routine that does the following:
>
> 1. Get the current language (MsiGetLanguage)
> 2. Open Database (MsiGetActiveDatabase)
> 3. Open a view and select the record (MsiDatabaseOpenView)
> 4. Execute the query (MsiViewExecute)
> 5. Get the record (MsiViewFetch)
>
> Seems pretty straightforward, except I can't get past step 3. I am
> creating
> a query that looks like this:
>
> SELECT * FROM ISString WHERE (ISString.ISString='ID_STRING1') AND
> (ISString.ISLanguage_='1033')
>
> MsiDatabaseOpenView returns ERROR_BAD_QUERY_SYNTAX.
>
> The string table is defined as:
>
> <table name="ISString">
> <col key="yes" def="s255">ISString</col>
> <col key="yes" def="s50">ISLanguage_</col>
> <col def="S0">Value</col>
> <col def="I2">Encoded</col>
> <col def="S0">Comment</col>
> <col def="I4">TimeStamp</col>
>
> Thanks for any ideas,
>
> Bob
>
>
>



 
Reply With Quote
 
Bob K
Guest
Posts: n/a
 
      13th Feb 2006
You know, I KNEW there was a simple way to do this. A localizable property
is exactly what I need.

Thanks,
Bob


"Stefan Krueger [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Why don't you use a localizavble property (in Property Manager)?
> Did you check your .msi file to see if the ISString table is in it? I
> don't think it will be.
>
> --
> Stefan Krueger
> Microsoft Windows Installer MVP
>
> Please post your questions in the newsgroup or vist one of these web
> sites:
>
> Windows Installer FAQ
> http://www.msifaq.com - http://www.msifaq.de
>
> InstallSite - Resources for Setup Developers
> http://www.installsite.org
> http://www.installsite.de (GERMAN)
>
> "Bob K" <(E-Mail Removed)> schrieb im Newsbeitrag
> news:%(E-Mail Removed)...
>>I find that I sometimes need to get a localized string during the UI phase
>> of setup, in a Custom Action. For instance, if I need to fill a combo box
>> with some static text entries. There doesn't seem to be any easy way to
>> access the string table.
>>
>> My solution is to write a routine that does the following:
>>
>> 1. Get the current language (MsiGetLanguage)
>> 2. Open Database (MsiGetActiveDatabase)
>> 3. Open a view and select the record (MsiDatabaseOpenView)
>> 4. Execute the query (MsiViewExecute)
>> 5. Get the record (MsiViewFetch)
>>
>> Seems pretty straightforward, except I can't get past step 3. I am
>> creating
>> a query that looks like this:
>>
>> SELECT * FROM ISString WHERE (ISString.ISString='ID_STRING1') AND
>> (ISString.ISLanguage_='1033')
>>
>> MsiDatabaseOpenView returns ERROR_BAD_QUERY_SYNTAX.
>>
>> The string table is defined as:
>>
>> <table name="ISString">
>> <col key="yes" def="s255">ISString</col>
>> <col key="yes" def="s50">ISLanguage_</col>
>> <col def="S0">Value</col>
>> <col def="I2">Encoded</col>
>> <col def="S0">Comment</col>
>> <col def="I4">TimeStamp</col>
>>
>> Thanks for any ideas,
>>
>> Bob
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fail(string, string) not called on custom trace listener Fabian Microsoft Dot NET Framework 0 7th Jan 2008 03:32 PM
Error 2717.Bad action condition or error calling custom action =?Utf-8?B?U3RldmUgSw==?= Microsoft Windows 2000 MSI 1 23rd Sep 2007 02:40 AM
Localized sitemap for custom provider Soren S. Jorgensen Microsoft ASP .NET 0 28th Apr 2006 12:20 PM
Get localized string from System.Windows.Forms.Shortcut =?Utf-8?B?R3VpZG8gS3JhdXM=?= Microsoft Dot NET Framework Forms 7 22nd Feb 2005 11:17 AM
How to add localized resouce string manually George Yuen Microsoft Dot NET Framework 1 23rd Jul 2003 12:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:22 PM.