Page 1 of 1

Problem creating package with windows_version()

Published: July 5, 2017 - 12:24 PM
by neckatskin
Good morning,

I'm having trouble with Python when installing proprietary software. It's a specific type of software, with installers of different types (sometimes .exe, sometimes .msi) that also vary depending on the operating system. I want to use the `iswin64()` and `windows_version()` functions to identify which installer to use during deployment. My problem is this: it doesn't seem to identify the specific OS version and always chooses the installer for the Windows 7 x86 version (which is what happens in my "else" statement).
Code.png
Code.png (17.91 KB) Viewed 4467 times
The problem seems to be coming from windows_version(), having already used iswin64() without any problems before.
Could you shed some light on the problem?

Thank you in advance for your answers.

Regards,


NeckAtSkin

Re: Problem creating package with windows_version()

Published: July 5, 2017 - 1:38 PM
by sfonteneau
Your code looks correct.

You can add:

Code: Select all

print windows_version()
to check the version of the device.

In my opinion, the problem comes from the

Code: Select all

==   
Simon

Re: Problem creating package with windows_version()

Published: July 5, 2017 - 2:42 PM
by neckatskin
Thank you, the "print" command did indeed point me in the right direction: I was able to see that my Windows 10 version was actually exactly 10.0.14393.
As you said, the "==" was therefore irrelevant. So I modified the first part, using ">=" for 10.0 for Win 10 and ">=" for Win7 x64 for ".

It works perfectly, thanks again for the help, problem solved ;)

Re: Problem creating package with windows_version()

Published: July 5, 2017 - 4:51 PM
by sfonteneau
To complete the process,

you need to add the program's uninstall key to the `key` argument of `install_exe_if_needed`. It's currently empty :shock: !

To retrieve the key:

https://www.wapt.fr/fr/doc/CreationPaqu ... stallation

Then add it as an argument to the `install_exe_if_needed` function

: https://www.wapt.fr/fr/doc/CreationPaqu ... -if-needed