GithubHelp home page GithubHelp logo

Comments (5)

jborean93 avatar jborean93 commented on July 17, 2024

From @jborean93 on Jun 22, 2018 05:52

Technically we are getting the FileVersion, unfortunately it's not the file version that is displayed in explorer. After reading through https://blogs.technet.microsoft.com/askpfeplat/2014/12/07/how-to-correctly-check-file-versions-with-powershell/ it turns out it uses the FilePrivatePart in conjunction with FileVersion to display that value. You can also use FileVersionRaw that contains the full version string as shown by

PS C:\Users\vagrant-domain> [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path2) | Select-Object *


FileVersionRaw     : 60.0.2.6730
ProductVersionRaw  : 60.0.2.0
Comments           :
CompanyName        : Mozilla Corporation
FileBuildPart      : 2
FileDescription    : Firefox
FileMajorPart      : 60
FileMinorPart      : 0
FileName           : C:\Program Files\Mozilla Firefox\firefox.exe
FilePrivatePart    : 6730
FileVersion        : 60.0.2
InternalName       : Firefox
IsDebug            : False
IsPatched          : False
IsPrivateBuild     : False
IsPreRelease       : False
IsSpecialBuild     : False
Language           : Language Neutral
LegalCopyright     : ©Firefox and Mozilla Developers; available under the MPL 2 license.
LegalTrademarks    : Firefox is a Trademark of The Mozilla Foundation.
OriginalFilename   : firefox.exe
PrivateBuild       :
ProductBuildPart   : 2
ProductMajorPart   : 60
ProductMinorPart   : 0
ProductName        : Firefox
ProductPrivatePart : 0
ProductVersion     : 60.0.2
SpecialBuild       :

How we go about fixing/changing this behaviour will be hard as this is a core module and an outright change would break the interface we have in place. I've added it to the agenda for the next Windows Working group meeting to discuss further.

from ansible.windows.

jborean93 avatar jborean93 commented on July 17, 2024

From @jborean93 on Jun 26, 2018 22:28

It was decided in the latest WWG to add a new module option that specifies what version string to use when comparing creates_version. This has the flexibility of not breaking existing playbooks but allowing people to specify whatever version property they want to compare it to.

In this case it would be something like version_format: FileVersionRaw but the specifics still need to be ironed out.

https://meetbot.fedoraproject.org/ansible-windows/2018-06-26/ansible_windows_working_group.2018-06-26-20.00.log.html

from ansible.windows.

jborean93 avatar jborean93 commented on July 17, 2024

From @Yvan-Masson on Jun 27, 2018 08:05

This looks great, thanks!
Yvan

from ansible.windows.

 avatar commented on July 17, 2024

how it works now. Im playing with task for git install:

- name: "Git | Install Git"
  win_package:
    path: 'c:\ansible\downloads\Git-2.26.2-64-bit.exe'
    creates_path: 'C:\Program Files\Git\bin\git.exe'
    creates_version: "2.26.2.1"
    arguments: '/SP- /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /FORCECLOSEAPPLICATIONS /LOADINF="c:\ansible\downloads\git_unattended.inf" /LOG="c:\ansible\logs\git_install.log"'
    state: present

and it start install process every run

FileVersionRaw     : 2.26.2.1
ProductVersionRaw  : 2.26.2.1
Comments           :
CompanyName        :
FileBuildPart      : 2
FileDescription    :
FileMajorPart      : 2
FileMinorPart      : 26
FileName           : C:\Program Files\Git\bin\git.exe
FilePrivatePart    : 1
FileVersion        :
InternalName       :
IsDebug            : False
IsPatched          : False
IsPrivateBuild     : False
IsPreRelease       : False
IsSpecialBuild     : False
Language           : English (United States)
LegalCopyright     :
LegalTrademarks    :
OriginalFilename   :
PrivateBuild       :
ProductBuildPart   : 2
ProductMajorPart   : 2
ProductMinorPart   : 26
ProductName        :
ProductPrivatePart : 1
ProductVersion     :
SpecialBuild       :

i'm tryied it with creates_version: "2.26.2" with same result

from ansible.windows.

jborean93 avatar jborean93 commented on July 17, 2024

Closing as the current logic is most likely relied upon with existing users of the module. If someone wishes to implement such a feature mentioned in #17 (comment) they are more than welcome to add a PR with things like tests but it's not something we are interested in doing ourselves.

from ansible.windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.