Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 124445
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: RSCHUPP [...] cpan.org
Requestors: adr-perlcpan [...] linuxtech.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Par-Packer 'falsifies' PerlTk server() and Win32 GetOSName() and GetOSVersion() output on Windows 10
Date: Fri, 16 Feb 2018 12:25:33 +0000 (GMT)
To: bug-PAR-Packer [...] rt.cpan.org
From: Arne <adr-perlcpan [...] linuxtech.net>
Download (untitled) / with headers
text/plain 883b
When calling the Perl-Tk '$mw->server()' function or the Win32 'GetOSName()' and 'GetOSVersion()' funnctions on Windows 10 in a Perl script the output is correct as expected: $mw->server() returns 'Windows 10.0 10586 Win32' Win32::GetOSName() returns 'Win10Business (64-bit)' Win32::GetOSVersion() returns '100105862002561' But when creating an exe with Par::Packer containing the above functions and running it, the output changes to: $mw->server() returns 'Windows 6.2 9200 Win32' Win32::GetOSName() returns 'Win8Professional (64-bit)' Win32::GetOSVersion() returns '6292002002561' Please see the following perlmonks node for examples scripts and for confirmation of the issue by at least one other Perl user: http://www.perlmonks.org/?node_id=1209281 It looks to me like Par-Packer is somehow intercepting and 'falsifying' the return values of these Perl functions.
Download (untitled) / with headers
text/plain 1.5k
On 2018-02-16 07:50:32, adr-perlcpan@linuxtech.net wrote: Show quoted text
> It looks to me like Par-Packer is somehow intercepting and 'falsifying' > the return values of these Perl functions.
Nope, PAR::Packer doesn't intercept and falsify anything. I have a theory what's causing this (see below), but first, for the record: - what version of Module::ScanDeps, PAR and PAR::Packer are you using? - what version of Perl and what distro (Strawberry, ActiveState etc)? - and most important: did you build PAR::Packer yourself or got it from somwhere? Now for the theory: the bug report https://rt.cpan.org/Public/Bug/Display.html?id=90807 has some links to Microsoft docs which further link to https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241(v=vs.85).aspx The key why this may be relevant is that an executable packed by PAR::Packer contains a custom version of the Perl interpreter, i.e. not the original perl.exe. It's this interpreter that runs your script and all the packed modules. According to the above docs, unless an executable was build with a special entry in its manifest file, the function GetVersionExA (which is used by the Perl module Win32) will always report that you're running Windows 8 while in fact you may be running a higher version of Windows. I checked that perl/bin/perl.exe from strawberry-perl-5.26.1.1-64bit has indeed been built with this magic incantation in its manifest, but the custom Perl interpreter build by PAR::Packer is missing it. It will take me a few days to procure a Windows 10 machine, would you be willing to build PAR::Packer yourself with a tentative fix? Cheers, Roderich
Subject: Re: [rt.cpan.org #124445] Par-Packer 'falsifies' PerlTk server() and Win32 GetOSName() and GetOSVersion() output on Windows 10
Date: Sun, 18 Feb 2018 13:27:15 +0000 (GMT)
To: Roderich Schupp via RT <bug-PAR-Packer [...] rt.cpan.org>
From: adr-perlcpan [...] linuxtech.net
Download (untitled) / with headers
text/plain 1.3k
Hi, thanks for looking into this. Show quoted text
> - what version of Module::ScanDeps, PAR and PAR::Packer are you using?
Module::ScanDeps 1.24 PAR 1.014 PAR::Packer 1.041 Show quoted text
> - what version of Perl and what distro (Strawberry, ActiveState etc)?
Strawberry 5.24.1.1 Show quoted text
> - and most important: did you build PAR::Packer yourself or got it > from somwhere?
installed it with cpan Show quoted text
> I checked that perl/bin/perl.exe from strawberry-perl-5.26.1.1-64bit > has indeed been built with this magic incantation in its manifest, but > the custom Perl interpreter build by PAR::Packer is missing it.
I think you are right, I came to a similar conclusion and therefore tried adding the <compatibility> section of the manifest file from MSDN to the myldr/winres/pp.manifest file in the PAR-Packer-1.041 source, and then rebuilt and reinstalled PAR-Packer from the modified source. With this change, PAR-Packer displays the Windows version info correctly (tested on Win 10 and 8.1). Please also see the following node on perlmonks where I quoted exactly what I added: http://www.perlmonks.org/?node_id=1209323 Show quoted text
> It will take me a few days to procure a Windows 10 machine, would you be willing to > build PAR::Packer yourself with a tentative fix?
No problem, in case your fix differs from what I already tried (as described above) I can certainly try it.
Download (untitled) / with headers
text/plain 600b
On 2018-02-18 08:27:37, adr-perlcpan@linuxtech.net wrote: Show quoted text
> I think you are right, I came to a similar conclusion and therefore > tried adding the <compatibility> section of the manifest file from > MSDN > to the myldr/winres/pp.manifest file in the PAR-Packer-1.041 source, > and > then rebuilt and reinstalled PAR-Packer from the modified source. > > With this change, PAR-Packer displays the Windows version info > correctly > (tested on Win 10 and 8.1).
That coincides with my solution. This fix will be in the next release of PAR::Packer. Thanks for testing and confirmation! Cheers, Roderich


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.