windows_package for Notepad++ not updating


#1

I have a resource defined to install Notepad++ as follows:

windows_package “Notepad++” do
source 'http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
action :install
end

When I first deployed this, the NPP version was 6.6.6. After updating the source to 6.6.7 I noticed that it deployed 6.6.7 correctly to new nodes but did not update the nodes to which it had deployed 6.6.6. I believe the registry key used by NPP being simply “Notepad++” without the version number is the reason for the failure to update. Am I correct? Is there a solution for getting the update performed?

Thanks.

……………………………………………………………………………………………………………………………………………………………………
Arthur Penn
Samtec New Albany
Office: 812-981-8351 | Fax: 812-981-4359 | +1-800-726-8329
www.samtec.com


#2

On Mon, Aug 4, 2014 at 5:04 AM, Arthur Penn Arthur.Penn@samtec.com wrote:

I have a resource defined to install Notepad++ as follows:

windows_package “Notepad++” do
source
http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
action :install
end

When I first deployed this, the NPP version was 6.6.6. After updating the
source to 6.6.7 I noticed that it deployed 6.6.7 correctly to new nodes but
did not update the nodes to which it had deployed 6.6.6. I believe the
registry key used by NPP being simply “Notepad++” without the version number
is the reason for the failure to update. Am I correct? Is there a solution
for getting the update performed?

This is where Windows’ not having a real native package manager really
stinks. There’s no uniform way to to do it.

I imagine you could inspect the registry to see what version of
Notepad++ was installed, if the registry stores that information, and
attempt to do something based on that.

  • Julian


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#3

Thanks, Julian. There must be some way to do it, because I’m pretty sure Puppet handles this (they demoed installing and then updating Notepad++ for us anyway). Here is its uninstall key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++]
“DisplayName”=“Notepad++”
“Publisher”=“Notepad++ Team”
“VersionMajor”="6"
“VersionMinor”="66"
“MajorVersion”="6"
“MinorVersion”="66"
“UninstallString”=“C:\Program Files (x86)\Notepad++\uninstall.exe”
“DisplayIcon”=“C:\Program Files (x86)\Notepad++\notepad++.exe”
“DisplayVersion”="6.6.6"
“URLInfoAbout”=“http://notepad-plus-plus.org/

So DisplayVersion and several other version keys could be used rather than the DisplayName. DisplayVersion seems to be relatively consistent across installations I’ve made.

Thinking about how to handle this… do I check for the existence of the Notepad++ key, and if it exists and matches the old version, change the display name? That might trick Chef into seeing the version’s different and installing it.

Arthur Penn,
Samtec New Albany
www.samtec.com
Tel: 812-981-8351
Fax: 812-981-4359

-----Original Message-----
From: Julian C. Dunn [mailto:jdunn@aquezada.com]
Sent: Tuesday, August 5, 2014 11:59 PM
To: chef@lists.opscode.com
Subject: [chef] Re: windows_package for Notepad++ not updating

On Mon, Aug 4, 2014 at 5:04 AM, Arthur Penn Arthur.Penn@samtec.com wrote:

I have a resource defined to install Notepad++ as follows:

windows_package “Notepad++” do
source
http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
action :install
end

When I first deployed this, the NPP version was 6.6.6. After updating
the source to 6.6.7 I noticed that it deployed 6.6.7 correctly to new
nodes but did not update the nodes to which it had deployed 6.6.6. I
believe the registry key used by NPP being simply “Notepad++” without
the version number is the reason for the failure to update. Am I
correct? Is there a solution for getting the update performed?

This is where Windows’ not having a real native package manager really stinks. There’s no uniform way to to do it.

I imagine you could inspect the registry to see what version of
Notepad++ was installed, if the registry stores that information, and
attempt to do something based on that.

  • Julian


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#4

For notepad++, you can use “/S”, and it’ll auto-update the software for you.
Specify something other than msi, installshield, nsis or inno as
installer_type in your recipe.
(I usually use ‘custom’ for non-msi ones)

Example:
windows_package “Notepad++” do
source '
http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
installer_type :custom
options "/S"
action :install
end
https://github.com/opscode-cookbooks/windows/blob/9b63ff5d70b97a7b2c96b30dbabc224d56fa8376/providers/package.rb

