wwine 0.1.2 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/wwine +240 -68
  2. data/wwine.1 +29 -2
  3. metadata +20 -41
data/wwine CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
  # wwine
3
- # Copyright (C) Eskild Hustvedt 2009, 2010
3
+ # Copyright (C) Eskild Hustvedt 2009, 2010, 2011, 2012
4
4
  #
5
5
  # This program is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ require 'getoptlong'
20
20
  # To read info for --debuginfo
21
21
  require 'open3'
22
22
  # Application version
23
- $version = '0.1.2'
23
+ $version = '0.2'
24
24
  # The wine flavour to use
25
25
  $wine = nil
26
26
  # The bottle to use
@@ -35,6 +35,10 @@ $wrapperPath = nil
35
35
  $wrapperCwd = nil
36
36
  # File to load wwine data from
37
37
  $wwineDataFrom = nil
38
+ # true if we're in --env mode
39
+ $envMode = false
40
+ # true if we're in --tricks mode
41
+ $tricksMode = false
38
42
 
39
43
  # Purpose: Attempt to kill all running wine processes
40
44
  def killWine (dryRun = false, signal = 15)
@@ -189,7 +193,7 @@ def shellQuote(target)
189
193
  end
190
194
 
191
195
  fixedTarget = target.gsub('\\') { '\\\\' }
