wixgem 0.25.0 → 0.26.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e607976dfdb2697e92af5ceb541d10f1f9b065b
4
- data.tar.gz: 99854d223a5b65c2b21ead529d3b67a094cd6336
3
+ metadata.gz: e6213215965dd51d55d60f45edfe01f68508c189
4
+ data.tar.gz: dbb87b119d337ff8e771aa253cdf3f44fe66ac70
5
5
  SHA512:
6
- metadata.gz: 76a190b4c25440043dce9ef932b9be7c9c8953eda2279409c6b794f41f0af2e7b8e9e26f2059aa77b5dd9ff566432d57c4d79fe19e0c2c330aef59c41bbcb5a7
7
- data.tar.gz: c62af691b0c5db4cf329795daa77091f28bba4e5919a9c7b83c4cfa9606ccbc62f6c60fe5288c12436378da91673d94580f51f9f5589a05a67efc27a6e142df1
6
+ metadata.gz: 1414da1543689ca0af807997460592600ac662d2e6f090dfe36eb331b95213187f169848ba199c5bbd33f7ecb3a3e59cb7fc42ec4caf22f313b1cff96a25288b
7
+ data.tar.gz: 4faab46486457fc3064d6154c1879e2eef74a35a9a6aa5785ef188358859f8cab3138c527dc646f4e1f1bc179c5783f308b182dccb6db24eddbb9bd9bf97f8f6
data/README.md CHANGED
@@ -3,8 +3,7 @@ Ruby gem to facilitate automate constructing Windows installation files
3
3
  with the Wix Toolset.
4
4
 
5
5
  ## Installation
6
- Wixgem can be installed by the single command
7
- gem install wixgem
6
+ Wixgem can be installed by the single command: *gem install wixgem*
8
7
 
9
8
  ## Example Usage
10
9
  #### Dependencies
@@ -31,8 +30,8 @@ require 'wixgem'
31
30
 
32
31
  WIX_TOOLSET_ROOT='path to root of Wix toolset'
33
32
  Wix.make_mergemodule('Product.msi', ['rakefile.rb']])
34
- ```
35
33
 
34
+ ```
36
35
  An example rakefile.rb is included in the example directory of the gem.
37
36
 
38
37
  ## Documenation
@@ -49,8 +48,7 @@ small set of optional arguments allowing the developer to customize the generate
49
48
  properly address the upgrade code before shipping the first version of a product.
50
49
  * **files**: A string array of file paths to be added to the installation.
51
50
  * **modify_file_paths**: A hash of regex objects to replacement string pairs. The regular expressions are applied to
52
- the file paths having the effect of changing the relative location of the files in the
53
- installation.
51
+ the file paths allowing the developer to modify the relative location of the files in the installation.
54
52
  * **has_vb6_files**: Required if installation contains any ocx's or dll's compiled with Visual Basic 6.
55
53
  * **remove_existing_products**: A boolean value. If the value is true the installation will remove all existing
56
54
  installations of the product before installing the product.
