When a VB Script is added as a custom action, it will only be executed if the script file is encoded in ASCII or UTF-8. If the script file is encoded in UTF-16 (MBCS) it does not get executed. Is this a limitation of AI ? I'm able to run a script encoded as UTF-16 from a command prompt successfully.
I didn't found any specific docs on this subject from Microsoft, so I am not 100% sure, but here is what I think that happens. If you have the VBScript custom action added as "New attached custom action" then
the script file will be stored in the "Binary" table from the MSI. This table stores its content in ANSI, you can see this by exporting the content of a row.
You can try to add the custom action as a "New installed custom action", this will require to add the file in the Files and Folders page, along with your application's files. This file should
have the encoding UTF-16, the one you said it works only from a command prompt.
Also, do you have any specific reasons to why you want to use this specific encoding?
Bogdan wrote:...Also, do you have any specific reasons to why you want to use this specific encoding?
Thanks for the reply. I too researched the issue thoroughly and concluded it must be an AI limitation. It would be nice if AI supported this encoding.
The reason for needing UTF-16 support is I'm setting the value of a custom session property as a literal string based on an OS setting. This session property is then stored and later displayed in a UI, so it needs to be fully Unicode compliant for foreign language support.
I shall investigate further more on this subject, as I said until now I could not find any specific documentation.
Until then another solution for you would be to use a Win32 DLL, created after the following example. Also, the MSI should be to support Unicode characters, from Media page, MSI tab.
FOLLOW US
Get the latest news in Application Packaging