192
- fixedTarget.gsub!(/'/,"\\\\'")
196
+ fixedTarget.gsub!(/'/,"'\"'\"'")
193
197
 
194
198
  finalTarget = "'"
195
199
  finalTarget.concat(fixedTarget)
@@ -219,7 +223,7 @@ end
219
223
 
220
224
  # Purpose: Write a wrapper script
221
225
  def writeWrapper (targetFile, wwineCommand, otherCommand, cwd, wwineInfo, args, wineprefix = nil)
222
- # Open the file for riting
226
+ # Open the file for writing
223
227
  begin
224
228
  file = File.open(targetFile,'w')
225
229
  rescue
@@ -234,9 +238,23 @@ def writeWrapper (targetFile, wwineCommand, otherCommand, cwd, wwineInfo, args,
234
238
  file.puts('# You should have received a copy of the GNU General Public License')
235
239
  file.puts('# along with wwine. If not, see <http://www.gnu.org/licenses/>.')
236
240
  file.puts('#')
237
- file.puts('# The following two lines contain wwine metadata');
238
- file.puts('# wwineInfo: v1 '+shellQuote(wwineInfo).join(' '))
239
- file.puts('# wwineCmd: '+shellQuote(args).join(' '));
241
+ file.puts('# -- Begin wwine metadata --')
242
+ file.puts('# wwineInfo: v2')
243
+ file.puts('# wwineDir: '+wwineInfo[0])
244
+ file.puts('# wwineWine: '+wwineInfo[1])
245
+ file.puts('# wwineBottle: '+wwineInfo[2])
246
+ file.puts('# wwineCxinstalldir: '+wwineInfo[3])
247
+ # wwineCmd isn't used in v2, but v1 outputs an invalid message if it
248
+ # doesn't exist. wwineCmd (unnumbered) will be dropped in a later version.
249
+ file.puts('# wwineCmd: nil')
250
+
251
+ subN = 0
252
+ args.each do |sub|
253
+ file.puts("# wwineCmd["+subN.to_s+"]: "+sub)
254
+ subN += 1
255
+ end
256
+
257
+ file.puts('# -- End wwine metadata --')
240
258
  file.puts('')
241
259
  file.puts("cd "+shellQuote(cwd)+" || exit 1")
242
260
  file.puts('wwine='+shellQuote(File.expand_path($0)))
@@ -264,17 +282,11 @@ def writeWrapper (targetFile, wwineCommand, otherCommand, cwd, wwineInfo, args,
264
282
  puts('Wrote wrapper script to '+targetFile)
265
283
  end
266
284
 
267
- # Purpose: Prepare to generate a wrapper script
268
- def generateWrapper (wine,bottle,targetFile,wineCommand,args,type = nil)
285
+ # Purpose: Generate a wwine command and wwineInfo array
286
+ def generateWwineCmd (wine,bottle,wineCommand,type = nil)
269
287
  wwineCmd = []
270
288
  wwineInfo = ['nil','nil','nil','nil']
271
289
 
272
- if File.exists?(targetFile)
273
- puts(targetFile+': already exists. Bailing out')
274
- puts('Remove the target file first, then try again')
275
- exit(1)
276
- end
277
-
278
290
  # Generate a wwine command-line
279
291
  if $verbose
280
292
  wwineCmd.push('--verbose')
@@ -291,6 +303,20 @@ def generateWrapper (wine,bottle,targetFile,wineCommand,args,type = nil)
291
303
  wwineCmd.push('--bottle',bottle)
292
304
  wwineInfo[2] = bottle;
293
305
  end
306
+ return wwineCmd, wwineInfo
307
+ end
308
+
309
+ # Purpose: Prepare to generate a wrapper script
310
+ def generateWrapper (wine,bottle,targetFile,wineCommand,args,type = nil)
311
+
312
+ if File.exists?(targetFile)
313
+ puts(targetFile+': already exists. Bailing out')
314
+ puts('Remove the target file first, then try again')
315
+ exit(1)
316
+ end
317
+
318
+ wwineCmd, wwineInfo = generateWwineCmd(wine,bottle,wineCommand,type)
319
+
294
320
  # Append -- if it isn't already
295
321
  if ! args.join(' ').match(/ -- /)
296
322
  wwineCmd.push('--')
@@ -315,6 +341,39 @@ def generateWrapper (wine,bottle,targetFile,wineCommand,args,type = nil)
315
341
  writeWrapper(targetFile ,wwineCmd, wineCommand, $wrapperCwd, wwineInfo, args, wineprefix)
316
342
  end
317
343
 
344
+ # Purpose: Sets WINE and WINEPREFIX, and then either outputs them to STDOUT, or
345
+ # executes whatever native command was supplied (the logic that handles --env)
346
+ def setEnvAndExec (wine,bottle,cmd,args,type)
347
+ wwineCmd, wwineInfo = generateWwineCmd(wine,nil,cmd,type)
348
+
349
+ wwineCmd.push('--env-bottle')
350
+ wwineCmd.push('--')
351
+ wwineCmd.unshift(File.expand_path($0))
352
+
353
+ if !bottle
354
+ puts("--env requires a --bottle")
355
+ exit(1)
356
+ end
357
+
358
+ if wine == 'wine' || File.exists?(wine)
359
+ bottlePath = ENV['WINEPREFIX']
360
+ elsif wine == 'cedega'
361
+ bottlePath = ENV['HOME']+'/.cedega/'+bottle
362
+ else
363
+ bottlePath = ENV['HOME']+'/.'+wine+'/'+bottle
364
+ end
365
+
366
+ ENV['WINEPREFIX'] = bottlePath
367
+ ENV['WINE'] = wwineCmd.join(" ")
368
+ if args.length > 0
369
+ exec *args
370
+ else
371
+ puts("WINE="+shellQuote(ENV['WINE']))
372
+ puts("WINEPREFIX="+shellQuote(ENV['WINEPREFIX']))
373
+ end
374
+ exit
375
+ end
376
+
318
377
  # Purpose: Load wwine data from a wrapper script
319
378
  def loadWwineDataFromFile (file,dryRun = false)
320
379
  begin
@@ -325,8 +384,14 @@ def loadWwineDataFromFile (file,dryRun = false)
325
384
  puts file+': is not readable'
326
385
  exit(1)
327
386
  end
328
- puts 'Loading settings from '+file+':'
329
- outFormat = '%-20s: %s'+"\n"
387
+
388
+ # Don't output any info-messages when in --env mode
389
+ if $envMode
390
+ outFormat = ''
391
+ else
392
+ puts 'Loading settings from '+file+':'
393
+ outFormat = '%-20s: %s'+"\n"
394
+ end
330
395
  source = File.open(file)
331
396
 
332
397
  if $wrapperPath
@@ -335,93 +400,127 @@ def loadWwineDataFromFile (file,dryRun = false)
335
400
  outMessage = 'Using '
336
401
  end
337
402
 
403
+ info = Hash.new
338
404
  wwineInfo = ''
339
405
  wwineCmd = ''
340
406
 
341
407
  source.each do |line|
342
- if line.sub!(/^#\s+wwineInfo:\s*/,'')
343
- wwineInfo = line
344
- elsif line.sub!(/^#\s+wwineCmd:\s*/,'')
345
- wwineCmd = line
346
- end
347
- if wwineInfo != '' && wwineCmd != ''
348
- break
408
+ if line.match(/^#\s+wwine/)
409
+ key = line.sub(/^#\s+wwine(\S+):\s*(.+)$/,'\1').chomp
410
+ value = line.sub(/^#\s+wwine(\S+):\s*(.+)$/,'\2').chomp
411
+ info[key] = value
349
412
  end
350
413
  end
351
414
 
352
- info = []
353
- cmd = []
354
-
355
- if wwineInfo == nil || wwineCmd == nil || wwineInfo == '' || wwineCmd == ''
415
+ if ! info['Info']
356
416
  puts "The wwine header in this file is broken or missing."
357
417
  puts "Unable to continue."
358
418
  exit(0)
359
419
  end
360
-
361
- unquoteShellArray(wwineInfo,info)
362
- unquoteShellArray(wwineCmd,cmd)
363
-
364
- if info[0] != 'v1'
365
- puts "This version of wwine only supports info format v1."
366
- puts "This file is version "+info[0]
420
+ if info['Info'] == 'v2'
421
+ info = parseWwineDataV2(info);
422
+ elsif info['Info'].match(/^v1/)
423
+ info = parseWwineDataV1(info)
424
+ else
425
+ version = info['Info'].sub(/^(v\S+).+/,'\1').chomp
426
+ puts "This version of wwine supports info format v1 and v2."
427
+ puts "This file is version "+version
367
428
  puts "Unable to continue."
368
429
  exit(0)
369
430
  end
370
431
 
371
- if wwineInfo.length < 6 || wwineCmd.length < 1
432
+ if info['Cmd'].length < 1
372
433
  puts "The wwine header in this file is broken."
373
434
  puts "Unable to continue."
374
435
  exit(0)
375
436
  end
376
437
 
377
- if info[1] != 'nil' && !$wrapperCwd
438
+ # Get the directory
439
+ if info['Dir'] != 'nil' && !$wrapperCwd && !$envMode
378
440
  if $wrapperPath
379
441
  switchMessage = '--wrapdir'
380
442
  else
381
443
  switchMessage = 'Switching to directory'
382
444
  end
383
- printf(outFormat,switchMessage,info[1])
384
- if File.exists?(info[1])
445
+ printf(outFormat,switchMessage,info['Dir'])
446
+ if File.exists?(info['Dir'])
385
447
  if $wrapperPath
386
- $wrapperCwd = info[1]
448
+ $wrapperCwd = info['Dir']
387
449
  else
388
- Dir.chdir(info[1])
450
+ Dir.chdir(info['Dir'])
389
451
  end
390
452
  else
391
- puts info[1]+': does not exist, giving up.'
453
+ puts info['Dir']+': does not exist, giving up.'
392
454
  exit(0)
393
455
  end
394
456
  end
395
457
 
396
- if $wine == nil && info[2] != 'nil'
397
- $wine = info[2]
458
+ # Get the --wine to use
459
+ if $wine == nil && info['Wine'] != 'nil'
460
+ $wine = info['Wine']
398
461
  printf(outFormat,outMessage+'--wine',$wine)
399
462
  end
400
463
 
401
- if $bottle == nil && info[3] != 'nil'
402
- $bottle = info[3]
464
+ # Get the --bottle to use
465
+ if $bottle == nil && info['Bottle'] != 'nil'
466
+ $bottle = info['Bottle']
403
467
  printf(outFormat,outMessage+'--bottle',$bottle)
404
468
  end
405
469
 
406
- if $cxPath == nil && info[4] != 'nil'
407
- $cxPath = info[4]
470
+ # Get the --cxinstalldir to use
471
+ if $cxPath == nil && info['Cxinstalldir'] != 'nil'
472
+ $cxPath = info['Cxinstalldir']
408
473
  printf(outFormat,outMessage+'--cxinstalldir',$cxPath)
409
474
  end
410
475
 
411
- if ! dryRun
476
+ # Set the command to run
477
+ if ! dryRun && !$envMode
412
478
  if $wrapperPath
413
479
  out = 'Program command'
414
480
  else
415
481
  out = 'Will now run'
416
482
  end
417
- printf(outFormat,out,cmd.join(' '))
418
- ARGV.unshift(*cmd)
483
+ printf(outFormat,out,info['Cmd'].join(' '))
484
+ ARGV.unshift(*info['Cmd'])
419
485
  end
420
486
  rescue => ex
421
487
  handleException(ex)
422
488
  end
423
489
  end
424
490
 
491
+ # Parses wwine metadata version 1 (wwine 0.1.x)
492
+ def parseWwineDataV1 (rawData)
493
+ data = []
494
+ unquoteShellArray(rawData['Info'],data)
495
+ info = Hash.new
496
+ info['Dir'] = data[1]
497
+ info['Wine'] = data[2]
498
+ info['Bottle'] = data[3]
499
+ info['Cxinstalldir'] = data[4]
500
+
501
+ cmd = []
502
+
503
+ unquoteShellArray(rawData['Cmd'],cmd)
504
+ info['Cmd'] = cmd
505
+ return info
506
+ end
507
+
508
+ # Parses wwine metadata version 2 (wwine 0.2+)
509
+ def parseWwineDataV2 (data)
510
+ cmd = []
511
+ currNo = 0
512
+ while currNo < 999
513
+ if data['Cmd['+currNo.to_s+']'] != nil
514
+ cmd.push(data['Cmd['+currNo.to_s+']'])
515
+ else
516
+ break
517
+ end
518
+ currNo += 1
519
+ end
520
+ data['Cmd'] = cmd
521
+ return data
522
+ end
523
+
425
524
  # Purpose: Run a command, outputting info of it in verbose mode
426
525
  def runcmd(cmd, type = 'exec')
427
526
  if(type == 'exec')
@@ -457,8 +556,9 @@ def Help ()
457
556
  puts "Usage: wwine (WWINE PARAMETERS) PROGRAM -- [PROGRAM ARGUMENTS]"
458
557
  puts ""
459
558
  printHelp('-h','--help','Display this help text')
460
- printHelp('-w','--wine','Select the wine to use: wine, cxoffice, cxgames, cedega, or a path to a wine bin. Default: wine')
559
+ printHelp('-w','--wine','Select the wine to use: wine, crossover, cxgames, cedega, or a path to a wine bin. Default: wine')
461
560
  printHelp('-b','--bottle','Use the selected bottle (~/.wwinebottles/[NAME] for wine, CX bottle or cedega folder, depending on the --wine in use). The bottle will be created if it does not exist.')
561
+ printHelp('','--env','Set the WINE and WINEPREFIX environment variables to match the parameters provided to wwine and optionally run a program with those variables set.')
462
562
  printHelp('-k','--kill','Attempt to kill all running wine processes')
463
563
  printHelp('','--drykill','Print what --kill would have done, but don\'t actually do anything')
464
564
  printHelp('-c','--cxinstalldir','Use the supplied path as the install path for CXoffice/CXgames (default: autodetect).')
@@ -665,11 +765,16 @@ def debugInfo ()
665
765
 
666
766
  cxgBin = getCXwithParams('cxgames',nil,false)
667
767
  cxgVer = getCXVersionsFrom(cxgBin,true)
668
- printf(outFormat,'Crossover Games',cxgVer)
669
768
 
670
769
  cxoBin = getCXwithParams('cxoffice',nil,false)
671
770
  cxoVer = getCXVersionsFrom(cxoBin,true)
672
- printf(outFormat,'Crossover Office',cxoVer)
771
+
772
+ if(cxoBin && !cxgBin)
773
+ cxgVer = '(not available - aliased to crossover)'
774
+ end
775
+
776
+ printf(outFormat,'Crossover Games',cxgVer)
777
+ printf(outFormat,'Crossover',cxoVer)
673
778
 
674
779
  cedegaVer = getCedegaVersionString()
675
780
  printf(outFormat,'Cedega',cedegaVer)
@@ -772,25 +877,41 @@ def getCXwithParams (wine,bottle, missingIsFatal = true)
772
877
  final = []
773
878
  cxdir = nil
774
879
 
880
+ mode = wine
881
+ bottleDir = '.'+wine
882
+
775
883
  # Various crossover install paths
776
884
  wines = ['/opt/'+wine, ENV['HOME']+'/'+wine, ENV['HOME']+'/.local/'+wine, ENV['HOME']+'/games/'+wine]
777
885
 
778
886
  # If cxpath is set then overwrite the default paths
779
887
  if $cxPath != nil
780
- wines = [ $cxPath+'/'+wine ]
888
+ wines = [ $cxPath+'/'+wine, $cxPath ]
781
889
  end
782
890
 
783
891
  wines.each do |path|
784
- if File.exists?(path) and File.executable?(path+'/bin/cxstart')
785
- cxdir = path
786
- break
892
+ if File.exists?(path)
893
+ if ( File.executable?(path+'/bin/cximportbottles') || File.executable?(path+'/bin/crossover') ) and wine != 'cxgames'
894
+ # Perform additional detection of dotDir, as that one tends to change
895
+ dotDir = Dir.glob(path+'/etc/cxoffice*.conf').shift
896
+ if( dotDir != nil && dotDir.sub!(/^.*(cxoffice\d*)\.conf$/,'\1') )
897
+ mode = 'crossover'
898
+ cxdir = path
899
+ bottleDir = '.'+dotDir
900
+ break
901
+ end
902
+ elsif File.executable?(path+'/bin/cxstart')
903
+ cxdir = path
904
+ break
905
+ end
787
906
  end
788
907
  end
789
908
 
790
909
  # If we're using cxPath, perform some additional detection
791
- if $cxPath != nil
910
+ if $cxPath != nil and mode != 'crossover'
792
911
  if File.exists?($cxPath+'/etc/'+wine+'.conf')
793
912
  cxdir = $cxPath
913
+ else
914
+ cxdir = nil
794
915
  end
795
916
  end
796
917
 
@@ -826,10 +947,10 @@ def getCXwithParams (wine,bottle, missingIsFatal = true)
826
947
  final.push('--');
827
948
 
828
949
  # Create the bottle if it does not exist
829
- if bottle != nil and ! File.exists?(ENV['HOME']+'/.'+wine+'/'+bottle)
950
+ if bottle != nil and ! File.exists?(ENV['HOME']+'/'+bottleDir+'/'+bottle)
830
951
  puts 'The bottle '+bottle+' did not exist, creating...'
831
952
  runcmd([ cxdir+'/bin/cxbottle', '--bottle',bottle,'--create','--template','winxp'],'system')
832
- if ! File.exists?(ENV['HOME']+'/.'+wine+'/'+bottle)
953
+ if ! File.exists?(ENV['HOME']+'/'+bottleDir+'/'+bottle)
833
954
  puts 'Bottle creation failed.'
834
955
  exit 1
835
956
  end
@@ -898,18 +1019,25 @@ def runWine (wine,bottle,args)
898
1019
 
899
1020
  if wine == nil
900
1021
  type,cmd = getAutoWithParams(bottle)
1022
+ wine = type
901
1023
  else
902
- # Expand cxg and cxo
1024
+ # Expand cx*
903
1025
  if wine == 'cxg'
904
1026
  wine = 'cxgames'
905
- elsif wine == 'cxo'
906
- wine = 'cxoffice'
1027
+ elsif wine == 'cxo' || wine == 'cx' || wine == 'cxoffice'
1028
+ wine = 'crossover'
907
1029
  end
908
1030
 
909
1031
  type = wine
910
1032
 
911
- if wine == 'cxgames' || wine == 'cxoffice'
1033
+ if wine == 'cxgames' || wine == 'cxoffice' || wine == 'crossover'
912
1034
  cmd = getCXwithParams(wine,bottle)
1035
+ if wine == 'cxgames' && cmd == nil
1036
+ cmd = getCXwithParams('crossover',bottle)
1037
+ if cmd != nil
1038
+ puts('Converting --wine cxgames to --wine crossover since cxgames is not installed')
1039
+ end
1040
+ end
913
1041
  elsif wine == 'wine' || File.executable?(wine)
914
1042
  type = 'wine'
915
1043
  cmd = getWineWithParams(wine,bottle)
@@ -917,15 +1045,40 @@ def runWine (wine,bottle,args)
917
1045
  cmd = getCedegaWithParams(wine,bottle)
918
1046
  else
919
1047
  puts('Unknown --wine: '+wine)
920
- puts('Must be one of: wine, cxgames, cxoffice, cedega, or the path to a wine executable')
1048
+ puts('Must be one of: wine, crossover, cxgames, cedega, or the path to a wine executable')
921
1049
  exit(1)
922
1050
  end
923
1051
  end
924
1052
  cmd.concat(args)
925
1053
 
1054
+ # If args is a single parameter, that parameter is --version, and we're not using
1055
+ # vanilla wine, then we emulate vanilla wine's --version output. This helps
1056
+ # utilities like winetricks when it is running under "wwine --env"
1057
+ if args.length == 1 && args[0] == '--version'
1058
+ # For CX* we can actually output a useful version number, namely the
1059
+ # wine version that CX* release was based on
1060
+ if wine == 'cxgames' || wine == 'cxoffice' || wine == 'crossover'
1061
+ cxgBin = getCXwithParams(wine,nil,false)
1062
+ cxVer, cxwVer = getCXVersionsFrom( cxgBin )
1063
+ # CX* wine --versions often contain git revisions and other additional
1064
+ # information in the version number, this strips that out.
1065
+ cxwVer.sub!(/-.*/,'')
1066
+ puts 'wine-'+cxwVer
1067
+ exit
1068
+ # For cedega we just output an invalid version number in the same syntax
1069
+ # as vanilla wine would have done
1070
+ elsif wine == 'cedega'
1071
+ puts 'wine-0.0.0'
1072
+ exit
1073
+ end
1074
+ end
1075
+
1076
+ # If we're in envMode, then we let setEnvAndExec handle the rest
1077
+ if $envMode
1078
+ setEnvAndExec(wine,bottle,cmd,args,type)
926
1079
  # If wrapperPath is set, then we're suppose to generate a wrapper script instead
927
1080
  # of actually executing it.
928
- if $wrapperPath != nil
1081
+ elsif $wrapperPath != nil
929
1082
  generateWrapper(wine,bottle,$wrapperPath,cmd,args,type)
930
1083
  else
931
1084
  runcmd(cmd)
@@ -944,6 +1097,9 @@ opts = GetoptLong.new(
944
1097
  [ '--wrapdir', GetoptLong::REQUIRED_ARGUMENT ],
945
1098
  [ '--debuginfo', GetoptLong::NO_ARGUMENT ],
946
1099
  [ '--man', GetoptLong::NO_ARGUMENT ],
1100
+ [ '--env', GetoptLong::NO_ARGUMENT ],
1101
+ [ '--tricks', GetoptLong::NO_ARGUMENT ],
1102
+ [ '--env-bottle', GetoptLong::NO_ARGUMENT ],
947
1103
  [ '--from', '-s', GetoptLong::REQUIRED_ARGUMENT ],
948
1104
  [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ]
949
1105
  )
@@ -959,6 +1115,13 @@ begin
959
1115
  $wine = arg
960
1116
  when '--bottle'
961
1117
  $bottle = arg
1118
+ when '--env-bottle'
1119
+ if ENV['WINEPREFIX'] && ENV['WINEPREFIX'].length > 0
1120
+ $bottle = File.basename(ENV['WINEPREFIX'])
1121
+ else
1122
+ puts 'wwine: --env-bottle supplied but WINEPREFIX is not set'
1123
+ exit(1)
1124
+ end
962
1125
  when '--verbose'
963
1126
  $verbose = true
964
1127
  when '--drykill'
@@ -984,6 +1147,11 @@ begin
984
1147
  $wrapperCwd = arg
985
1148
  when '--from'
986
1149
  $wwineDataFrom = arg
1150
+ when '--env'
1151
+ $envMode = true
1152
+ when '--tricks'
1153
+ $tricksMode = true
1154
+ $envMode = true
987
1155
  when '--man'
988
1156
  showManPage()
989
1157
  exit(0)
@@ -1003,11 +1171,15 @@ if $wwineDataFrom
1003
1171
  loadWwineDataFromFile($wwineDataFrom)
1004
1172
  end
1005
1173
 
1006
- if ARGV.length == 0
1174
+ if ARGV.length == 0 && !$envMode
1007
1175
  Help()
1008
1176
  exit(1)
1009
1177
  end
1010
1178
 
1179
+ if $tricksMode
1180
+ ARGV.unshift('winetricks','--no-isolate')
1181
+ end
1182
+
1011
1183
  begin
1012
1184
  runWine($wine,$bottle,ARGV)
1013
1185
  rescue => ex
data/wwine.1 CHANGED
@@ -1,5 +1,5 @@
1
1
  .IX Title "WWINE 1"
2
- .TH WWINE 1 "2010-07-07" "wwine 0.1.2" ""
2
+ .TH WWINE 1 "2011-12-03" "wwine 0.2" ""
3
3
  .\" For nroff, turn off justification. Always turn off hyphenation; it makes
4
4
  .\" way too many mistakes in technical documents.
5
5
  .if n .ad l
@@ -61,6 +61,26 @@ you want (ie. \*(L"wwine \-k9\*(R").
61
61
  .IP "\fB\-\-drykill\fR" 4
62
62
  .IX Item "--drykill"
63
63
  Print what \fI\-\-kill\fR would have done, without actually doing anything.
64
+ .IP "\fB\-\-env\fR" 4
65
+ .IX Item "--env"
66
+ \&\fB\-\-env\fR causes wwine to set the \s-1WINE\s0 and \s-1WINEPREFIX\s0 environment
67
+ variables, and (optionally) run a native program with those variables
68
+ set. This lets you run any program that uses the \s-1WINE\s0 and \s-1WINEPREFIX\s0
69
+ variables with wwine instead of wine (effectively giving you bottle
70
+ support, as well as support for using cxgames/cxoffice/.. instead
71
+ of wine).
72
+
73
+ When you use \-\-env, wwine will obey \-\-bottle and \-\-wine (or \-\-from) and set
74
+ \&\s-1WINE\s0 and \s-1WINEPREFIX\s0 accordingly. If you supply additional parameters, then
75
+ wwine will run that command, otherwise it will output the variables that would
76
+ have been set.
77
+
78
+ See the \s-1EXAMPLES\s0 section for an example of how to use winetricks
79
+ with cxgames using wwine's \fB\-\-env\fR
80
+ .IP "\fB\-\-env\-bottle\fR" 4
81
+ .IX Item "--env-bottle"
82
+ This option is primarily for internal use. It causes wwine to parse which
83
+ \&\-\-bottle to use from the \s-1WINEPREFIX\s0 variable.
64
84
  .IP "\fB\-c, \-\-cxinstalldir\fR \fI\s-1PATH\s0\fR" 4
65
85
  .IX Item "-c, --cxinstalldir PATH"
66
86
  Use the supplied path as the path to either a crossover office/games install
@@ -150,6 +170,13 @@ This causes wwine to run the command specified in ~/bin/startFile
150
170
  using the parameters specified in ~/bin/startFile, with the exception of
151
171
  \&\-\-wine, which would be wine instead of cxgames (here assuming this
152
172
  is the file created by the above example).
173
+ .IP "\fIwwine \-w cxg \-b file \-\-env \*(-- winetricks \-\-no\-isolate vcrun6\fR" 4
174
+ .IX Item "wwine -w cxg -b file --env winetricks --no-isolate vcrun6"
175
+ This causes wwine to set the environment variables \s-1WINE\s0 and \s-1WINEPREFIX\s0,
176
+ and then execute the command supplied. In this case it would run
177
+ winetricks, which would be told to install \*(L"vcrun6\*(R". Because it is running
178
+ under wwine's \-\-env parameter, winetricks will use wwine to perform
179
+ the actions, thus allowing you to use winetricks with cxgames.
153
180
  .IP "\fIwwine \-k\fR" 4
154
181
  .IX Item "wwine -k"
155
182
  Will make wwine attempt to kill all running wine processes on this system by
@@ -191,7 +218,7 @@ submit feature requests there as well.
191
218
  \&\fBwwine\fR is written by Eskild Hustvedt <\fIcode at zerodogg dot org\fR>
192
219
  .SH "LICENSE AND COPYRIGHT"
193
220
  .IX Header "LICENSE AND COPYRIGHT"
194
- Copyright (C) Eskild Hustvedt 2009, 2010
221
+ Copyright (C) Eskild Hustvedt 2009, 2010, 2011
195
222
  .PP
196
223
  This is free software; see the source for copying conditions. There is \s-1NO\s0
197
224
  warranty; not even for \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.
metadata CHANGED
@@ -1,71 +1,50 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: wwine
3
- version: !ruby/object:Gem::Version
4
- hash: 31
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 2
10
- version: 0.1.2
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.2'
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Eskild Hustvedt
14
9
  autorequire:
15
10
  bindir: .
16
11
  cert_chain: []
17
-
18
- date: 2010-08-22 00:00:00 +02:00
19
- default_executable:
12
+ date: 2012-03-09 00:00:00.000000000 Z
20
13
  dependencies: []
21
-
22
14
  description: wwine is a simple wine wrapper.
23
15
  email: code at zerodogg dot org
24
- executables:
16
+ executables:
25
17
  - wwine
26
18
  extensions: []
27
-
28
19
  extra_rdoc_files: []
29
-
30
- files:
20
+ files:
31
21
  - wwine
32
22
  - README
33
23
  - COPYING
34
24
  - wwine.1
35
25
  - ./wwine
36
- has_rdoc: true
37
26
  homepage: http://random.zerodogg.org/wwine
38
27
  licenses: []
39
-
40
28
  post_install_message:
41
29
  rdoc_options: []
42
-
43
- require_paths:
30
+ require_paths:
44
31
  - lib
45
- required_ruby_version: !ruby/object:Gem::Requirement
32
+ required_ruby_version: !ruby/object:Gem::Requirement
46
33
  none: false
47
- requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- hash: 3
51
- segments:
52
- - 0
53
- version: "0"
54
- required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
39
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
63
44
  requirements: []
64
-
65
45
  rubyforge_project:
66
- rubygems_version: 1.3.7
46
+ rubygems_version: 1.8.11
67
47
  signing_key:
68
48
  specification_version: 3
69
49
  summary: wwine is a simple wine wrapper.
70
50
  test_files: []
71
-