data/spec/execute.rb CHANGED
@@ -1,8 +1,8 @@
1
- require 'dev_tasks'
2
-
3
- def execute(cmd)
4
- command = Command.new(cmd)
5
- command.execute
6
-
7
- raise "Failed: #{cmd} Status: #{command[:exit_code]}\nStdout: #{command[:output]}\nStderr: #{command[:error]}" unless(command[:exit_code] == 0)
8
- end
1
+ require 'dev_tasks'
2
+
3
+ def execute(cmd)
4
+ command = Command.new(cmd)
5
+ command.execute
6
+
7
+ raise "Failed: #{cmd} Status: #{command[:exit_code]}\nStdout: #{command[:output]}\nStderr: #{command[:error]}" unless(command[:exit_code] == 0)
8
+ end
@@ -1,71 +1,71 @@
1
- require 'rspec'
2
- require './lib/wixgem.rb'
3
- require './spec/wixpath.rb'
4
- require './admin.rb'
5
- require './spec/test_install.rb'
6
- require './spec/test_files_exist.rb'
7
- require 'json'
8
-
9
- if(admin?)
10
- describe 'Wixgem' do
11
- describe 'Side by side installations' do
12
- product1='wixgem_multiple 1.0'
13
- product2='wixgem_multiple 1.1'
14
- begin
15
- Wix.make_installation("test/wixgem_multiple.1.0.0.msi", {version: '1.0.0.0', product_name: product1, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['Gemfile']})
16
- Wix.make_installation("test/wixgem_multiple.1.1.0.msi", {version: '1.1.0.0', product_name: product2, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['rakefile.rb']})
17
-
18
- it "should install version 1.0.0" do
19
- execute("msiexec.exe /i test\\wixgem_multiple.1.0.0.msi")
20
- expect(WindowsInstaller.installed?(product1)).to be(true)
21
- expect(WindowsInstaller.version?(product1)).to eq('1.0.0.0')
22
- end
23
-
24
- it "should install version 1.1.0" do
25
- execute("msiexec.exe /i test\\wixgem_multiple.1.1.0.msi")
26
- expect(WindowsInstaller.installed?(product2)).to be(true)
27
- expect(WindowsInstaller.version?(product2)).to eq('1.1.0.0')
28
- end
29
-
30
- it "version 1.0.0 should still be installed" do
31
- expect(WindowsInstaller.installed?(product1)).to be(true)
32
- end
33
-
34
- it "product codes for version 1.0.0 and 1.0.0 should be different" do
35
- expect(WindowsInstaller.product_code?(product1)).not_to eq(WindowsInstaller.product_code?(product2))
36
- end
37
- ensure
38
- execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product1)}") while(WindowsInstaller.installed?(product1))
39
- raise "Failed to uninstall product #{product1}" if(WindowsInstaller.installed?(product1))
40
- execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product2)}") while(WindowsInstaller.installed?(product2))
41
- raise "Failed to uninstall product #{product2}" if(WindowsInstaller.installed?(product2))
42
- end
43
- end
44
-
45
- describe 'remove previous version' do
46
- product1='wixgem_install 1.0'
47
- product2='wixgem_install 1.1'
48
- begin
49
- Wix.make_installation("test/wixgem_install.1.0.0.msi", {version: '1.0.0.0', product_name: product1, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['Gemfile']})
50
- Wix.make_installation("test/wixgem_install.1.1.0.msi", {version: '1.1.0.0', product_name: product2, remove_existing_products: true, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['rakefile.rb']})
51
-
52
- it "should install version 1.0.0" do
53
- execute("msiexec.exe /i test\\wixgem_install.1.0.0.msi")
54
- expect(WindowsInstaller.installed?(product1)).to be(true)
55
- end
56
-
57
- it "should install version 1.1.0" do
58
- execute("msiexec.exe /i test\\wixgem_install.1.1.0.msi")
59
- expect(WindowsInstaller.installed?(product2)).to be(true)
60
- end
61
-
62
- it "the version 1.0.0 should have been uninstalled" do
63
- expect(WindowsInstaller.installed?(product1)).to be(false)
64
- end
65
- ensure
66
- execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product2)}") while(WindowsInstaller.installed?(product2))
67
- raise "Failed to uninstall product #{product2}" if(WindowsInstaller.installed?(product2))
68
- end
69
- end
70
- end
1
+ require 'rspec'
2
+ require './lib/wixgem.rb'
3
+ require './spec/wixpath.rb'
4
+ require './admin.rb'
5
+ require './spec/test_install.rb'
6
+ require './spec/test_files_exist.rb'
7
+ require 'json'
8
+
9
+ if(admin?)
10
+ describe 'Wixgem' do
11
+ describe 'Side by side installations' do
12
+ product1='wixgem_multiple 1.0'
13
+ product2='wixgem_multiple 1.1'
14
+ begin
15
+ Wix.make_installation("test/wixgem_multiple.1.0.0.msi", {version: '1.0.0.0', product_name: product1, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['Gemfile']})
16
+ Wix.make_installation("test/wixgem_multiple.1.1.0.msi", {version: '1.1.0.0', product_name: product2, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['rakefile.rb']})
17
+
18
+ it "should install version 1.0.0" do
19
+ execute("msiexec.exe /i test\\wixgem_multiple.1.0.0.msi")
20
+ expect(WindowsInstaller.installed?(product1)).to be(true)
21
+ expect(WindowsInstaller.version?(product1)).to eq('1.0.0.0')
22
+ end
23
+
24
+ it "should install version 1.1.0" do
25
+ execute("msiexec.exe /i test\\wixgem_multiple.1.1.0.msi")
26
+ expect(WindowsInstaller.installed?(product2)).to be(true)
27
+ expect(WindowsInstaller.version?(product2)).to eq('1.1.0.0')
28
+ end
29
+
30
+ it "version 1.0.0 should still be installed" do
31
+ expect(WindowsInstaller.installed?(product1)).to be(true)
32
+ end
33
+
34
+ it "product codes for version 1.0.0 and 1.0.0 should be different" do
35
+ expect(WindowsInstaller.product_code?(product1)).not_to eq(WindowsInstaller.product_code?(product2))
36
+ end
37
+ ensure
38
+ execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product1)}") while(WindowsInstaller.installed?(product1))
39
+ raise "Failed to uninstall product #{product1}" if(WindowsInstaller.installed?(product1))
40
+ execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product2)}") while(WindowsInstaller.installed?(product2))
41
+ raise "Failed to uninstall product #{product2}" if(WindowsInstaller.installed?(product2))
42
+ end
43
+ end
44
+
45
+ describe 'remove previous version' do
46
+ product1='wixgem_install 1.0'
47
+ product2='wixgem_install 1.1'
48
+ begin
49
+ Wix.make_installation("test/wixgem_install.1.0.0.msi", {version: '1.0.0.0', product_name: product1, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['Gemfile']})
50
+ Wix.make_installation("test/wixgem_install.1.1.0.msi", {version: '1.1.0.0', product_name: product2, remove_existing_products: true, upgrade_code: '{face46ab-74ce-44eb-a2b7-81a8cfad5bab}', files: ['rakefile.rb']})
51
+
52
+ it "should install version 1.0.0" do
53
+ execute("msiexec.exe /i test\\wixgem_install.1.0.0.msi")
54
+ expect(WindowsInstaller.installed?(product1)).to be(true)
55
+ end
56
+
57
+ it "should install version 1.1.0" do
58
+ execute("msiexec.exe /i test\\wixgem_install.1.1.0.msi")
59
+ expect(WindowsInstaller.installed?(product2)).to be(true)
60
+ end
61
+
62
+ it "the version 1.0.0 should have been uninstalled" do
63
+ expect(WindowsInstaller.installed?(product1)).to be(false)
64
+ end
65
+ ensure
66
+ execute("msiexec.exe /quiet /x #{WindowsInstaller.product_code?(product2)}") while(WindowsInstaller.installed?(product2))
67
+ raise "Failed to uninstall product #{product2}" if(WindowsInstaller.installed?(product2))
68
+ end
69
+ end
70
+ end
71
71
  end