A bit of detail on what’s happening inside Windows:
When you start an installer executable, Windows Installer (a component
inside Windows) scans the registry and looks for two attributes provided in
the installer executables: UpgradeCode and ProductCode.
It’s quite counter-intuitive, but Windows uses UpgradeCode to identify one
package is the same product (upgrade path exists) as another.
ProductCode is guaranteed to be unique (with an exception with different
language set up) within the machine,
but it’s perfectly valid (and happens all the time) for one software to
have different ProductCode with the same UpgradeCode. (hence upgradable)
However, the GUID you see in HKEY_LOCAL_MACHINE\SOFTWARE
Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ are ProductCodes.

If you’re really interested the detail,
refer to http://msdn.microsoft.com/en-us/library/aa372399(v=vs.85).aspx.

Cheers,
-tak

On Tue, Aug 19, 2014 at 4:50 AM, Arthur Penn Arthur.Penn@samtec.com wrote:

Thanks, Julian. There must be some way to do it, because I’m pretty sure
Puppet handles this (they demoed installing and then updating Notepad++ for
us anyway). Here is its uninstall key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++]
“DisplayName”=“Notepad++”
“Publisher”=“Notepad++ Team”
“VersionMajor”="6"
“VersionMinor”="66"
“MajorVersion”="6"
“MinorVersion”="66"
“UninstallString”=“C:\Program Files (x86)\Notepad++\uninstall.exe”
“DisplayIcon”=“C:\Program Files (x86)\Notepad++\notepad++.exe”
“DisplayVersion”="6.6.6"
“URLInfoAbout”=“http://notepad-plus-plus.org/

So DisplayVersion and several other version keys could be used rather than
the DisplayName. DisplayVersion seems to be relatively consistent across
installations I’ve made.

Thinking about how to handle this… do I check for the existence of the
Notepad++ key, and if it exists and matches the old version, change the
display name? That might trick Chef into seeing the version’s different and
installing it.

Arthur Penn,
Samtec New Albany
www.samtec.com
Tel: 812-981-8351
Fax: 812-981-4359

-----Original Message-----
From: Julian C. Dunn [mailto:jdunn@aquezada.com]
Sent: Tuesday, August 5, 2014 11:59 PM
To: chef@lists.opscode.com
Subject: [chef] Re: windows_package for Notepad++ not updating

On Mon, Aug 4, 2014 at 5:04 AM, Arthur Penn Arthur.Penn@samtec.com
wrote:

I have a resource defined to install Notepad++ as follows:

windows_package “Notepad++” do
source
http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe

action :install
end

When I first deployed this, the NPP version was 6.6.6. After updating
the source to 6.6.7 I noticed that it deployed 6.6.7 correctly to new
nodes but did not update the nodes to which it had deployed 6.6.6. I
believe the registry key used by NPP being simply “Notepad++” without
the version number is the reason for the failure to update. Am I
correct? Is there a solution for getting the update performed?

This is where Windows’ not having a real native package manager really
stinks. There’s no uniform way to to do it.

I imagine you could inspect the registry to see what version of
Notepad++ was installed, if the registry stores that information, and
attempt to do something based on that.

  • Julian


