Comments (5)
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.
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.
from ansible.windows.
From @Yvan-Masson on Jun 27, 2018 08:05
This looks great, thanks!
Yvan
from ansible.windows.
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.
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)
- win_get_url does not respect content-disposition HOT 1
- win_update failed since ansible 7.7.0 HOT 3
- win_update show different trigger in Event Viewer HOT 1
- ansible.windows.win_powershell misinterprets block scalar (string block) HOT 2
- win_package: support checksum verification HOT 2
- intermittent winrm connection failures with large hosts count HOT 8
- intermittent "unable to delete temporary file" errors HOT 9
- Win_updates fail with "Exception from HRESULT: 0x80072EE2" HOT 2
- Windows Update Module not installing any updates HOT 4
- Windows update failes due to update loop HOT 3
- win_environment : Maybe add an option to read variable content ? HOT 5
- Error during machine sid retrieval: An error (1788) occurred while enumerating the group membership. The member's SID could not be resolved. HOT 8
- Access denied after renaming windows host : Server not found in Kerberos database HOT 10
- Failed to create temporary directory when running win_template module against Windows Server 2019 HOT 10
- win_copy doesnt work when folder name has special character HOT 2
- Add account_expires functionality from the Set-LocalUser PowerShell Cmdlet HOT 2
- Using Machine credentials from AAP passed to playbook with ansible.windows.win_copy fails HOT 2
- ERROR DURING WINRM SEND INPUT - attempting to recover: WinRMTransportError Bad HTTP response returned from server. Code 413 HOT 1
- win_copy module not handling an invalid path correctly. HOT 1
- Feature request: A better win_acl module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible.windows.