@@ -1,35 +1,35 @@
1
- def files(data)
2
- files = data
3
- if(data.kind_of?(Hash))
4
- files = data[:files]
5
-
6
- if(data.has_key?(:modify_file_paths))
7
- modify_paths = data[:modify_file_paths]
8
- files.each_index do |index|
9
- file_path = files[index]
10
- modify_paths.each { |regex, replacement_string| file_path = file_path.gsub(regex, replacement_string) }
11
- files[index] = file_path
12
- end
13
- end
14
- end
15
- return files
16
- end
17
-
18
- def test_files_exist(msi_file, data)
19
- files = files(data)
20
-
21
- product_name = File.basename(msi_file, File.extname(msi_file))
22
- product_name = data[:product_name] if(data.kind_of?(Hash) && data.has_key?(:product_name))
23
-
24
- manufacturer = ''
25
- manufacturer = data[:manufacturer] if(data.kind_of?(Hash) && data.has_key?(:manufacturer))
26
-
27
- relative_install_dir = product_name
28
- raise "#{name}: relative_install_dir should be set to the product name" if(relative_install_dir.length == 0)
29
- relative_install_dir = "#{manufacturer}/#{relative_install_dir}" if(manufacturer.length > 0)
30
-
31
- files.each { |file|
32
- full_path = "C:/Program Files (x86)/#{relative_install_dir}/#{file}"
33
- raise "#{full_path} not installed." unless(File.exists?(full_path))
34
- }
1
+ def files(data)
2
+ files = data
3
+ if(data.kind_of?(Hash))
4
+ files = data[:files]
5
+
6
+ if(data.has_key?(:modify_file_paths))
7
+ modify_paths = data[:modify_file_paths]
8
+ files.each_index do |index|
9
+ file_path = files[index]
10
+ modify_paths.each { |regex, replacement_string| file_path = file_path.gsub(regex, replacement_string) }
11
+ files[index] = file_path
12
+ end
13
+ end
14
+ end
15
+ return files
16
+ end
17
+
18
+ def test_files_exist(msi_file, data)
19
+ files = files(data)
20
+
21
+ product_name = File.basename(msi_file, File.extname(msi_file))
22
+ product_name = data[:product_name] if(data.kind_of?(Hash) && data.has_key?(:product_name))
23
+
24
+ manufacturer = ''
25
+ manufacturer = data[:manufacturer] if(data.kind_of?(Hash) && data.has_key?(:manufacturer))
26
+
27
+ relative_install_dir = product_name
28
+ raise "#{name}: relative_install_dir should be set to the product name" if(relative_install_dir.length == 0)
29
+ relative_install_dir = "#{manufacturer}/#{relative_install_dir}" if(manufacturer.length > 0)
30
+
31
+ files.each { |file|
32
+ full_path = "C:/Program Files (x86)/#{relative_install_dir}/#{file}"
33
+ raise "#{full_path} not installed." unless(File.exists?(full_path))
34
+ }
35
35
  end
