Chef windows_package resource with multiple options - windows

Based on the documentation and examples provided by the chef documentation https://docs.chef.io/resource_windows_package.html, there is a way to pass options to an MSI. However, it is not clear on how to pass multiple options and public properties.
I have tried the following:
windows_package 'some msi' do
action :install
source "http://some url#{node['some app']['install']['windows']['package']}"
installer_type :msi
options "RESTADDRESS=#{node['some app']['rest']['ipaddress']} RESTPORT=#{node['some app']['rest']['port']} /passive /L*V c:\temp\install.txt"
end
However, upon running it ignores the options and properties and the default dialogue for msi pops up.
All the examples I have found only use one option in the recipe.
Please provide an example where you can pass more that one option and public properties
public properties are available in the msi documentation
http://www.advancedinstaller.com/user-guide/msiexec.html

The Chef source points to MSI installs calling this line for actually performing the installation.
This means the command becomes:
msiexec /qn /i "http://some url#{node['some app']['install']['windows']['package']}" RESTADDRESS=#{node['some app']['rest']['ipaddress']} RESTPORT=#{node['some app']['rest']['port']} /passive /L*V c:\temp\install.txt
This should have the same failure mode that Chef is showing you, and help you get a little further along.
Also, it appears you might need to escape your backslashes in the final c:\temp\install.txt.

Related

Source for package SQLServer2012SP4KB4018073x64ENU.exe does not exist in chef

i am trying to install sql server 2012 using chef to a virtual box.. Below is the code that i use but i am getting source does not exist error. Below is the server.rb code that i have..
package package_name do
source 'C:\Users\user\AppData\Local\Temp\SQLServer2012SP4KB4018073x64ENU.exe'# package_url
checksum package_checksum
timeout node['sql_server']['server']['installer_timeout']
installer_type :custom
options "/q /ConfigurationFile=#{config_file_path} #{passwords_options}"
action :install
notifies :request_reboot, 'reboot[sql server install]'
returns [0, 42, 127, 3010]
Error
* template[C:\Users\vagrant\AppData\Local\Temp\kitchen\cache\ConfigurationFile.ini] action create (up to date)
windows_package[SQLServer2012SP4KB4018073x64ENU.exe] action install
* Source for package SQLServer2012SP4KB4018073x64ENU.exe does not exist
Aside from making the file accessible for windows_package resource, one more change can be made.
The name of windows_package resource should match the application name displayed in Control Panel. As you are using SQLServer2012SP4KB4018073x64ENU.exe as the name, Chef will start installation of the package every time it is run (which is probably not what we want).
For e.g. if I want to install a simple package like WinSCP, which is displayed in Control Panel as WinSCP <version>, then I should name my resource with that.
windows_package 'WinSCP 5.17.7' do
source 'C:\Users\Administrator\Downloads\WinSCP-5.17.7-Setup.exe'
installer_type :custom
options '/silent'
end
Now if Chef runs again, it will make this install idempotent.

How to check or activate SyntaxHighlight_GeSHi?

During Mediawiki installation I checked the option for SyntaxHighlight, and it created a LocalSettings line,
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
so, I am supposed that it was installed... But no examples for <source lang> tag is running. For instance the example of the Guide page, <syntaxhighlight lang="Python" line='line'> def quickSort(arr): ...</syntaxhighlight> and its variations (with <source> tag) are not working.
How to check if its alive?
How to activate or to complete the installation?
When installed on Linux, GeSHi requires the pygmentize binary to be marked executable (in the {wiki_installed_folder}/extensions/SyntaxHightlight_GeSHi folder) - by default that property might not be set.
Run "chmod +x pygmentize" to mark it executable - make sure to set the other read/write flags appropriately - to avoid any security issues.

Specify return codes with chef package?

I'm installing an exe using chef's package resource and the run is failing with a return code of 3010. A return code of 3010 means the install was successful, but a reboot is required.
I can get around this by putting ignore_failure true on the resource, but I think this would let legitimate errors go through.
Chef's resource windows_package has a returns property which allows you to specify an array of possible return values. However, windows_package is deprecated in favor of the more generic package resource, but package does not have a returns property.
Is there some other way that I'm not aware of that would allow me to specify return codes with the generic package resource?
Current code structure:
package 'Install Something' do
source source_location
package_name name_of_package
options argument_list
action :install
provider Chef::Provider::Package::Windows
ignore_failure true
end
It is not deprecated, use windows_package.

Wix-Installer-How can I get setup.exe's current directory?

I'm using setup.exe and setupbld.exe (from %WixProramFolder%\bin)to make a
bootstrapper for my installer. Everything is ok except:
I want to get current directory of setup.exe but:
When I use property "CURRENTDIRECTORY", I will get wrong value if I run
command line in cmd.exe: "C:>"D:\setup.exe"". "CURRENTDIRECTORY" is "C:\"
but "D:\" is true.
When I use property "SOURCEDIR", setup.exe will extract setup.msi to
"%Temp%{ProductID}\setup.msi" and "SOURCEDIR" is "%Temp%{ProductID}\" but
expected is "D:\"
Anybody can help me? It make me headache this time :-(
Sorry about my English.
I had this same issue last week with a DB backup that I needed to restore as part of the install. I didn't want to include in the installer as it is likely that it will be updated and even when compressed is ~168Mb.
In the end I included the file into the installer so that it got installed to the application install directory and set Compressed="no" on the file so it is an external dependency. This is not ideal but the only way I could get it to work.

Need a help on setting Reinstallmode and Reinstall

Im having MSI ,for minor update ,i will be updating only build number with no product code change. i try to paramters to msiexex .
msiexec /i sample.msi Reinstall=ALL ReinstallMode=amus in command prompt.Inspite of setting in command prompt,I tried to update msi property through orca. I added 2 properties to Reinstallmode and reinstall properties to orca.But they are not working.It gives me error message.Product of same version has already installed.
one more question which i had is
I tried to set custom action condition property = "Not Installed" .SO tht during repair mode ,i will not invoke custom action.Only one time invokation.
If i try to run msiexec /i sample.msi Reinstallmode=amus Reinstall="All" will custom action be invoked or it will not invoke.
~Mahender
I suppose the properties you pass are not set because you missed the correct spelling. Both REINSTALL and REINSTALLMODE properties should be all UPPERCASE. Such uppercased properties are called public properties, and only public properties can be passed via command line.
Hope this helps.

Resources