Discussion:
[wpkg-users] [Bug 291] New: wpkg.js won't run on non-uncode is set to c04
b***@bugzilla.wpkg.org
2016-10-18 01:54:44 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

Bug ID: 291
Summary: wpkg.js won't run on non-uncode is set to c04
Product: WPKG
Version: other
Hardware: PC
OS: other
Status: NEW
Severity: minor
Priority: P2
Component: wpkg.js
Assignee: ***@wpkg.org
Reporter: ***@kly.com.hk
QA Contact: wpkg-***@lists.wpkg.org

Hi,

I have an issue that wpkg will not run properly in Windows Vista,
the script will fail with error 800a0005 if the windows non-unicode setting to
Chinese (Hong Kong SAR)

The script will run well when non-unicode is set to English (US).

I also attached the debug log file for your references.

Thanks
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-18 17:10:57 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

Rainer Meier <***@wpkg.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@wpkg.org

--- Comment #1 from Rainer Meier <***@wpkg.org> ---
I am currently unable to reproduce the issue. So I need more information:

- What do you mean by "non-unicode setting"?
- Could you attach the log file you refer to?

If there is a log written that means cscript/WSH likely works; perhaps it's
some Active-X object failing but without more information I can't reproduce the
issue. Also I don't have any Windows Vista left any more. Can you reproduce
this issue also on Windows 7 or any more modern Windows version?
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-18 21:13:28 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

--- Comment #2 from Rainer Meier <***@wpkg.org> ---
OK, I have set up Windows Vista Business x64 and I was able to reproduce the
issue. Somehow the OS detection fails when the langugage for
unicode-incompatible applications is set to "Chinese (traditional, Honkgong
SAR)".

I don't know yet why the WMI query fails as it does not seem to fail for many
other languages.

However I can implement a workaround detecting "unknown" host OS. As a result
WPKG on such machines would not be able to use filters based on OS string but
everything else should work as expected.

I will spend some more time to investigate whether host OS could be detected by
slightly modifying the queries perhaps.

Meanwhile a small code change in function "getHostOS()" would help:

Change
function getHostOS() {
if (hostOs == null) {
var strComputer = ".";
var strQuery = "Select * from Win32_OperatingSystem";
try {

to

function getHostOS() {
if (hostOs == null) {
var hostOs = "unknown";
var strComputer = ".";
var strQuery = "Select * from Win32_OperatingSystem";
try {

This makes WPKG fallback to "unknown" host status rather than "null" value when
host OS string detection fails.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-19 01:57:18 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

--- Comment #3 from ***@kly.com.hk ---
Thanks for the update,

May I know will the wpkg.js being updated on actual site?
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-19 02:22:01 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

--- Comment #4 from ***@kly.com.hk ---
Hi,

I did apply the changes into the wpkg.js file, but it report with same error.
Is there anything I need to do other than modifying wpkg.js?

The Vista system I deploying on is a Vista Business 32 Bit (OEM Chi/Eng Build)

I tried to run the query on WMI via PowerShell, here is the result:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\isd> Get-WmiObject Win32_OperatingSystem


SystemDirectory : C:\Windows\system32
Organization :
BuildNumber : 6002
RegisteredUser : Admin
SerialNumber : 89576-OEM-7332141-00143
Version : 6.0.6002



PS C:\Users\isd>

Please let me know if you need to do some more query, Thanks!
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-19 17:49:17 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

--- Comment #5 from Rainer Meier <***@wpkg.org> ---
Yes, of course the update will be available here as soon as it's available. I
still try to find the root cause of this issue.

There is nothing else to do other than this line in wpkg.js. But I am likely
adding some more error handling in final update.
--
You are receiving this mail because:
You are the QA Contact for the bug.
b***@bugzilla.wpkg.org
2016-10-22 21:06:15 UTC
Permalink
http://bugzilla.wpkg.org/show_bug.cgi?id=291

Rainer Meier <***@wpkg.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED

--- Comment #6 from Rainer Meier <***@wpkg.org> ---
Alright, I think I found the root cause of this issue. In some specific
language settings Windows does not write unicode text files by default but is
using local codepages.
In case of Chinese (Hong Kong SAR) setting on Vista this is causing an issue
due to Vista containing the (TM) and (R) symbols which is written to the log
file.

I have solved this by forcing the log files to be written in unicode.

I also fixed an issue reported on the mailing list about WPKG now writing the
running registry key.

Changelog:

Changes 2016-10-22, v1.3.2-RC2 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Forcing OS to write logfile in Unicode to fix exception 800a0005 when
writing unicode characters to the log on OS with non-unicode application
settings set to languages like "Chinese (Hong Kong SAR)".
Fixes bug 291. Thanks to "isd".
FIX: Setting running state in registry (HKLM\Software\WPKG\running)) on WPKG
startup.
Thanks to Niels Thiele for reporting this on the mailing list.



WPKG 1.3.2-RC2 has not been released yet. Though you can get the latest wpkg.js
from Sourceforge:

<https://sourceforge.net/p/wpkg/code/HEAD/tree/wpkg/stable/src/main/resources/wpkg/wpkg.js>
(Download it using the "Download this file" link on top of the page.

As always it's safe to just drop-replace your wpkg.js with the SVN version.

Please report if this fixes your problem.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...