data/spec/wixpath.rb CHANGED
@@ -1,3 +1,3 @@
1
- WIX_PATH='E:/Development/dep/OpenSource/WixToolset/3.9'
1
+ WIX_PATH='C:/Development/dep/OpenSource/WixToolset/3.9'
2
2
 
3
3
  Wix.install_path = WIX_PATH
metadata CHANGED
@@ -1,62 +1,62 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wixgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Marshall
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-12 00:00:00.000000000 Z
11
+ date: 2015-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: dev_tasks
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - - '='
@@ -66,7 +66,7 @@ dependencies:
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - "~>"
69
+ - - ~>
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  - - '='
@@ -81,13 +81,7 @@ extra_rdoc_files: []
81
81
  files:
82
82
  - LICENSE
83
83
  - README.md
84
- - example/example.msi
85
- - example/example.msm
86
- - example/install_files/directory/file2.txt
87
- - example/install_files/file1.txt
88
84
  - example/rakefile.rb
89
- - lib/templates/Install.wxs
90
- - lib/templates/mergemodule.wxs
91
85
  - lib/wixgem.rb
92
86
  - spec/execute.rb
93
87
  - spec/installation_spec.rb
@@ -111,17 +105,17 @@ require_paths:
111
105
  - lib
112
106
  required_ruby_version: !ruby/object:Gem::Requirement
113
107
  requirements:
114
- - - ">="
108
+ - - '>='
115
109
  - !ruby/object:Gem::Version
116
110
  version: 1.9.1
117
111
  required_rubygems_version: !ruby/object:Gem::Requirement
118
112
  requirements:
119
- - - ">="
113
+ - - '>='
120
114
  - !ruby/object:Gem::Version
121
115
  version: '0'
122
116
  requirements: []
123
117
  rubyforge_project:
124
- rubygems_version: 2.2.2
118
+ rubygems_version: 2.2.0
125
119
  signing_key:
126
120
  specification_version: 4
127
121
  summary: Simple Ruby interface to facilitate working with Wix Toolset
data/example/example.msi DELETED
Binary file
data/example/example.msm DELETED
Binary file
@@ -1 +0,0 @@
1
- Hello World
@@ -1 +0,0 @@
1
- Hello World
@@ -1,26 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3
- <Product Id="PRODUCT_CODE" Name="PRODUCT_NAME" Language="1033" Version="VERSION" Manufacturer="MANUFACTURER" UpgradeCode="UPGRADE_CODE">
4
- <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
5
-
6
- <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
7
- <Media Id="1" Cabinet="WixgemTest.cab" EmbedCab="yes" />
8
-
9
- <!-- Step 1: Define the directory structure -->
10
- <Directory Id="TARGETDIR" Name="SourceDir">
11
- <Directory Id="ProgramFilesFolder">
12
- INSTALL_DIR
13
- </Directory>
14
- </Directory>
15
-
16
- <!-- Step 2: Add files to installer package -->
17
- <DirectoryRef Id="INSTALLFOLDER">
18
- FILES
19
- </DirectoryRef>
20
-
21
- <!-- Step 3: Tell Wix to install the files-->
22
- <Feature Id="ProductFeature" Title="PRODUCT_NAME Installation" Level="1">
23
- COMPONENT_REFS
24
- </Feature>
25
- </Product>
26
- </Wix>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3
- <Module Id="MODULE_NAME" Language="1033" Version="VERSION">
4
- <Package Id="PRODUCT_CODE" InstallerVersion="200" Manufacturer="MANUFACTURER" />
5
- COMPONENT_REFS
6
- <Directory Id="TARGETDIR" Name="SourceDir">
7
- <Directory Id="MergeRedirectFolder" />
8
- </Directory>
9
- </Module>
10
- <Fragment>
11
- <DirectoryRef Id="MergeRedirectFolder">
12
- FILES
13
- </DirectoryRef>
14
- </Fragment>
15
- </Wix>