[ Julian C. Dunn jdunn@aquezada.com * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#5

Thanks, Takehiro. I did add that ‘/S’ switch as well as the custom installer type, but it still does not seem to be updating existing installations. The windows_package recipe does not detect the changed version of Notepad++. Notepad++ will indeed allow an administrative user to update the app when you run the app, but I was hoping to have Chef keep the version current for me. I think this is going to require either an improvement to the way windows_package works or me doing something to change the registry entries for Notepad++ to trick it into seeing the version is different.

From: Takehiro Takahashi [mailto:takehiro.takahashi@gmail.com]
Sent: Tuesday, August 19, 2014 9:23 PM
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: windows_package for Notepad++ not updating

For notepad++, you can use “/S”, and it’ll auto-update the software for you.
Specify something other than msi, installshield, nsis or inno as installer_type in your recipe.
(I usually use ‘custom’ for non-msi ones)

Example:
windows_package “Notepad++” do
source 'http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
installer_type :custom
options "/S"
action :install
end
https://github.com/opscode-cookbooks/windows/blob/9b63ff5d70b97a7b2c96b30dbabc224d56fa8376/providers/package.rb

A bit of detail on what’s happening inside Windows:
When you start an installer executable, Windows Installer (a component inside Windows) scans the registry and looks for two attributes provided in the installer executables: UpgradeCode and ProductCode.
It’s quite counter-intuitive, but Windows uses UpgradeCode to identify one package is the same product (upgrade path exists) as another.
ProductCode is guaranteed to be unique (with an exception with different language set up) within the machine,
but it’s perfectly valid (and happens all the time) for one software to have different ProductCode with the same UpgradeCode. (hence upgradable)
However, the GUID you see in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ are ProductCodes.

If you’re really interested the detail,
refer to http://msdn.microsoft.com/en-us/library/aa372399(v=vs.85).aspx.

Cheers,
-tak

On Tue, Aug 19, 2014 at 4:50 AM, Arthur Penn <Arthur.Penn@samtec.commailto:Arthur.Penn@samtec.com> wrote:
Thanks, Julian. There must be some way to do it, because I’m pretty sure Puppet handles this (they demoed installing and then updating Notepad++ for us anyway). Here is its uninstall key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++]
“DisplayName”=“Notepad++”
“Publisher”=“Notepad++ Team”
“VersionMajor”="6"
“VersionMinor”="66"
“MajorVersion”="6"
“MinorVersion”="66"
“UninstallString”=“C:\Program Files (x86)\Notepad++\uninstall.exe<file:///\Notepad++\uninstall.exe>”
“DisplayIcon”=“C:\Program Files (x86)\Notepad++\notepad++.exe<file:///\Notepad++\notepad++.exe>”
“DisplayVersion”="6.6.6"
“URLInfoAbout”=“http://notepad-plus-plus.org/

So DisplayVersion and several other version keys could be used rather than the DisplayName. DisplayVersion seems to be relatively consistent across installations I’ve made.

Thinking about how to handle this… do I check for the existence of the Notepad++ key, and if it exists and matches the old version, change the display name? That might trick Chef into seeing the version’s different and installing it.

Arthur Penn,
Samtec New Albany
www.samtec.comhttp://www.samtec.com
Tel: 812-981-8351tel:812-981-8351
Fax: 812-981-4359tel:812-981-4359

……………………………………………………………………………………………………………………………………………………………………
Arthur Penn
Samtec New Albany
Office: 812-981-8351 | Fax: 812-981-4359 | +1-800-726-8329
www.samtec.com

-----Original Message-----
From: Julian C. Dunn [mailto:jdunn@aquezada.commailto:jdunn@aquezada.com]
Sent: Tuesday, August 5, 2014 11:59 PM
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: windows_package for Notepad++ not updating

On Mon, Aug 4, 2014 at 5:04 AM, Arthur Penn <Arthur.Penn@samtec.commailto:Arthur.Penn@samtec.com> wrote:

I have a resource defined to install Notepad++ as follows:

windows_package “Notepad++” do
source
http://download.tuxfamily.org/notepadplus/6.6.7/npp.6.6.7.Installer.exe
action :install
end

When I first deployed this, the NPP version was 6.6.6. After updating
the source to 6.6.7 I noticed that it deployed 6.6.7 correctly to new
nodes but did not update the nodes to which it had deployed 6.6.6. I
believe the registry key used by NPP being simply “Notepad++” without
the version number is the reason for the failure to update. Am I
correct? Is there a solution for getting the update performed?

This is where Windows’ not having a real native package manager really stinks. There’s no uniform way to to do it.

I imagine you could inspect the registry to see what version of
Notepad++ was installed, if the registry stores that information, and
attempt to do something based on that.

  • Julian


[ Julian C. Dunn <jdunn@aquezada.commailto:jdunn@aquezada.com> * Sorry, I’m ]
[ WWW: http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://sdf.org/1/users/keymaker/http://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]


#6

You can specify the version in attributes/default.rb :

default[‘notepadplusplus’][‘url’] = "https://notepad-plus-plus.org/repository/6.x/6.9/npp.6.9.Installer.exe"
default[‘notepadplusplus’][‘package_name’] = "Notepad++"
default[‘notepadplusplus’][‘package_version’] = “6.9”

And after that, in recipes/default.rb specify the version before action install :

windows_package node[‘notepadplusplus’][‘package_name’] do
installer_type :custom
version node[“notepadplusplus”][“package_version”]
source node[‘notepadplusplus’][‘url’]
action :install
end

Worked for me, updated NPP from 6.8.8 to 6.9