Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking advice on how to handle installers that do not set DisplayVersion in the registry #335

Closed
travispaul opened this issue Mar 10, 2016 · 3 comments

Comments

@travispaul
Copy link

I have an sls that installs CouchDB:

couchdb:
  '1.6.1':
    full_name: 'Apache CouchDB 1.6.1'
    installer: 'https://dl.bintray.com/apache/couchdb/win/1.6.1/setup-couchdb-1.6.1_R16B02.exe'
    install_flags: '/VERYSILENT /DIR={{ grains['program_files'] }}\\CouchDB'
    msiexec: False
    reboot: False

but after installing, salt is unaware which version was installed:

----------
          ID: couchdb
    Function: pkg.installed
      Result: False
     Comment: The following packages failed to install/update: couchdb=1.6.1
     Started: 17:03:55.342000
    Duration: 82181.0 ms
     Changes:   
              ----------
              couchdb:
                  ----------
                  new:
                      Not Found
                  old:

I finally tracked down the issue and it is because the CouchDB installer doesn't set the DisplayVersion registry entry needed by salt. I have worked around this issue by using the windows registry state:

{% set COUCHDB_VERSION = '1.6.1' %}
couchdb:
  pkg:
    - version: {{ COUCHDB_VERSION }}
    - installed

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ApacheCouchDB_is1:
  reg.present:
    - vname: DisplayVersion
    - vdata: {{ COUCHDB_VERSION }}
    - vtype: REG_SZ

But using this workaround, a highstate always reports a failure the first time it is executed (then success every time afterwards). I attempted to set the registry entry before running the installer, but the installer overwrites the key during the installation process.

Looking for advice on on any better way to solve this issue.

@twangboy
Copy link
Collaborator

I believe this has been addressed with saltstack/salt#31420. Expect to see it in the next 2015.8 release which I believe is 2015.8.8. Basically, if it doesn't find a version number in the registry, it will try to find it in the software definition matching off the full name.

@twangboy
Copy link
Collaborator

@travispaul ^^

@travispaul
Copy link
Author

@twangboy Thanks! I'll give that a try when its released and re-open if I still have issues.

TheBigBear added a commit that referenced this issue May 21, 2016
Merge pull request #460 from TheBigBear/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants