InstallShield 2009:检测系统CSV分隔符并更新INI值

时间:2021-09-14 05:52:47

OK as you may know the CSV separator in French is not , it's ;. We need to deploy an application to both French and English systems.

好的,因为您可能知道法语中的CSV分隔符不是,它是;。我们需要将应用程序部署到法语和英语系统。

What I would like to do is that InstallShield would detect the system CSV separator and then save this value in an INI installed with the application (I know, INIs are outdated by the registry a long time ago, but it's the design we opted for).

我想要做的是InstallShield将检测系统CSV分隔符,然后将此值保存在随应用程序安装的INI中(我知道,很久以前INI已经过了注册表,但它是我们选择的设计) 。

Is it possible to do that with InstallShield 2009? I can't find anything for this value in the help file for special property values...

是否可以使用InstallShield 2009执行此操作?对于特殊属性值,我在帮助文件中找不到任何有关此值的内容...

EDIT: Since it might be unclear, take in consideration this INI structure:

编辑:由于可能不清楚,请考虑这个INI结构:

[settings]
separator=,

I want the separator value to be dynamically set at the time of installtion by InstallShield himself (based on the system settings). I know some "special values" in InstallShield like [INSTALLDIR] but I'm not sure theres one for the system CSV separator (you know the CSV separator is part of the locale settings in all Windows versions since many years).

我希望InstallShield自己在安装时动态设置分隔符值(基于系统设置)。我知道InstallShield中的一些“特殊值”,如[INSTALLDIR],但我不确定系统CSV分隔符是否有一个(您知道CSV分隔符是所有Windows版本中多年以来语言环境设置的一部分)。

2 个解决方案

#1


0  

I'm not aware of the , or the ; as being part of the INI spec. My understanding is it's:

我不知道,或者;作为INI规范的一部分。我的理解是:

[Section]

[部分]

Key=Value

键=值

Any delimiting inside of value really doesn't have anything to do with INI's per say.

内在价值的任何划分实际上与INI的说法没有任何关系。

It's not clear from your question if you are using an InstallScript project or a Basic MSI project so it's hard to say how to do what you want to do. In general though you should be able to find a way to do it regardless.

从您的问题中不清楚您是使用InstallScript项目还是基本MSI项目,因此很难说如何做您想做的事情。一般来说,你应该能够找到一种方法来做到这一点。

Edit: According to http://en.wikipedia.org/wiki/INI_file the ; is actually reserved to indicate comments so I would make sure that if you wrote an INI like

编辑:根据http://en.wikipedia.org/wiki/INI_file;实际上是保留用于表示注释,所以如果你写了一个INI,我会确保

[Section]

[部分]

Key=Value;MoreValue

键=值; MoreValue

That an INI call to read Section/Key actually returns what you expect it to return. InstallShield may be able to write it might you might not be able to read it. Hard to say without giving it a try.

INI调用读取Section / Key实际上返回了您期望它返回的内容。 InstallShield可能能够写入它可能无法读取它。很难说没试一试。

#2


0  

I ended up reading the registry key

我最后读了注册表项

HKEY_CURRENT_USER\Control Panel\International\sList

HKEY_CURRENT_USER \ Control Panel \ International \ sList

and saving that value to my INI file.

并将该值保存到我的INI文件中。

#1


0  

I'm not aware of the , or the ; as being part of the INI spec. My understanding is it's:

我不知道,或者;作为INI规范的一部分。我的理解是:

[Section]

[部分]

Key=Value

键=值

Any delimiting inside of value really doesn't have anything to do with INI's per say.

内在价值的任何划分实际上与INI的说法没有任何关系。

It's not clear from your question if you are using an InstallScript project or a Basic MSI project so it's hard to say how to do what you want to do. In general though you should be able to find a way to do it regardless.

从您的问题中不清楚您是使用InstallScript项目还是基本MSI项目,因此很难说如何做您想做的事情。一般来说,你应该能够找到一种方法来做到这一点。

Edit: According to http://en.wikipedia.org/wiki/INI_file the ; is actually reserved to indicate comments so I would make sure that if you wrote an INI like

编辑:根据http://en.wikipedia.org/wiki/INI_file;实际上是保留用于表示注释,所以如果你写了一个INI,我会确保

[Section]

[部分]

Key=Value;MoreValue

键=值; MoreValue

That an INI call to read Section/Key actually returns what you expect it to return. InstallShield may be able to write it might you might not be able to read it. Hard to say without giving it a try.

INI调用读取Section / Key实际上返回了您期望它返回的内容。 InstallShield可能能够写入它可能无法读取它。很难说没试一试。

#2


0  

I ended up reading the registry key

我最后读了注册表项

HKEY_CURRENT_USER\Control Panel\International\sList

HKEY_CURRENT_USER \ Control Panel \ International \ sList

and saving that value to my INI file.

并将该值保存到我的INI文件中。