File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,21 @@ def m_exec(session, cmd)
70
70
print_status ( "Creating a temporary installation directory #{ tempdir } ..." )
71
71
client . fs . dir . mkdir ( tempdir )
72
72
73
- %W{ metsrv.dll metsvc-server.exe metsvc.exe } . each do |bin |
74
- next if ( bin != "metsvc.exe" and remove )
75
- print_status ( " >> Uploading #{ bin } ..." )
76
- fd = client . fs . file . new ( tempdir + "\\ " + bin , "wb" )
77
- fd . write ( ::File . read ( File . join ( based , bin ) , ::File . size ( ::File . join ( based , bin ) ) ) )
73
+ # Use an array of `from -> to` associations so that things
74
+ # such as metsrv can be copied from the appropriate location
75
+ # but named correctly on the target.
76
+ bins = {
77
+ 'metsrv.x86.dll' => 'metsrv.dll' ,
78
+ 'metsvc-server.exe' => nil ,
79
+ 'metsvc.exe' => nil
80
+ }
81
+
82
+ bins . each do |from , to |
83
+ next if ( from != "metsvc.exe" and remove )
84
+ to ||= from
85
+ print_status ( " >> Uploading #{ from } ..." )
86
+ fd = client . fs . file . new ( tempdir + "\\ " + to , "wb" )
87
+ fd . write ( ::File . read ( File . join ( based , from ) , ::File . size ( ::File . join ( based , from ) ) ) )
78
88
fd . close
79
89
end
80
90
You can’t perform that action at this time.
0 commit comments