wisotool 310 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294
  1. #!/bin/sh
  2. # Quick and dirty script to install apps from .iso files
  3. # Adapted from winetricks as of r995
  4. # Copyright 2007, 2008, 2009, 2010 Google (Dan Kegel, dank@kegel.com)
  5. # Copyright 2008, 2009, 2010 Austin English (austinenglish@gmail.com)
  6. # License: LGPL (for compatibility with winehq)
  7. # Please report problems at http://code.google.com/p/winezeug/issues
  8. # Note to contributors: please avoid gnu extensions in this shell script,
  9. # as it has to run on MacOSX and Solaris, too. A good book on the topic is
  10. # "Portable Shell Programming" by Bruce Blinn
  11. #---- Constants -------------------------------------------------
  12. # Name of this version of wisotool (YYYYMMDD)
  13. VERSION=20101106
  14. # Run a windows command without triggering wine's mshtml's gecko install dialog
  15. early_wine()
  16. {
  17. WINEDLLOVERRIDES=mshtml= $WINE "$@"
  18. }
  19. # Default values for important settings if not already in environment.
  20. # These settings should not need editing here.
  21. case "$OS" in
  22. "Windows_NT")
  23. # Cheezy fix for getting rid of double slashes when running cygwin in wine
  24. case "$HOME" in
  25. /) HOME="" ;;
  26. esac
  27. WINE=""
  28. WINESERVER=true
  29. DRIVE_C="C:/"
  30. XXXPATH=cygpath
  31. ;;
  32. *)
  33. WINE=${WINE:-wine}
  34. WINEVERSION=`$WINE --version`
  35. WINESERVER=${WINESERVER:-`which wineserver`}
  36. WINEPREFIX="${WINEPREFIX:-$HOME/.wine}"
  37. DRIVE_C="$WINEPREFIX/dosdevices/c:"
  38. XXXPATH="early_wine winepath"
  39. USERID=`id -u`
  40. ;;
  41. esac
  42. WISOTOOL_DIR=${WISOTOOL_DIR:-$HOME/.wisotool}
  43. # You can add your own verb to wisotool by creating $WISOTOOL_VERBS/foo.verb
  44. WISOTOOL_VERBS="${WISOTOOL_VERBS:-$WISOTOOL_DIR/verbs}"
  45. mkdir -p "$WISOTOOL_VERBS"
  46. # Postinstall scripts, if any, go here
  47. WISOTOOL_POST="${WISOTOOL_POST:-$WISOTOOL_DIR/postinstall}"
  48. # Internal variables; these locations are not too important
  49. WISOTOOL_CACHE="${WISOTOOL_CACHE:-$HOME/.wisotoolcache}"
  50. test -d "$WISOTOOL_CACHE" || WISOTOOL_CACHE="$WISOTOOL_DIR/cache"
  51. WISOTOOL_CACHE_WIN="`$XXXPATH -w $WISOTOOL_CACHE | tr '\012' ' ' | sed 's/ $//'`"
  52. WISOTOOL_TMP="$DRIVE_C"/wisotooltmp
  53. WISOTOOL_TMP_WIN='c:\wisotooltmp'
  54. # Clean up after failed runs, if needed
  55. rm -rf "$WISOTOOL_TMP"
  56. mkdir -p "$WISOTOOL_TMP"
  57. # Handle case where z: doesn't exist
  58. case "$WISOTOOL_CACHE_WIN" in
  59. ""|*\?\\unix*)
  60. # WISOTOOL_CACHE isn't accessible via a drive letter mapping, so make one,
  61. # but be sure to clean it up later.
  62. for letter in y x w v u t s r q
  63. do
  64. if ! test -d "$WINEPREFIX"/dosdevices/${letter}:
  65. then
  66. WISOTOOL_CACHE_SYMLINK="$WINEPREFIX"/dosdevices/${letter}:
  67. ln -sf "$WISOTOOL_CACHE" "$WISOTOOL_CACHE_SYMLINK"
  68. WISOTOOL_CACHE_WIN=${letter}:
  69. break
  70. fi
  71. done
  72. ;;
  73. esac
  74. # Make sure USERNAME is set.
  75. # (USERNAME isn't quite a standard - some Unixes set LOGNAME instead.)
  76. USERNAME=${USERNAME:-$LOGNAME}
  77. # Overridden for windows
  78. ISO_MOUNT_ROOT=/mnt/wisotool
  79. ISO_MOUNT_LETTER=i
  80. WINDIR="$DRIVE_C/windows"
  81. #---- Functions -------------------------------------------------
  82. # Detect which sudo to use
  83. detect_sudo() {
  84. SUDO=sudo
  85. test "$GUI" = 1 || return
  86. if test x"$DISPLAY" != x""
  87. then
  88. if test -x "`which gksudo 2>/dev/null`"
  89. then
  90. SUDO=gksudo
  91. elif test -x "`which kdesudo 2>/dev/null`"
  92. then
  93. SUDO=kdesudo
  94. fi
  95. fi
  96. }
  97. # Detect which menu program to use
  98. detect_menu() {
  99. # TODO: add 'dialog'
  100. MENU=xmessage
  101. if test -x "`which zenity 2>/dev/null`"
  102. then
  103. MENU=zenity
  104. elif test -x "`which kdialog 2>/dev/null`"
  105. then
  106. MENU=kdialog
  107. fi
  108. }
  109. warn() {
  110. echo "------------------------------------------------------"
  111. echo "$@"
  112. echo "------------------------------------------------------"
  113. test "$GUI" = 1 || return
  114. # For some reason, nulls were showing up in $@?!, causing truncated output in zenity
  115. msg="`echo $@ | tr '\000' ' '`"
  116. case $MENU in
  117. *zenity) zenity --error --title=Wisotool --text="$msg" --no-wrap;;
  118. *kdialog) kdialog --title Wisotool --error "$msg" ;;
  119. *xmessage) xmessage -title Wisotool -center " Error: $msg " ;;
  120. esac
  121. }
  122. die() {
  123. warn "$@"
  124. exit 1
  125. }
  126. # Abort if user doesn't own the given directory (or its parent, if it doesn't exist yet)
  127. die_if_user_not_dirowner() {
  128. if test -d "$1"
  129. then
  130. checkdir="$1"
  131. else
  132. # fixme: quoting problem?
  133. checkdir=`dirname "$1"`
  134. fi
  135. nuser=`id -u`
  136. nowner=`ls -l -n -d -L "$checkdir" | awk '{print $3}'`
  137. if test x$nuser != x$nowner
  138. then
  139. die "You (`id -un`) don't own $checkdir. Don't run wisotool as another user!"
  140. fi
  141. }
  142. #----------------------------------------------------------------
  143. usage() {
  144. set +x
  145. # WARNING: do not use single quote in any package description; that breaks the gui menu.
  146. echo "Script to install games automatically."
  147. echo "Usage: $0 [options] package [package] ..."
  148. echo ""
  149. echo "Options:"
  150. echo " -q quieter"
  151. echo " -v verbose"
  152. echo " -V display Version"
  153. echo "Packages:"
  154. sort "$WISOTOOL_TMP"/menutext
  155. echo "Pseudopackages:"
  156. echo " load Load a disc into the iso cache"
  157. echo " load=KEY Load a disc with given key; only works from commandline at moment"
  158. # Show the other help message, too
  159. case $GUI in
  160. 0) load_help ;;
  161. esac
  162. }
  163. #----------------------------------------------------------------
  164. # Trivial GUI just to handle case where user tries running without commandline
  165. kdialog_showmenu() {
  166. title="$1"
  167. shift
  168. text="$1"
  169. shift
  170. col1name="$1"
  171. shift
  172. col2name="$1"
  173. shift
  174. while test $# -gt 0
  175. do
  176. args="$args $1 $1 off"
  177. shift
  178. done
  179. kdialog --title "$title" --separate-output --checklist "$text" $args
  180. }
  181. xmessage_showmenu() {
  182. title="$1"
  183. shift
  184. text="$1"
  185. shift
  186. col1name="$1"
  187. shift
  188. col2name="$1"
  189. shift
  190. if test $# -gt 0
  191. then
  192. args="$1"
  193. shift
  194. fi
  195. while test $# -gt 0
  196. do
  197. args="$args,$1"
  198. shift
  199. done
  200. (echo "$title"; echo ""; echo "$text") | \
  201. xmessage -print -file - -buttons "Cancel,$args" | sed 's/Cancel//'
  202. }
  203. showmenu()
  204. {
  205. # FIXME: call verblist_get_descriptions instead of scraping usage() ?
  206. case $MENU in
  207. zenity)
  208. echo "zenity --title 'Select a package to install' --text 'Install?' --list --checklist --column '' --column Package --column Description --height 440 --width 600 \\" > "$WISOTOOL_TMP"/zenity.sh
  209. usage | grep '^ [3a-z]' | sed 's/^ \([^ ]*\) *\(.*\)/FALSE "\1" '"'\2'/" | sed 's/$/ \\/' >> $WISOTOOL_TMP/zenity.sh
  210. todo="`sh "$WISOTOOL_TMP"/zenity.sh | tr '|' ' '`"
  211. ;;
  212. kdialog)
  213. packages=`usage | awk '/^ [3a-z]/ {print $1}'`
  214. todo="`kdialog_showmenu "wisotool" "Select a package to install" "Install?" "Package" $packages`"
  215. ;;
  216. xmessage)
  217. packages=`usage | awk '/^ [3a-z]/ {print $1}'`
  218. todo="`xmessage_showmenu "wisotool" "Select a package to install" "Install?" "Package" $packages`"
  219. ;;
  220. esac
  221. if test "$todo"x = x
  222. then
  223. exit 0
  224. fi
  225. }
  226. #----- Helpers ------------------------------------------------
  227. # Execute with error checking
  228. try() {
  229. # "VAR=foo try cmd" fails to put VAR in the environment
  230. # with some versions of bash if try is a shell function?!
  231. # Adding this explicit export works around it.
  232. export WINEDLLOVERRIDES
  233. echo Executing "$@"
  234. # Mark executable - needed if running on windows vista
  235. case "$1" in
  236. *.exe) chmod +x "$1" || true
  237. cmd /c "$@"
  238. ;;
  239. *)
  240. "$@"
  241. ;;
  242. esac
  243. status=$?
  244. if test $status -ne 0
  245. then
  246. die "Note: command '$@' returned status $status. Aborting."
  247. fi
  248. }
  249. try_regedit() {
  250. # on windows, doesn't work without cmd /c
  251. case "$OS" in
  252. "Windows_NT") cmdc="cmd /c";;
  253. *) unset cmdc
  254. esac
  255. try early_wine $cmdc regedit "$@"
  256. }
  257. regedit() {
  258. die oops, bug, please report
  259. }
  260. wineserver() {
  261. die oops, bug, please report
  262. }
  263. try_cabextract() {
  264. # Not always installed, but shouldn't be fatal unless it's being used
  265. CABEXTRACT="`which cabextract 2>/dev/null`"
  266. if test ! -x "$CABEXTRACT"
  267. then
  268. die "Cannot find cabextract. Please install it (e.g. 'sudo apt-get install cabextract' or 'sudo yum install cabextract')."
  269. fi
  270. try $CABEXTRACT "$@"
  271. }
  272. try_unrar() {
  273. # Not always installed, but shouldn't be fatal unless it's being used
  274. UNRAR="`which unrar 2>/dev/null`"
  275. if test ! -x "$UNRAR"
  276. then
  277. die "Cannot find unrar. Please install it (e.g. 'sudo apt-get install unrar' or 'sudo yum install unrar'). For cygwin, you can get it at http://gnuwin32.sourceforge.net/packages/unrar.htm"
  278. fi
  279. try $UNRAR "$@"
  280. }
  281. cabextract() {
  282. die oops, bug, please report
  283. }
  284. # Usage: workaround_wine_bug bugnumber [good-wineversion-shell-pattern]
  285. # False (nonzero status) on Windows.
  286. # True (zero status) on Wine unless good-wineversion-shell-pattern is set
  287. # and matches the current wine version.
  288. # For debugging: if you want to skip a bug's workaround, put the bug number in the
  289. # environment variable WISOTOOL_BLACKLIST to disable it.
  290. workaround_wine_bug()
  291. {
  292. if test "$WINE" = ""
  293. then
  294. echo No need to work around wine bug $1 on windows
  295. return 1
  296. fi
  297. if test "$2" != ""
  298. then
  299. # Using shell patterns in a variable with case is tricky, need to use eval
  300. checkcode="
  301. case $WINEVERSION in
  302. $2) echo No need to work around wine bug $1 in wine $WINEVERSION
  303. return 1
  304. ;;
  305. esac
  306. "
  307. eval "$checkcode"
  308. fi
  309. case $1 in
  310. "$WISOTOOL_BLACKLIST")
  311. echo wine bug $1 workaround blacklisted, skipping
  312. return 1
  313. ;;
  314. esac
  315. warn Working around wine bug $1
  316. return 0
  317. }
  318. # verify an sha1sum
  319. verify_sha1sum() {
  320. wantsum=$1
  321. file=$2
  322. gotsum=`$SHA1SUM < $file | sed 's/ .*//'`
  323. if [ "$gotsum"x != "$wantsum"x ]
  324. then
  325. die "sha1sum mismatch! Rename $file and try again."
  326. fi
  327. }
  328. # Escape entities for URL usage
  329. # Usage: url_encode < to_filter > filtered
  330. # See RFC3986.
  331. url_encode() {
  332. perl -e '
  333. while (<>) {
  334. s/\n//;
  335. s/([^A-Za-z0-9\-\._~])/sprintf("%%%02X", ord($1))/ge;
  336. print;
  337. }
  338. '
  339. return $?
  340. }
  341. # Download a file
  342. # Usage: package url [sha1sum [filename [cookie jar]]]
  343. # Caches downloads in wisotoolcache/$package
  344. download() {
  345. if [ "$4"x != ""x ]
  346. then
  347. file="$4"
  348. else
  349. file=`basename "$2"`
  350. fi
  351. cache="$WISOTOOL_CACHE/$1"
  352. mkdir -p "$cache"
  353. if test ! -s "$cache/$file" && test -f "$cache/$file"
  354. then
  355. # zero size - bad download?
  356. rm "$cache/$file"
  357. fi
  358. if test "$nosizecheck" != "" || test ! -f "$cache/$file" || test "$WISOTOOL_CONTINUE_DOWNLOAD"
  359. then
  360. cd "$cache"
  361. # Mac folks tend to have curl rather than wget
  362. # On Mac, 'which' doesn't return good exit status
  363. # Need to jam in --header "Accept-Encoding: gzip,deflate" else
  364. # redhat.com decompresses liberation-fonts.tar.gz!
  365. echo Downloading $2
  366. if [ -x "`which wget 2>/dev/null`" ]
  367. then
  368. # Use -nd to insulate ourselves from people who set -x in WGETRC
  369. # [*] --retry-connrefused works around the broken sf.net mirroring
  370. # system when downloading corefonts
  371. # [*] --read-timeout is useful on the adobe server that doesn't
  372. # close the connection unless you tell it to (control-C or closing
  373. # the socket)
  374. # Disable retries for gog.com (which requires higher level retries)
  375. wget -O "$file" -nd -c --read-timeout=300 --tries=1 --retry-connrefused --header "Accept-Encoding: gzip,deflate" ${5:+--load-cookies "$5"} "$2"
  376. else
  377. # curl doesn't get filename from the location given by the server!
  378. # fortunately, we know it
  379. curl -L -o "$file" -C - --header "Accept-Encoding: gzip,deflate" ${5:+--cookie "$5"} "$2"
  380. fi
  381. if test $? != 0
  382. then
  383. test -f "$file" && rm "$file"
  384. die "Downloading $2 failed"
  385. fi
  386. # Need to decompress .exe's that are compressed, else cygwin fails
  387. # Only affects cygwin, so don't barf if 'file' not installed
  388. FILE=`which file 2>/dev/null`
  389. case $FILE-$file in
  390. /*-*.exe)
  391. case `file $file` in
  392. *gzip*) mv $file $file.gz; gunzip < $file.gz > $file;;
  393. esac
  394. esac
  395. # On cygwin, .exe's must be marked +x
  396. case $file in
  397. *.exe) chmod +x $file ;;
  398. esac
  399. cd "$olddir"
  400. if [ "$3"x != ""x ]
  401. then
  402. verify_sha1sum $3 "$cache/$file"
  403. fi
  404. fi
  405. }
  406. set_winver() {
  407. echo "Setting Windows version to $1"
  408. cat > "$WISOTOOL_TMP"/set-winver.reg <<_EOF_
  409. REGEDIT4
  410. [HKEY_CURRENT_USER\Software\Wine]
  411. "Version"="$1"
  412. _EOF_
  413. try_regedit "$WISOTOOL_TMP_WIN"\\set-winver.reg
  414. }
  415. set_app_winver() {
  416. app="$1"
  417. version="$2"
  418. echo "Setting $app to $version mode"
  419. (
  420. echo REGEDIT4
  421. echo ""
  422. echo "[HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\$app]"
  423. echo "\"Version\"=\"$version\""
  424. ) > "$WISOTOOL_TMP"/set-winver.reg
  425. try_regedit "$WISOTOOL_TMP_WIN"\\set-winver.reg
  426. rm "$WISOTOOL_TMP"/set-winver.reg
  427. }
  428. load_vcdmount()
  429. {
  430. if test "$WINE" != ""
  431. then
  432. return
  433. fi
  434. # Call only on real Windows.
  435. # Sets VCD_DIR and ISO_MOUNT_ROOT
  436. # The only free mount tool I know for Windows Vista is Virtual CloneDrive,
  437. # which can be downloaded at
  438. # http://www.slysoft.com/en/virtual-clonedrive.html
  439. # FIXME: actually install it here
  440. # Locate vcdmount.exe.
  441. VCD_DIR="Elaborate Bytes/VirtualCloneDrive"
  442. if test ! -x "$programfilesdir_unix/$VCD_DIR/vcdmount.exe" && test ! -x "$programfilesdir_x86_unix/$VCD_DIR/vcdmount.exe"
  443. then
  444. warn "Installing Virtual CloneDrive"
  445. download . http://static.slysoft.com/SetupVirtualCloneDrive.exe
  446. # have to use cmd else vista won't let cygwin run .exe's?
  447. chmod +x "$WISOTOOL_CACHE"/SetupVirtualCloneDrive.exe
  448. cd "$WISOTOOL_CACHE"
  449. cmd /c SetupVirtualCloneDrive.exe
  450. cd "$olddir"
  451. fi
  452. if test -x "$programfilesdir_unix/$VCD_DIR/vcdmount.exe"
  453. then
  454. VCD_DIR="$programfilesdir_unix/$VCD_DIR"
  455. elif test -x "$programfilesdir_x86_unix/$VCD_DIR/vcdmount.exe"
  456. then
  457. VCD_DIR="$programfilesdir_x86_unix/$VCD_DIR"
  458. else
  459. die "can't find Virtual CloneDrive?"
  460. fi
  461. # FIXME: Use WMI to locate the drive named
  462. # "ELBY CLONEDRIVE..." using WMI as described in
  463. # http://delphihaven.wordpress.com/2009/07/05/using-wmi-to-get-a-drive-friendly-name/
  464. }
  465. iso_mount()
  466. {
  467. my_img="$1"
  468. iso_umount
  469. # FIXME: Should we check somehow that the user put in the right disk?
  470. if [ ! -f "$my_img" ]
  471. then
  472. warn "You don't seem to have an iso in $WISOTOOL_CACHE/$PACKAGE. Please insert the disk so I can prepare one for you."
  473. load_iso dd
  474. fi
  475. if test "$WINE" = ""
  476. then
  477. load_vcdmount
  478. my_img_win="`$XXXPATH -w $my_img | tr '\012' ' ' | sed 's/ $//'`"
  479. cd "$VCD_DIR"
  480. try vcdmount.exe /l=$letter "$my_img_win"
  481. cd "$olddir"
  482. tries=0
  483. while test $tries -lt 20
  484. do
  485. for ISO_MOUNT_LETTER in e f g h i j k
  486. do
  487. echo "$WISOTOOL_MOUNT_LETTER_IGNORE" | grep -q "$ISO_MOUNT_LETTER" && continue
  488. ISO_MOUNT_ROOT=/cygdrive/$ISO_MOUNT_LETTER
  489. if find $ISO_MOUNT_ROOT -iname 'setup*' -o -iname '*.exe' -o -iname '*.msi'
  490. then
  491. break 2
  492. fi
  493. done
  494. tries=`expr $tries + 1`
  495. echo "Waiting for mount to finish mounting"
  496. sleep 1
  497. done
  498. else
  499. # Linux
  500. # FIXME: use fuseiso when posible to avoid needing sudo
  501. case "$SUDO" in
  502. gksudo)
  503. try $SUDO "mkdir -p $ISO_MOUNT_ROOT"
  504. try $SUDO "mount -o ro,loop,uid=$USERID,unhide $my_img $ISO_MOUNT_ROOT"
  505. ;;
  506. *)
  507. try $SUDO mkdir -p $ISO_MOUNT_ROOT
  508. try $SUDO mount -o ro,loop,uid=$USERID,unhide "$my_img" $ISO_MOUNT_ROOT
  509. ;;
  510. esac
  511. echo "Mounting as drive ${ISO_MOUNT_LETTER}:"
  512. # Gotta provide a symlink to the raw disc, else installers that check volume names will fail
  513. # FIXME: one of these gives a warning frequently, possibly on second run
  514. ln -sf "$my_img" "$WINEPREFIX/dosdevices/${ISO_MOUNT_LETTER}::"
  515. ln -sf "$ISO_MOUNT_ROOT" "$WINEPREFIX/dosdevices/${ISO_MOUNT_LETTER}:"
  516. fi
  517. }
  518. iso_umount()
  519. {
  520. if test "$WINE" = ""
  521. then
  522. # Windows
  523. load_vcdmount
  524. cd "$VCD_DIR"
  525. try vcdmount.exe /u
  526. cd "$olddir"
  527. else
  528. echo "Running $SUDO umount $ISO_MOUNT_ROOT"
  529. case "$SUDO" in
  530. gksudo)
  531. # -l lazy unmount in case executable still running
  532. $SUDO "umount -l $ISO_MOUNT_ROOT"
  533. try $SUDO "rm -rf $ISO_MOUNT_ROOT"
  534. ;;
  535. *)
  536. $SUDO umount -l $ISO_MOUNT_ROOT
  537. try $SUDO rm -rf $ISO_MOUNT_ROOT
  538. ;;
  539. esac
  540. rm -f "$WINEPREFIX"/dosdevices/${ISO_MOUNT_LETTER}:
  541. rm -f "$WINEPREFIX"/dosdevices/${ISO_MOUNT_LETTER}::
  542. fi
  543. }
  544. mds_mount()
  545. {
  546. my_img="$1"
  547. mds_umount
  548. # FIXME: will vcdmount work for mds/mdf files on windows, or do we need to use Alcohol here as well?
  549. if test "$WINE" = ""
  550. then
  551. load_vcdmount
  552. my_img_win="`$XXXPATH -w $my_img | tr '\012' ' ' | sed 's/ $//'`"
  553. cd "$VCD_DIR"
  554. try vcdmount.exe /l=$letter "$my_img_win"
  555. cd "$olddir"
  556. while ! test -d "$ISO_MOUNT_ROOT"
  557. do
  558. echo "Waiting for mount to finish"
  559. sleep 1
  560. done
  561. else
  562. # Wine
  563. cdemu load 0 $my_img
  564. sleep 60
  565. # FIXME: This is messy, but AFAICT, there's no way in advance to know where the drive will be mounted,
  566. # since it depends on the cd/dvd title from the origial media, which is embedded in the mdf/mds file.
  567. # Unfortunately, cdemu doesn't give an easy way to determine it, so find it with a combination of
  568. # cdemu, mount, and grep
  569. device_name=`cdemu device-mapping | grep ^0 | awk '{print $2}'`
  570. ISO_MOUNT_ROOT=`mount -l | grep $device_name | awk '{print $3}'`
  571. echo "Mounting as drive ${ISO_MOUNT_LETTER}:"
  572. # Gotta provide a symlink to the raw disc, else installers that check volume names will fail
  573. # FIXME: one of these gives a warning frequently, possibly on second run
  574. ln -sf "$device_name" "$WINEPREFIX/dosdevices/${ISO_MOUNT_LETTER}::"
  575. ln -sf "$ISO_MOUNT_ROOT" "$WINEPREFIX/dosdevices/${ISO_MOUNT_LETTER}:"
  576. fi
  577. }
  578. mds_umount()
  579. {
  580. if test "$WINE" = ""
  581. then
  582. # Windows
  583. load_vcdmount
  584. cd "$VCD_DIR"
  585. try vcdmount.exe /u
  586. cd "$olddir"
  587. else
  588. if [ ! -x "`which cdemu 2>/dev/null`" ]
  589. then
  590. die "cdemu is not installed, can't mount .mds files!"
  591. fi
  592. # Initialize cdemu, if not already:
  593. # FIXME: Not sure this is 100% accurate...
  594. # FIXME: Should kill the cdemud session when done...
  595. pgrep cdemud
  596. cdemud_run=$?
  597. case $cdemud_run in
  598. 0) echo "cdemud is already running" ;;
  599. 1) echo "cdemud is not running, let's start one" ;
  600. ( cdemud -b session & ) ;
  601. sleep 60
  602. # FIXME: grep for "cdemu0: Daemon: error while performing ioctl" and die if it shows up ;
  603. ;;
  604. *) die "unknown error in cdemud_run" ;;
  605. esac
  606. # FIXME: just running 'cdemu unload 0' doesn't seem to unload, but running 'eject /media/foo' does?
  607. cdemu unload 0
  608. # Check that nothing is loaded there:
  609. img_name=`cdemu status | grep ^0 | awk '{print $3}'`
  610. if [ "$img_name" != "N/A" ]
  611. then
  612. echo "$img_name is mounted in cdemu, forcing an eject"
  613. device_name=`cdemu device-mapping | grep ^0 | awk '{print $2}'`
  614. ISO_MOUNT_ROOT=`mount -l | grep $device_name | awk '{print $3}'`
  615. # FIXME: Does this need sudo?
  616. eject $ISO_MOUNT_ROOT
  617. sleep 60 # Give devices time to settle
  618. fi
  619. rm -f "$WINEPREFIX"/dosdevices/${ISO_MOUNT_LETTER}:
  620. rm -f "$WINEPREFIX"/dosdevices/${ISO_MOUNT_LETTER}::
  621. fi
  622. }
  623. #----------------------------------------------------------------
  624. # Executed if user kills script
  625. cleanup()
  626. {
  627. echo "Caught signal, cleaning up."
  628. case "$pid" in
  629. "") ;;
  630. *) kill $pid ;;
  631. esac
  632. # TODO: merge this with cleanup code at end of script
  633. test "$WISOTOOL_CACHE_SYMLINK" && rm -f "$WISOTOOL_CACHE_SYMLINK"
  634. echo "Done cleanup, quitting."
  635. exit 1
  636. }
  637. # FIXME: add support for ripping mdf/mds with Alcohol 120%
  638. load_iso() {
  639. method=$1
  640. key="$2"
  641. die_if_user_not_dirowner "$WISOTOOL_CACHE"
  642. # Detect raw device
  643. dev=/dev/null
  644. for dev in /dev/cdrom /dev/sr0
  645. do
  646. test -b $dev && break
  647. done
  648. test $dev = /dev/null && die "can't find cd/dvd drive"
  649. # Hack for Gentoo - make sure we can read from the drive
  650. test -r $dev || sudo chmod 666 $dev
  651. # Wait for user to insert disc
  652. while ! dd if=$dev of=/dev/null count=1
  653. do
  654. sleep 1
  655. done
  656. # Copy disc to .iso file, display progress every 5 seconds
  657. # Use conv=noerror,sync to replace unreadable blocks with zeroes
  658. case $method in
  659. dd)
  660. dd if=$dev of="$WISOTOOL_CACHE"/temp.iso bs=2048 conv=noerror,sync &
  661. pid=$!
  662. ;;
  663. ddrescue)
  664. if test "`which ddrescue`" = ""
  665. then
  666. die "Please install ddrescue first."
  667. fi
  668. ddrescue -v -b 2048 $dev "$WISOTOOL_CACHE"/temp.iso &
  669. pid=$!
  670. ;;
  671. esac
  672. # Since we're running dd in the background, register a handler to kill it if user presses ^C
  673. trap cleanup 1 2 3 6
  674. while ps -p $pid > /dev/null 2>&1
  675. do
  676. sleep 5
  677. ls -l "$WISOTOOL_CACHE"/temp.iso
  678. done
  679. pid=""
  680. echo "Computing sha1sum..."
  681. # FIXME: can't handle spaces in "$WISOTOOL_CACHE"
  682. sum=`sha1sum "$WISOTOOL_CACHE"/temp.iso | awk '{print $1}'`
  683. echo "Sha1sum of iso is $sum"
  684. mv "$WISOTOOL_CACHE"/temp.iso "$WISOTOOL_CACHE"/$sum.iso
  685. if test "$key" != ""
  686. then
  687. # FIXME: in gui, prompt user for key if load= was chosen?
  688. echo "$key" > "$WISOTOOL_CACHE"/$sum.txt
  689. fi
  690. # Note: if you haven't written the verb for this disc yet,
  691. # the .iso won't be moved to the right directory.
  692. # So when writing a new verb, first run 'sh wisotool load',
  693. # then write just the verblist_add part (including sha1sum), then
  694. # run 'sh wisotool migrate' to move the iso into the right directory,
  695. # and then write the rest of the verb.
  696. migrate_files
  697. eject $dev || true # punt if eject not found (as on cygwin)
  698. }
  699. #----------------------------------------------------------------
  700. ahk_do() {
  701. load_autohotkey
  702. CR=`printf \\\\r`
  703. echo "$@" | sed "s/\$/$CR/" > "$WISOTOOL_TMP"/tmp.ahk
  704. $WINE "$programfilesdir_unix/AutoHotkey/AutoHotkey.exe" "$WISOTOOL_TMP_WIN"\\tmp.ahk
  705. }
  706. #----------------------------------------------------------------
  707. load_autohotkey()
  708. {
  709. test -f "$programfilesdir_unix/AutoHotkey/AutoHotkey.exe" || try sh "$WINETRICKS" -q autohotkey
  710. }
  711. #----------------------------------------------------------------
  712. load_gecko()
  713. {
  714. if ! test -f "$windir/system32/gecko/1.0.0/wine_gecko/nspr4.dll"
  715. then
  716. try sh "$WINETRICKS" gecko
  717. fi
  718. }
  719. #----------------------------------------------------------------
  720. verblist_init()
  721. {
  722. # Must call this before first call to verblist_add
  723. file_map="case \"\$1\" in "
  724. # Clear menu
  725. rm -f "$WISOTOOL_TMP"/menutext
  726. }
  727. verblist_finish()
  728. {
  729. : # Now a no-op
  730. }
  731. # Add a verb's description to the menu
  732. menu_add() {
  733. verbname=$1
  734. description="$2"
  735. printf " %-24s %s\n" $verbname "$description" >> "$WISOTOOL_TMP"/menutext
  736. }
  737. # Add a new verb
  738. verblist_add()
  739. {
  740. # Usage: verblist_add verbname "description" file1 file2 ...
  741. verbname=$1
  742. description="$2"
  743. case "$description" in
  744. *\'*) die "bug in call to verblist_add($verbname $description): you can't use apostrophes in game descriptions, it breaks the zenity menu. Please remove." ;;
  745. esac
  746. shift
  747. shift
  748. present=''
  749. test $verbname != 'help' && present=' [loaded]'
  750. for file
  751. do
  752. file_map="$file_map \"$file\") echo $verbname;; "
  753. if ! test -f "$WISOTOOL_CACHE/$verbname/$file"
  754. then
  755. present=''
  756. fi
  757. done
  758. menu_add $verbname "$description$present"
  759. }
  760. # Returns true if given verb is in the list
  761. verblist_is_legal_verb()
  762. {
  763. verb=$1
  764. awk '{print $1}' < "$WISOTOOL_TMP"/menutext > "$WISOTOOL_TMP"/verbs
  765. if grep "^$verb$" "$WISOTOOL_TMP"/verbs > /dev/null
  766. then
  767. return 0
  768. else
  769. return 1
  770. fi
  771. }
  772. # Given a file, output the verb it belongs to
  773. map_file_to_verb()
  774. {
  775. eval "$file_map esac"
  776. }
  777. # Output a list of the verbs for which the needed files are in the cache
  778. list_available_verbs()
  779. {
  780. # Find files in cache, output pathnames without top level directory.
  781. # Use "while read" rather than "for", since we have some filenames with spaces.
  782. (cd "$WISOTOOL_CACHE"; find . -type f) | sed 's,^./[^/]*/,,' | while read file
  783. do
  784. map_file_to_verb "$file"
  785. done | sort -u
  786. }
  787. # Move any/all *.iso or *.exe still at top level into the proper subdirectory
  788. migrate_files()
  789. {
  790. for file in "$WISOTOOL_CACHE"/*.iso "$WISOTOOL_CACHE"/*.exe
  791. do
  792. barefile=`basename $file`
  793. verb=`map_file_to_verb $barefile`
  794. if test "$verb" != ""
  795. then
  796. mkdir -p "$WISOTOOL_CACHE"/$verb
  797. movee=`echo $file | sed 's,\(\.iso\)$\|\(\.exe\)$,.*,g'`
  798. echo Moving $movee to $WISOTOOL_CACHE/$verb/
  799. mv $movee "$WISOTOOL_CACHE"/$verb/
  800. fi
  801. done
  802. }
  803. #----- Verbs ----------------------------------------------------
  804. verblist_init
  805. #----------------------------------------------------------------
  806. verblist_add 3dmark2000 "3DMark2000 (MadOnion.com, 2000) [download]" 3dmark2000_v11_100308.exe
  807. load_3dmark2000() {
  808. # http://www.futuremark.com/download/3dmark2000/
  809. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/3dmark2000_v11_100308.exe"
  810. then
  811. download $PACKAGE http://www.ocinside.de/download/3dmark2000_v11_100308.exe b0400d59cfd45d8c8893d3d4edc58b6285ee1502
  812. fi
  813. cd "$WISOTOOL_TMP"
  814. mkdir $PACKAGE
  815. cd $PACKAGE
  816. try unzip "$WISOTOOL_CACHE/$PACKAGE"/3dmark2000_v11_100308.exe
  817. ahk_do "
  818. SetTitleMatchMode, 2
  819. run Setup.exe
  820. WinWait Welcome
  821. ControlClick Button1 ; Next
  822. WinWait License
  823. ControlClick Button2 ; Yes
  824. ;WinWaitClose ahk_class #32770 ; License
  825. WinWait ahk_class #32770, Destination
  826. ControlClick Button1 ; Next
  827. ;WinWaitClose ahk_class #32770 ; Destination
  828. WinWait, Start
  829. ControlClick Button1 ; Next
  830. WinWait Registration
  831. ControlClick Button1 ; Next
  832. WinWait Complete
  833. ControlClick Button1 ; Unclick View Readme
  834. ControlClick Button4 ; Finish
  835. "
  836. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  837. ${programfilesdrive}:
  838. cd "$programfilesdir_x86_win\MadOnion.com\3DMark2000"
  839. REM possible wine cmd bug: "3dmark2000" aborts, but ".\3dmark2000" works
  840. .\3DMark2000
  841. __EOF__
  842. }
  843. #----------------------------------------------------------------
  844. verblist_add 3dmark2001 "3DMark2001 (MadOnion.com, 2001) [download]" 3dmark2001se_330_100308.exe
  845. load_3dmark2001() {
  846. # http://www.futuremark.com/download/3dmark2001/
  847. if ! test -f "$WISOTOOL_CACHE/$PACKAGE"/3dmark2001se_330_100308.exe
  848. then
  849. download $PACKAGE http://www.ocinside.de/download/3dmark2001se_330_100308.exe 643bacbcc1615bb4f46d3b045b1b8d78371a6b54
  850. fi
  851. cd "$WISOTOOL_CACHE/$PACKAGE"
  852. ahk_do "
  853. SetTitleMatchMode, 2
  854. run 3dmark2001se_330_100308.exe
  855. WinWait ahk_class #32770 ; welcome
  856. ControlClick Button2 ; Next
  857. sleep 5000
  858. WinWait ahk_class #32770 ; License
  859. ControlClick Button2 ; Next
  860. WinWait ahk_class #32770, Destination
  861. ControlClick Button1 ; Next
  862. WinWait ahk_class #32770, Start
  863. ControlClick Button1 ; Next
  864. WinWait,, Registration
  865. ControlClick Button2 ; Next
  866. WinWait,, Complete
  867. ControlClick Button1 ; Unclick View Readme
  868. ControlClick Button4 ; Finish
  869. "
  870. }
  871. #----------------------------------------------------------------
  872. verblist_add 3dmark03 "3D Mark 03 (Futuremark, 2003) [download]" 3DMark03_v360_1901.exe
  873. load_3dmark03() {
  874. # http://www.futuremark.com/benchmarks/3dmark03/download/
  875. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/3DMark03_v360_1901.exe"
  876. then
  877. download $PACKAGE http://www.bulletproofnerds.com/uploadedfiles/futuremark/3DMark03_v360_1901.exe 46a439101ddbbe3c9563b5e9651cb61b46ce0619
  878. fi
  879. cd "$WISOTOOL_CACHE/$PACKAGE"
  880. warn "Don't use mouse while this installer is running. Sorry..."
  881. # This old installer doesn't seem to be scriptable the usual way, so spray and pray.
  882. ahk_do "
  883. SetTitleMatchMode, 2
  884. run 3DMark03_v360_1901.exe
  885. Sleep 4000
  886. ; Welcome
  887. Send {Enter}
  888. Sleep 2000
  889. ; Accept license
  890. Send a
  891. Send {Enter}
  892. Sleep 2000
  893. ; Choose Destination
  894. Send {Enter}
  895. Sleep 2000
  896. ; Begin install
  897. Send {Enter}
  898. ; Wait for install to finish
  899. WinWait 3DMark03, Registration
  900. ; Purchase later
  901. Send {Tab}
  902. Send {Tab}
  903. Send {Enter}
  904. ; Uncheck readme
  905. Send {Space}
  906. Send {Tab}
  907. Send {Tab}
  908. Send {Enter}
  909. "
  910. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  911. ${programfilesdrive}:
  912. cd "$programfilesdir_x86_win\Futuremark\3DMark03"
  913. 3DMark03
  914. __EOF__
  915. }
  916. #----------------------------------------------------------------
  917. verblist_add 3dmark05 "3D Mark 05 (Futuremark, 2005) [download]" 3DMark05_v130_1901.exe
  918. load_3dmark05() {
  919. # http://www.futuremark.com/download/3dmark05/
  920. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/3DMark05_v130_1901.exe"
  921. then
  922. download $PACKAGE http://www.bulletproofnerds.com/uploadedfiles/futuremark/3DMark05_v130_1901.exe 8ad6bc2917e22edf5fc95d1fa96cc82515093fb2
  923. fi
  924. cd "$WISOTOOL_CACHE/$PACKAGE"
  925. ahk_do "
  926. run 3DMark05_v130_1901.exe
  927. WinWait ahk_class #32770, Welcome
  928. Send {Enter}
  929. WinWait, ahk_class #32770, License
  930. ControlClick Button1 ; Accept
  931. ControlClick Button4 ; Next
  932. WinWait, ahk_class #32770, Destination
  933. ControlClick Button1 ; Next
  934. WinWait, ahk_class #32770, Install
  935. ControlClick Button1 ; Install
  936. WinWait, ahk_class #32770, Purchase
  937. ControlClick Button4 ; Later
  938. WinWait, ahk_class #32770, Complete
  939. ControlClick Button1 ; Uncheck view readme
  940. ControlClick Button3 ; Finish
  941. "
  942. ARGS=""
  943. if workaround_wine_bug 22392
  944. then
  945. warn "You must run the app with the -nosysteminfo option to avoid a crash on startup"
  946. ARGS="-nosysteminfo"
  947. fi
  948. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  949. ${programfilesdrive}:
  950. cd "$programfilesdir_x86_win\Futuremark\3DMark05"
  951. 3DMark05 $ARGS
  952. __EOF__
  953. }
  954. #----------------------------------------------------------------
  955. verblist_add 3dmark06 "3D Mark 06 (Futuremark, 2006) [download]" 3DMark06_v120_1901.exe
  956. load_3dmark06() {
  957. # http://www.futuremark.com/benchmarks/3dmark06/download/
  958. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/3DMark06_v120_1901.exe"
  959. then
  960. download $PACKAGE http://www.bulletproofnerds.com/uploadedfiles/futuremark/3DMark06_v120_1901.exe 2e4a52d5b0f7caebd7b4407dfa9e258ac623b5dd
  961. fi
  962. cd "$WISOTOOL_CACHE/$PACKAGE"
  963. ahk_do "
  964. run 3DMark06_v120_1901.exe
  965. WinWait ahk_class #32770, Welcome
  966. Send {Enter}
  967. WinWait, ahk_class #32770, License
  968. ControlClick Button1 ; Accept
  969. ControlClick Button4 ; Next
  970. WinWait, ahk_class #32770, Destination
  971. ControlClick Button1 ; Next
  972. WinWait, ahk_class #32770, Install
  973. ControlClick Button1 ; Install
  974. WinWait ahk_class OpenAL Installer
  975. ControlClick Button2 ; OK
  976. WinWait ahk_class #32770
  977. ControlClick Button1 ; OK
  978. WinWait, ahk_class #32770, Purchase
  979. ControlClick Button4 ; Later
  980. WinWait, ahk_class #32770, Complete
  981. ControlClick Button1 ; Uncheck view readme
  982. ControlClick Button3 ; Finish
  983. WinWaitClose, ahk_class #32770, Complete
  984. "
  985. if workaround_wine_bug 9210
  986. then
  987. warn "You may need to apply the patch in http://bugs.winehq.org/show_bug.cgi?id=9210 to fix pCaps->MaxPointSize, or the benchmark will warn that shader model 2.0 is not present, and refuse to run."
  988. fi
  989. if workaround_wine_bug 22393
  990. then
  991. # "Demo" button doesn't work without this
  992. sh "$WINETRICKS" -q d3dx9_28 d3dx9_36
  993. fi
  994. ARGS=""
  995. if workaround_wine_bug 22392
  996. then
  997. warn "You must run the app with the -nosysteminfo option to avoid a crash on startup"
  998. ARGS="-nosysteminfo"
  999. fi
  1000. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1001. ${programfilesdrive}:
  1002. cd "$programfilesdir_x86_win\Futuremark\3DMark06"
  1003. 3DMark06 $ARGS
  1004. __EOF__
  1005. }
  1006. #----------------------------------------------------------------
  1007. verblist_add algodoo_demo "Algodoo Demo (Algoryx, 2009) [download]" Algodoo_1_7_1-Win32.exe
  1008. load_algodoo_demo() {
  1009. download $PACKAGE http://www.algodoo.com/download/Algodoo_1_7_1-Win32.exe caa73e73669a8787652a6bed123bbe2682152f12
  1010. cd "$WISOTOOL_CACHE/$PACKAGE"
  1011. ahk_do "
  1012. run, Algodoo_1_7_1-Win32.exe
  1013. SetTitleMatchMode, 2
  1014. winwait, Algodoo
  1015. send {Enter}
  1016. winwait, Algodoo, License
  1017. send {Tab}a{Space}{Enter}
  1018. winwait, Algodoo, Destination
  1019. send {Enter}
  1020. winwait, Algodoo, shortcuts
  1021. send {Enter}
  1022. winwait, Algodoo, Select Additional Tasks
  1023. send {Enter}
  1024. winwait, Algodoo, Ready to Install
  1025. send {Enter}
  1026. winwait, Algodoo, Completing
  1027. send {Space}{Tab}{Space}{Tab}{Space}{Enter} ; decline to run app or view tutorials
  1028. "
  1029. cd "$olddir"
  1030. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1031. ${programfilesdrive}:
  1032. cd "$programfilesdir_x86_win\\Algodoo"
  1033. algodoo
  1034. __EOF__
  1035. }
  1036. #----------------------------------------------------------------
  1037. verblist_add msaoe_demo "Age of Empires Demo (Microsoft, 1997) [download]" MSAoE.exe
  1038. load_msaoe_demo() {
  1039. download $PACKAGE http://download.microsoft.com/download/aoe/Trial/1.0/WIN98/EN-US/MSAoE.exe 23630a65ce4133038107f3175f8fc54a914bc2f3
  1040. cd "$WISOTOOL_CACHE/$PACKAGE"
  1041. ahk_do "
  1042. run, MSAoE.exe
  1043. SetTitleMatchMode, 2
  1044. winwait, Microsoft Age of Empires Trial Version
  1045. ControlClick, Button1
  1046. winwait, End User License Agreement
  1047. ControlClick, Button1
  1048. winwait, Microsoft Age of Empires Trial Version, Setup will install
  1049. ControlClick Button2
  1050. winwait, Microsoft Age of Empires Trial Version, Setup has successfully
  1051. ControlClick Button1
  1052. "
  1053. cd "$olddir"
  1054. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1055. ${programfilesdrive}:
  1056. cd "$programfilesdir_x86_win\Microsoft Games\Age of Empires Trial"
  1057. empires
  1058. __EOF__
  1059. }
  1060. #----------------------------------------------------------------
  1061. verblist_add aoe3_demo "Age of Empires III (Microsoft, 2005) [download]" aoe3trial.exe
  1062. load_aoe3_demo() {
  1063. download $PACKAGE "http://download.microsoft.com/download/a/5/2/a525997e-8423-435b-b694-08118d235064/aoe3trial.exe" \
  1064. 2b0a123243092d79f910db5691d99d469f7c17c3
  1065. if workaround_wine_bug 24897
  1066. then
  1067. try sh "$WINETRICKS" -q msxml4
  1068. fi
  1069. cd "$WISOTOOL_CACHE/$PACKAGE"
  1070. ahk_do "
  1071. SetTitleMatchMode, 2
  1072. run aoe3trial.exe
  1073. WinWait,Empires,Welcome
  1074. Sleep 500
  1075. ControlClick Button1 ; Next
  1076. WinWait,Empires,Please
  1077. Sleep 500
  1078. ControlClick Button4 ; Next
  1079. WinWait,Empires,Complete
  1080. Sleep 500
  1081. ControlClick Button4 ; Finish
  1082. WinWaitClose
  1083. "
  1084. if workaround_wine_bug 24911
  1085. then
  1086. # On some systems, only quartz is needed?
  1087. # appdb says that l3codecx is also needed?
  1088. try sh "$WINETRICKS" -q devenum dmsynth quartz
  1089. fi
  1090. if workaround_wine_bug 24912
  1091. then
  1092. # kill off lingering installer
  1093. ahk_do "
  1094. SetTitleMatchMode, 2
  1095. WinKill,Empires
  1096. "
  1097. # or should we just do wineserver -k, like fable_tlc does?
  1098. PID=`ps augxw | grep IDriver | grep -v grep | awk '{print $2}'`
  1099. kill $PID
  1100. fi
  1101. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1102. ${programfilesdrive}:
  1103. cd "$programfilesdir_x86_win\\Microsoft Games\\Age of Empires III Trial"
  1104. age3.exe
  1105. __EOF__
  1106. }
  1107. #----------------------------------------------------------------
  1108. verblist_add anno1404_demo "Anno 1404 Demo (Ubisoft, 2009) [download]" DawnofDiscovery_Demo_US_2009_06_15_18_22.zip
  1109. load_anno1404_demo() {
  1110. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/DawnofDiscovery_Demo_US_2009_06_15_18_22.zip"
  1111. then
  1112. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  1113. die "Please download demo from http://www.filefront.com/thankyou.php?f=13908918 and place it in $WISOTOOL_CACHE/$PACKAGE"
  1114. fi
  1115. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  1116. cd "$WISOTOOL_TMP/$PACKAGE"
  1117. try unzip "$WISOTOOL_CACHE/$PACKAGE"/DawnofDiscovery_Demo_US_2009_06_15_18_22.zip
  1118. try cd "Anno1404_Demo_US_2009_06_15_18_22"
  1119. ahk_do "
  1120. run, setup.exe
  1121. SetTitleMatchMode, 2
  1122. winwait, , Welcome to the InstallShield Wizard for Dawn of Discovery (Demo)
  1123. ControlClick, Button3 ; Next
  1124. winwait, , Licence Agreement
  1125. ControlClick, Button2 ; Accept
  1126. ControlClick, Button6 ; Next
  1127. winwait, , Setup Type
  1128. ControlClick Button4 ; Next
  1129. winwait, , Select Options
  1130. ControlClick Button6 ; Next
  1131. winwait, Question
  1132. ControlClick Button2 ; No
  1133. winwait, , InstallShield Wizard completed
  1134. Controlclick Button4 ; Finish
  1135. "
  1136. if workaround_wine_bug 22762
  1137. then
  1138. if test -f "$DRIVE_C/users/$USERNAME/Application Data/Ubisoft/Anno1404Demo/Config/Engine.ini"
  1139. then
  1140. cd "$DRIVE_C/users/$USERNAME/Application Data/Ubisoft/Anno1404Demo/Config/"
  1141. mv Engine.ini oldEngine.ini
  1142. sed '/LanguageTAG/s,eng,usa,;
  1143. /DirectXVersion/s,0,9,' oldEngine.ini > Engine.ini
  1144. else
  1145. mkdir -p "$DRIVE_C/users/$USERNAME/Application Data/Ubisoft/Anno1404Demo/Config/"
  1146. cat > "$DRIVE_C/users/$USERNAME/Application Data/Ubisoft/Anno1404Demo/Config/Engine.ini" <<__EOF__
  1147. <InitFile>
  1148. <DirectXVersion>9</DirectXVersion>
  1149. <LanguageTAG>usa</LanguageTAG>
  1150. </InitFile>
  1151. __EOF__
  1152. fi
  1153. fi
  1154. cd "$olddir"
  1155. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1156. ${programfilesdrive}:
  1157. cd "$programfilesdir_x86_win\\Ubisoft\\Related Designs\\Dawn of Discovery (Demo)"
  1158. Anno4.exe
  1159. __EOF__
  1160. }
  1161. #----------------------------------------------------------------
  1162. verblist_add assassinscreed "Assassins Creed (Ubisoft, 2008)" a62112860423b32bf3ea77df6f5fe0b60c772de2.iso
  1163. load_assassinscreed() {
  1164. if workaround_wine_bug 22392
  1165. then
  1166. # Don't hang at a dialog box when Detection crashes
  1167. sh "$WINETRICKS" nocrashdialog
  1168. fi
  1169. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/a62112860423b32bf3ea77df6f5fe0b60c772de2.iso
  1170. ahk_do "
  1171. run ${ISO_MOUNT_LETTER}:setup.exe
  1172. SetTitleMatchMode, 2
  1173. winwait, InstallShield Wizard, Language
  1174. ; wine bug? - clicking on Next does nothing until you move the mouse over the installer window
  1175. ;ControlClick Next, InstallShield Wizard
  1176. Send {Enter}
  1177. winwait, InstallShield Wizard, Welcome
  1178. ControlClick Next, InstallShield Wizard
  1179. winwait, InstallShield Wizard, License
  1180. sleep 500
  1181. send a{Enter}
  1182. winwait, InstallShield Wizard, begin
  1183. sleep 1000
  1184. ControlClick &Install, InstallShield Wizard
  1185. winwait, Product Registration, register
  1186. ControlClick Never, Product Registration
  1187. ControlClick Button1, Product Registration
  1188. winwait, InstallShield Wizard, inish
  1189. send {Enter}
  1190. "
  1191. iso_umount
  1192. # Should run AssassinsCreed_Launcher.exe, but that fails on Wine
  1193. # Should give option to run AssassinsCreed_Dx10.exe, but that fails on Wine
  1194. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1195. ${programfilesdrive}:
  1196. cd "$programfilesdir_x86_win\Ubisoft\Assassin's Creed"
  1197. AssassinsCreed_Dx9.exe
  1198. __EOF__
  1199. }
  1200. #----------------------------------------------------------------
  1201. verblist_add avatar_demo "James Camerons Avatar The Game Demo (Ubisoft, 2009) [download]" Avatar_The_Game_Demo.exe
  1202. load_avatar_demo()
  1203. {
  1204. download $PACKAGE http://gamedaily.newaol.com/pub/Avatar_The_Game_Demo.exe 8d8e4c82312962706bd2620406d592db4f0fa9c1
  1205. if workaround_wine_bug 23094
  1206. then
  1207. try sh "$WINETRICKS" -q vcrun2005
  1208. fi
  1209. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  1210. cd "$WISOTOOL_TMP/$PACKAGE"
  1211. try_unrar x "$WISOTOOL_CACHE/$PACKAGE/Avatar_The_Game_Demo.exe"
  1212. ahk_do "
  1213. SetTitleMatchMode, 2
  1214. run, setup.exe
  1215. winwait, Language
  1216. controlclick, Button1
  1217. winwait, AVATAR, Welcome
  1218. controlclick, Button1
  1219. winwait, AVATAR, License
  1220. controlclick, Button5
  1221. controlclick, Button2
  1222. winwait, AVATAR, setup type
  1223. controlclick, Button2
  1224. ; Strange CRC error workaround. Will check this out. Stay tuned.
  1225. loop
  1226. {
  1227. ifwinexist, CRC Error
  1228. {
  1229. winactivate, CRC Error
  1230. controlclick, Button3, CRC Error ; ignore
  1231. }
  1232. ifwinexist, AVATAR, Complete
  1233. {
  1234. controlclick, Button4
  1235. break
  1236. }
  1237. sleep 1000
  1238. }
  1239. "
  1240. cd "$olddir"
  1241. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1242. ${programfilesdrive}:
  1243. cd "$programfilesdir_x86_win\Ubisoft\Demo\James Cameron's AVATAR - THE GAME (Demo)\bin"
  1244. "AvatarDemo.exe"
  1245. __EOF__
  1246. }
  1247. #----------------------------------------------------------------
  1248. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=408
  1249. verblist_add baldursgate2 "Baldurs Gate 2 - Shadows of Amn (Bioware, 2000)" \
  1250. cc9359dce1a7be6c64bb6f8e6dea6d14d4a5f716.iso \
  1251. 429872605dad10433c3c581a1c11eba4d0988c46.iso \
  1252. a6d18fcd7d16ddafbda7aa028b117566b1e09d2a.iso \
  1253. 94ed41768949c89a1a6479305f00a9cee1d2dcd5.iso
  1254. load_baldursgate2() {
  1255. # Possible wine bug: cd is still in use, even if wine eject is used. Workaround it by
  1256. # copying all the cd's to a directory, and running the installer from there.
  1257. # You still need the first CD mounted at the end, however...
  1258. if test ! -d "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1259. then
  1260. try mkdir -p "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1261. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/cc9359dce1a7be6c64bb6f8e6dea6d14d4a5f716.iso
  1262. sleep 5
  1263. try cp -r "$ISO_MOUNT_ROOT"/* "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1264. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/429872605dad10433c3c581a1c11eba4d0988c46.iso
  1265. sleep 5
  1266. try cp -r "$ISO_MOUNT_ROOT"/* "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1267. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/a6d18fcd7d16ddafbda7aa028b117566b1e09d2a.iso
  1268. sleep 5
  1269. try cp -r "$ISO_MOUNT_ROOT"/* "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1270. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/94ed41768949c89a1a6479305f00a9cee1d2dcd5.iso
  1271. sleep 5
  1272. try cp -r "$ISO_MOUNT_ROOT"/* "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1273. fi
  1274. # Will perform a full install, so no cd's needed
  1275. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/cc9359dce1a7be6c64bb6f8e6dea6d14d4a5f716.iso
  1276. ahk_do "
  1277. SetTitleMatchMode, 2
  1278. run "$WISOTOOL_TMP"/$PACKAGE/tempcd/setup.exe
  1279. winwait, Baldur's Gate, Welcome to the Baldur's Gate
  1280. sleep 1000
  1281. ControlClick, Button1, Baldur's Gate, Welcome to the Baldur's Gate
  1282. winwait, Baldur's Gate, Please read the following License Agreement
  1283. sleep 1000
  1284. ControlClick, Button2, Baldur's Gate, Please read the following License Agreement
  1285. winwait, Baldur's Gate, Setup will install Baldur's Gate
  1286. sleep 1000
  1287. ControlClick, Button1, Baldur's Gate, Setup will install Baldur's Gate
  1288. winwait, Baldur's Gate, Click the type of Setup you prefer
  1289. sleep 1000
  1290. ControlClick, Listbox1, Baldur's Gate, Click the type of Setup you prefer
  1291. send {F}
  1292. ControlClick, Button2, Baldur's Gate, Click the type of Setup you prefer
  1293. winwait, Baldur's Gate, Setup will add program icons
  1294. sleep 1000
  1295. ControlClick, Button2, Baldur's Gate, Setup will add program icons
  1296. winwait, Setup Needs The Next Disk
  1297. sleep 1000
  1298. Send {Home}
  1299. Send {Shift down}
  1300. Send {End}
  1301. Send I:{Enter}
  1302. winwait, Information
  1303. sleep 1000
  1304. ControlClick, Button1, Information
  1305. Sleep 5000
  1306. process, wait, Promo.exe, 5
  1307. promopid = %ErrorLevel%
  1308. winclose, ahk_pid %promopid%
  1309. winwait, Baldur's Gate, Setup has finished installing
  1310. sleep 1000
  1311. ControlClick, Button4, Baldur's Gate, Setup has finished installing
  1312. "
  1313. try chmod +w -R "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1314. try rm -rf "$WISOTOOL_TMP"/$PACKAGE/tempcd
  1315. # Install latest patch
  1316. download baldursgate2 http://downloads.bioware.com/baldursgate2/Baldur%27sGateII-ShadowsofAmnPatchENGLISH.exe 4706c0dc1e282bae14946c87a38e2781f89ebdc4
  1317. # AHK doesn't like its name...
  1318. try cp -f "$WISOTOOL_CACHE/baldursgate2/Baldur%27sGateII-ShadowsofAmnPatchENGLISH.exe" "$WISOTOOL_TMP/baldurs_gate_2_patch.exe"
  1319. cd "$WISOTOOL_TMP"
  1320. ahk_do "
  1321. SetTitleMatchMode, 2
  1322. run, baldurs_gate_2_patch.exe
  1323. winwait InstallShield Wizard, Welcome to the InstallShield Wizard
  1324. sleep 1000
  1325. ControlClick Button1, InstallShield Wizard, Welcome to the InstallShield Wizard
  1326. winwait InstallShield Wizard, InstallShield Wizard Complete
  1327. sleep 1000
  1328. ControlClick Button4, InstallShield Wizard, InstallShield Wizard Complete
  1329. exit"
  1330. cd -
  1331. try rm "$WISOTOOL_TMP/baldurs_gate_2_patch.exe"
  1332. if workaround_wine_bug 22482
  1333. then
  1334. sh "$WINETRICKS" -q ddr=opengl
  1335. warn "Enabling 3d acceleration in BGConfig.exe will improve performance."
  1336. fi
  1337. if workaround_wine_bug 22493
  1338. then
  1339. warn "Enabling 3d acceleration in BGConfig.exe will improve performance."
  1340. fi
  1341. if test ! "$WINE" = ""
  1342. then
  1343. warn "Until wine bug 22511 is fixed, you should use a virtual desktop, or baldur's gate will only take up part of your screen in full screen mode."
  1344. fi
  1345. }
  1346. #----------------------------------------------------------------
  1347. verblist_add batman_arkham_asylum_demo "Batman: Arkham Asylum Demo (Warner/Eidos/Enix 2009) (size: 2.0 GB)[download]" BMDemo_installer.exe
  1348. load_batman_arkham_asylum_demo() {
  1349. download $PACKAGE http://cdn2.netops.eidosinteractive.com/batmanarkhamasylum/BMDemo_installer.exe 7582c87cc3983016c7fbf2104999df087ecce7a6
  1350. cd "$WISOTOOL_CACHE/$PACKAGE"
  1351. ahk_do "
  1352. run BMDemo_installer.exe
  1353. SetTitleMatchMode, 2
  1354. WinWait, Batman: Arkham Asylum Demo, Select Language
  1355. WinActivate
  1356. Send {Enter}
  1357. WinWait, Batman: Arkham Asylum Demo, Install Demo
  1358. WinActivate
  1359. Send {Tab}
  1360. Send {Enter}
  1361. WinWait, Batman: Arkham Asylum Demo, Welcome
  1362. WinActivate
  1363. Send {Enter}
  1364. WinWait, Batman: Arkham Asylum Demo, License Agreement
  1365. WinActivate
  1366. Send +!a
  1367. Send {Enter}
  1368. Loop {
  1369. Sleep (1000)
  1370. IfWinExist, Batman: Arkham Asylum Demo, System Check Results
  1371. {
  1372. Sleep (300)
  1373. WinActivate
  1374. Send {Enter}
  1375. break
  1376. }
  1377. IfWinExist, Batman: Arkham Asylum Demo, Your computer fails to meet
  1378. {
  1379. Sleep (300)
  1380. Send +!o
  1381. }
  1382. IfWinExist, Batman: Arkham Asylum Demo, Setup has detected
  1383. {
  1384. Sleep (300)
  1385. Send +!o ; I'm not sure about this keystroke sequence
  1386. }
  1387. }
  1388. WinWait, Batman: Arkham Asylum Demo, Setup Type
  1389. WinActivate
  1390. Send {Enter}
  1391. Loop
  1392. {
  1393. IfWinExist, NVIDIA, license
  1394. {
  1395. Sleep (500)
  1396. WinActivate
  1397. Send +!a ; license agreement
  1398. Send +!n ; next
  1399. }
  1400. IfWinExist, NVIDIA, finish
  1401. {
  1402. WinActivate
  1403. Send +!f ; finish
  1404. }
  1405. IfWinExist, DXSETUP.exe - Error
  1406. {
  1407. Send {Enter} ; DirectX9 Redistributable trying to install managed components, failing, but that's ok
  1408. }
  1409. IfWinExist, Fatal Error
  1410. {
  1411. Send {Enter} ; PhysX installer exploded because wsh not installed, or dotnet30 not installed, probably ok
  1412. }
  1413. Process, Exist, BmLauncher.exe ; BmLauncher automatically starts after installation finished.
  1414. retVal = %ErrorLevel%
  1415. if retVal != 0
  1416. {
  1417. Process, Close, BmLauncher.exe ; kill BmLauncher
  1418. break
  1419. }
  1420. Sleep (2000)
  1421. }
  1422. "
  1423. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1424. ${programfilesdrive}:
  1425. cd "$programfilesdir_x86_win\\Eidos\\Batman Arkham Asylum Demo\\Binaries"
  1426. ShippingPC-BmGame.exe
  1427. __EOF__
  1428. if workaround_wine_bug 6971
  1429. then
  1430. warn "The mouse is still broken in wine, but winetricks mwo=force will make the game much more playable, try it."
  1431. fi
  1432. if workaround_wine_bug 20651
  1433. then
  1434. download $PACKAGE http://www.glio.net/UserEngine.ini
  1435. download $PACKAGE http://www.glio.net/UserInput.ini
  1436. download $PACKAGE http://www.glio.net/UserGame.ini
  1437. configdir="$DRIVE_C/users/$USERNAME/My Documents/Eidos/Batman Arkham Asylum Demo/BmGame/Config"
  1438. mkdir -p "$configdir"
  1439. cp "$WISOTOOL_CACHE/$PACKAGE"/*.ini "$configdir"
  1440. fi
  1441. if workaround_wine_bug 24471
  1442. then
  1443. sh "$WINETRICKS" mmdevapi=disabled
  1444. fi
  1445. }
  1446. #--------------------------------------------------------------------------------------
  1447. # Sadly, the SHA1SUM varies!
  1448. # FIXME: change load function to call it by its volume label instead; right now you have to rename it manually.
  1449. verblist_add bfbc2 "Battlefield Bad Company 2 (EA, 2010)" \
  1450. BFBC2.iso
  1451. load_bfbc2() {
  1452. exedir="$programfilesdir_x86_unix/Electronic Arts/Battlefield Bad Company 2"
  1453. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/BFBC2.iso
  1454. BFBC2_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/BFBC2.txt | tr -d -`
  1455. ahk_do "
  1456. SetTitleMatchMode, 2
  1457. run ${ISO_MOUNT_LETTER}:setup.exe
  1458. winwait, Bad Company, English
  1459. ControlClick, Next, Bad Company
  1460. winwait, Bad Company, Registration Code
  1461. send {RAW}$BFBC2_KEY
  1462. ControlClick, Next, Bad Company, Registration Code
  1463. winwait, Bad Company, Setup Wizard will install
  1464. ControlClick, Button1, Bad Company, Setup Wizard
  1465. winwait, Bad Company, License Agreement
  1466. ControlClick, Button1, Bad Company, License Agreement
  1467. ControlClick, Button3, Bad Company, License Agreement
  1468. winwait, Bad Company, End-User License Agreement
  1469. ControlClick, Button1, Bad Company, License Agreement
  1470. ControlClick, Button3, Bad Company, License Agreement
  1471. winwait, Bad Company, Destination Folder
  1472. ControlClick, Button1, Bad Company, Destination Folder
  1473. winwait, Bad Company, Ready to install
  1474. ControlClick, Install, Bad Company, Ready to install
  1475. winwait, Authenticate Battlefield
  1476. ControlClick, Disc authentication, Authenticate Battlefield
  1477. ControlClick, Button4, Authenticate Battlefield
  1478. winwait, Bad Company, PunkBuster
  1479. ControlClick, Button4, Bad Company, PunkBuster
  1480. ControlClick, Finish, Bad Company
  1481. "
  1482. iso_umount
  1483. warn "Patching to latest version..."
  1484. cd "$exedir"
  1485. ahk_do "
  1486. SetTitleMatchMode, 2
  1487. run, BFBC2Updater.exe
  1488. winwait, Updater, have to update to
  1489. ControlClick, Yes, Updater, have to update
  1490. winwait, Updater, successfully updated
  1491. ControlClick,No, Updater, successfully updated
  1492. "
  1493. if workaround_wine_bug 22762
  1494. then
  1495. cd "$DRIVE_C/users/$USERNAME/My Documents"
  1496. if test -f BFBC2/settings.ini
  1497. then
  1498. mv BFBC2/settings.ini BFBC2/oldsettings.ini
  1499. sed 's,DxVersion=auto,DxVersion=9,;
  1500. s,Fullscreen=true,Fullscreen=false,' BFBC2/oldsettings.ini > BFBC2/settings.ini
  1501. else
  1502. mkdir -p BFBC2
  1503. echo "[Graphics]" > BFBC2/settings.ini
  1504. echo "DxVersion=9" >> BFBC2/settings.ini
  1505. fi
  1506. fi
  1507. cd "$olddir"
  1508. if workaround_wine_bug 22961
  1509. then
  1510. warn "If you get a Securom 'No CD/DVD error', check your mount settings. See http://bugs.winehq.org/show_bug.cgi?id=22961 for more info."
  1511. fi
  1512. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1513. ${programfilesdrive}:
  1514. cd "$programfilesdir_x86_win\\Electronic Arts\\Battlefield Bad Company 2"
  1515. BFBC2Game.exe
  1516. __EOF__
  1517. }
  1518. #----------------------------------------------------------------
  1519. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=9320
  1520. # Fails to install with an iso, need to use an mdf/mds from Alcohol 120% on Windows
  1521. # FIXME: mds/mdf files have different sha1sum's, and depending on the rip settings, the mds might as well?
  1522. # Sha1sum's:
  1523. # plain iso, from dd: deaf00ebee6e73aecf38f704c3f516008a68d888
  1524. # mds: 391042ea19b4eace5d532dbade10931ebbc4def6
  1525. # mdf: deaf00ebee6e73aecf38f704c3f516008a68d888
  1526. verblist_add bioshock "Bioshock (2K Games, 2007)" \
  1527. 391042ea19b4eace5d532dbade10931ebbc4def6.mds \
  1528. deaf00ebee6e73aecf38f704c3f516008a68d888.iso
  1529. load_bioshock() {
  1530. # Bioshock needs MSVCP80.dll to run, which Wine doesn't have yet.
  1531. if workaround_wine_bug 22501
  1532. then
  1533. sh "$WINETRICKS" -q vcrun2005
  1534. fi
  1535. # If .iso is present, use it rather than the .mds (.mds is still flaky, maybe we should just get rid of mds support)
  1536. # FIXME: 'wisotool ls' only shows apps as loaded if all files present, so we need a way to
  1537. # tell it either iso or mds is ok.
  1538. if test -f "$WISOTOOL_CACHE"/$PACKAGE/deaf00ebee6e73aecf38f704c3f516008a68d888.iso
  1539. then
  1540. load_bioshock_iso
  1541. return 0
  1542. fi
  1543. # Will perform a full install, so no cd's needed
  1544. mds_mount "$WISOTOOL_CACHE/$PACKAGE/391042ea19b4eace5d532dbade10931ebbc4def6.mds"
  1545. # Setup cdemu for Bioshock (dpm on, tr off):
  1546. # FIXME: I'm assuming different programs may want different emulation settings. If not, move up to mds_mount().
  1547. cdemu dpm-emulation 0 1
  1548. cdemu tr-emulation 0 0
  1549. # Don't trim the hyphen's "-", the installer won't proceed without them.
  1550. BIOSHOCK_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/391042ea19b4eace5d532dbade10931ebbc4def6.txt`
  1551. ahk_do "
  1552. SetTitleMatchMode, 2
  1553. run ${ISO_MOUNT_LETTER}:setup.exe
  1554. winwait, BioShock - InstallShield Wizard, Choose Setup Language
  1555. sleep 2000
  1556. ControlClick, Button3, BioShock - InstallShield Wizard, Choose Setup Language
  1557. ControlClick, Button3, BioShock - InstallShield Wizard, Choose Setup Language ; Installer seems fidgety
  1558. winwait, BioShock - InstallShield Wizard, Welcome to the InstallShield Wizard for BioShock
  1559. sleep 1000
  1560. ControlClick, Button1, BioShock - InstallShield Wizard, Welcome to the InstallShield Wizard for BioShock
  1561. winwait, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1562. sleep 1000
  1563. ControlClick, Button5, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1564. sleep 1000
  1565. ControlClick, Button2, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1566. winwait, BioShock - InstallShield Wizard, Select the setup type to install
  1567. sleep 1000
  1568. ControlClick, Button2, BioShock - InstallShield Wizard, Select the setup type to install
  1569. winwait, BioShock - InstallShield Wizard, Click Install to begin the installation
  1570. ControlClick, Button1, BioShock - InstallShield Wizard, Click Install to begin the installation
  1571. Loop
  1572. {
  1573. ; Detect if Securom likes the mounted ISO or not. If so, continue the install. If not, exit since the install will fail.
  1574. SetTitleMatchMode, Slow
  1575. IfWinExist, BioShock - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1576. break
  1577. IfWinExist, Bioshock, Please insert the original disc instead of a backup (1000)
  1578. {
  1579. exit 1
  1580. }
  1581. sleep 10000
  1582. }
  1583. sleep 1000
  1584. ControlClick, Button6, BioShock - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1585. sleep 1000
  1586. ControlClick, Button4, BioShock - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1587. winwait, Welcome, &Next
  1588. Sleep 1000
  1589. ControlClick, Button2, Welcome, &Next
  1590. winwait, Enter your serial number, &Activate
  1591. Sleep 1000
  1592. ControlClick, Edit1, Enter your serial number, &Activate
  1593. send {Raw}$BIOSHOCK_KEY
  1594. Sleep 1000
  1595. ControlClick, Button1, Enter your serial number, &Activate
  1596. winwait, Activation Successful
  1597. Sleep 1000
  1598. Controlclick, Button3, Activation Successful
  1599. " || ( $WINESERVER -k ; warn "Bioshock failed to install properly, likely the Securom check failed" )
  1600. # According to the AppDB, 1.1 may have problems with Wine. For now, don't run it.
  1601. # FIXME: Test and if there's a Wine bug, file one/put this in an if workaround_wine_bug().
  1602. #
  1603. #download $PACKAGE http://downloads.2kgames.com/bioshock/patch/Bioshock_Version_11_Patch_Worldwide_Retail.zip
  1604. #cd $WISOTOOL_TMP
  1605. #unzip "$WISOTOOL_CACHE/$PACKAGE/Bioshock_Version_11_Patch_Worldwide_Retail.zip"
  1606. #ahk_do "
  1607. # run Bioshock Version 1.1 Patch Worldwide Retail.exe
  1608. # winwait, BioShock 1.1 Patch, This patch is to be applied ONLY to the Uncensored Retail Version of BioShock
  1609. # sleep 1000
  1610. # ControlClick, Button1, BioShock 1.1 Patch, This patch is to be applied ONLY to the Uncensored Retail Version of BioShock
  1611. # winwait, Location Confirmation, Is located at
  1612. # sleep 1000
  1613. # ControlClick, Button1, Location Confirmation, Is located at
  1614. # winwait, License Agreement, Please read the following license agreement carefully.
  1615. # sleep 1000
  1616. # ControlClick, Button1, License Agreement, Please read the following license agreement carefully.
  1617. # winwait, BioShock Patched Successfully!, BioShock patched to version 1.1 successfully!
  1618. # sleep 1000
  1619. # ControlClick, Button1, BioShock Patched Successfully!, BioShock patched to version 1.1 successfully!
  1620. # "
  1621. if workaround_wine_bug 6971
  1622. then
  1623. sh "$WINETRICKS" -q mwo=force
  1624. fi
  1625. if workaround_wine_bug 23884
  1626. then
  1627. sh "$WINETRICKS" -q d3dx9_36
  1628. fi
  1629. mds_umount
  1630. }
  1631. # sub-verb of bioshock which is used if the user loads from a .iso instead of .mds
  1632. # Doesn't quite work yet unless you have the cd mounted :-(
  1633. load_bioshock_iso()
  1634. {
  1635. BIOSHOCK_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/deaf00ebee6e73aecf38f704c3f516008a68d888.txt`
  1636. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/deaf00ebee6e73aecf38f704c3f516008a68d888.iso
  1637. ahk_do "
  1638. SetTitleMatchMode, 2
  1639. run ${ISO_MOUNT_LETTER}:setup.exe
  1640. winwait, BioShock - InstallShield Wizard, Choose Setup Language
  1641. sleep 2000
  1642. ControlClick, Button3, BioShock - InstallShield Wizard, Choose Setup Language
  1643. ControlClick, Button3, BioShock - InstallShield Wizard, Choose Setup Language ; Installer seems fidgety
  1644. winwait, BioShock - InstallShield Wizard, Welcome to the InstallShield Wizard for BioShock
  1645. sleep 1000
  1646. ControlClick, Button1, BioShock - InstallShield Wizard, Welcome to the InstallShield Wizard for BioShock
  1647. winwait, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1648. sleep 1000
  1649. ControlClick, Button5, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1650. sleep 1000
  1651. ControlClick, Button2, BioShock - InstallShield Wizard, Please read the following license agreement carefully
  1652. winwait, BioShock - InstallShield Wizard, Select the setup type to install
  1653. sleep 1000
  1654. ControlClick, Button2, BioShock - InstallShield Wizard, Select the setup type to install
  1655. winwait, BioShock - InstallShield Wizard, Click Install to begin the installation
  1656. ControlClick, Button1, BioShock - InstallShield Wizard, Click Install to begin the installation
  1657. Loop
  1658. {
  1659. ; Detect if Securom likes the mounted ISO or not. If so, continue the install. If not, exit since the install will fail.
  1660. SetTitleMatchMode, Slow
  1661. IfWinExist, BioShock, The InstallShield Wizard has successfully installed BioShock
  1662. break
  1663. IfWinExist, Bioshock, Please insert the original
  1664. {
  1665. exit 1
  1666. }
  1667. sleep 10000
  1668. }
  1669. sleep 1000
  1670. ControlClick, Button6, BioShock - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1671. sleep 1000
  1672. ControlClick, Button4, BioShock - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1673. winwait, Welcome, &Next
  1674. Sleep 1000
  1675. ControlClick, Button2, Welcome, &Next
  1676. winwait, Enter your serial number, &Activate
  1677. Sleep 1000
  1678. ControlClick, Edit1, Enter your serial number, &Activate
  1679. send {Raw}$BIOSHOCK_KEY
  1680. Sleep 1000
  1681. ControlClick, Button1, Enter your serial number, &Activate
  1682. winwait, Activation Successful
  1683. Sleep 1000
  1684. Controlclick, Button3, Activation Successful
  1685. " || ( $WINESERVER -k ; warn "Bioshock failed to install properly, likely the Securom check failed" )
  1686. iso_umount
  1687. if workaround_wine_bug 6971
  1688. then
  1689. sh "$WINETRICKS" -q mwo=force
  1690. fi
  1691. if workaround_wine_bug 23884
  1692. then
  1693. sh "$WINETRICKS" -q d3dx9_36
  1694. fi
  1695. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1696. ${programfilesdrive}:
  1697. cd "$programfilesdir_x86_win\\2K Games\\BioShock\\Builds\\Release"
  1698. bioshock.exe
  1699. __EOF__
  1700. }
  1701. #----------------------------------------------------------------
  1702. verblist_add bioshock_demo "Bioshock Demo (2K Games, 2007)" \
  1703. nzd_BioShockPC.zip
  1704. load_bioshock_demo() {
  1705. download $PACKAGE http://us.download.nvidia.com/downloads/nZone/demos/nzd_BioShockPC.zip 7a19186602cec5210e4505b58965e8c04945b3cf
  1706. cd "$DRIVE_C"
  1707. rm -rf bioshock-temp
  1708. mkdir bioshock-temp
  1709. cd bioshock-temp
  1710. try unzip -q "$WISOTOOL_CACHE/$PACKAGE"/nzd_BioShockPC.zip
  1711. try cd "BioShock PC Demo"
  1712. ahk_do "
  1713. SetTitleMatchMode, 2
  1714. run setup.exe
  1715. winwait, BioShock Demo - InstallShield Wizard, Choose Setup Language
  1716. sleep 2000
  1717. ControlClick, Button3
  1718. ControlClick, Button3
  1719. winwait, BioShock Demo - InstallShield Wizard, Welcome
  1720. sleep 1000
  1721. ControlClick, Button1
  1722. winwait, BioShock Demo - InstallShield Wizard, Please read
  1723. sleep 1000
  1724. ControlClick, Button5
  1725. sleep 1000
  1726. ControlClick, Button2
  1727. winwait, BioShock Demo - InstallShield Wizard, Select the setup type
  1728. sleep 1000
  1729. ControlClick, Button2
  1730. winwait, BioShock Demo - InstallShield Wizard, Click Install to begin
  1731. ControlClick, Button1
  1732. winwait, BioShock Demo - InstallShield Wizard, The InstallShield Wizard has successfully installed BioShock
  1733. sleep 1000
  1734. ControlClick, Button2 ; don't launch
  1735. ControlClick, Button6 ; don't show readme
  1736. send {Enter} ; finish
  1737. "
  1738. cd ..
  1739. rm -rf bioshock-temp
  1740. cd "$olddir"
  1741. }
  1742. #----------------------------------------------------------------
  1743. verblist_add bladekitten_demo "Blade Kitten Demo (Krome Studios Pty Ltd., 2010) [download]" BladeKittenDemoInstall.exe
  1744. load_bladekitten_demo() {
  1745. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/BladeKittenDemoInstall.exe"
  1746. then
  1747. download $PACKAGE "http://downloads.megagames.com/download.php?file=BladeKittenDemoInstall.exe" 8c41706ff3ad029317e5eb6853c34732498d97c7
  1748. cd "$WISOTOOL_CACHE/$PACKAGE"
  1749. mv 'download.php?file=BladeKittenDemoInstall.exe' "BladeKittenDemoInstall.exe"
  1750. fi
  1751. mkdir "$WISOTOOL_TMP/BladeKittenDemo"
  1752. cp "$WISOTOOL_CACHE/$PACKAGE"/BladeKittenDemoInstall.exe "$WISOTOOL_TMP"/BladeKittenDemo
  1753. cd "$WISOTOOL_TMP"/BladeKittenDemo
  1754. ahk_do "
  1755. SetTitleMatchMode, 3
  1756. run BladeKittenDemoInstall.exe
  1757. WinWait "Blade Kitten Demo Install Package"
  1758. ControlClick Button2 ; Install
  1759. WinWait "Blade Kitten Demo", Next
  1760. ControlClick Button1
  1761. WinWait "Blade Kitten Demo", Cost
  1762. ControlClick Button1 ; Next
  1763. WinWait "Blade Kitten Demo", ready
  1764. ControlClick Button1 ; Next
  1765. ; Note - If you are running an older version of wine the installer may appear to hang for 6-10 minutes at this point
  1766. WinWait "Blade Kitten Demo", Complete
  1767. ControlClick Button1 ; Close
  1768. "
  1769. mv "$WISOTOOL_TMP/BladeKittenDemo" "$DRIVE_C/Program Files"
  1770. if workaround_wine_bug 24681
  1771. then
  1772. set_app_winver BladeKitten_Demo.exe win2k
  1773. fi
  1774. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1775. ${programfilesdrive}:
  1776. cd "$programfilesdir_x86_win\\Krome Studios\\Blade Kitten Demo"
  1777. BladeKitten_Demo.exe
  1778. __EOF__
  1779. }
  1780. #----------------------------------------------------------------
  1781. verblist_add blur "Blur (Activision, 2010)" \
  1782. 30fdaf3aad82be846f26b7908c703598d5c3443d.iso
  1783. load_blur() {
  1784. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/30fdaf3aad82be846f26b7908c703598d5c3443d.iso
  1785. ahk_do "
  1786. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  1787. SetTitleMatchMode, 2
  1788. winwait, Activision, Select the language
  1789. sleep 1000
  1790. send {Enter}
  1791. winwait, Blur, install Blur
  1792. sleep 1000
  1793. send {Enter}
  1794. winwait, Blur, License
  1795. sleep 1000
  1796. ControlClick Button5
  1797. send {Enter}
  1798. winwait, Blur, Minimum System
  1799. sleep 1000
  1800. send {Enter}
  1801. winwait, Blur, Setup Type
  1802. sleep 1000
  1803. send {Enter}
  1804. winwaitclose, Blur
  1805. ; the installer still has a bit of stuff to do after that window closes
  1806. sleep 10000
  1807. "
  1808. iso_umount
  1809. # FIXME: The installer didn't install physx (does it on windows? If so, file wine bug).
  1810. # The game runs without the physx trick but frame rate improves with physx.
  1811. try sh "$WINETRICKS" -q physx
  1812. if workaround_wine_bug 24509
  1813. then
  1814. warn "Game will crash on first run (which is in full screen). On second run, it will go to windowed mode. Workaround this by defaulting to a 1024x768 window."
  1815. try mkdir -p "$appdata_unix/bizarre creations/blur"
  1816. cat > "$appdata_unix/bizarre creations/blur/settings.xml" <<__EOF__
  1817. <application_settings version="1"/>
  1818. <shared_graphical_settings width="1024" height="768" x="3" y="22" multisample="0" windowed="1" vsync="1" graphical_detail="2"/>
  1819. __EOF__
  1820. fi
  1821. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1822. ${programfilesdrive}:
  1823. cd "$programfilesdir_x86_win\Activision\Blur(TM)"
  1824. "Blur.exe"
  1825. __EOF__
  1826. }
  1827. #----------------------------------------------------------------
  1828. verblist_add braid_demo "Braid Demo (Number None, 2009) [download]" braid_windows_r3.exe
  1829. load_braid_demo()
  1830. {
  1831. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/braid_windows_r3.exe"
  1832. then
  1833. download $PACKAGE http://download.instantaction.com/games/pgh_legacy/braid_windows_r3.exe 7ea08ddbf5f2fb2f38057d930389b5af7d737e2c
  1834. fi
  1835. cd "$WISOTOOL_CACHE/$PACKAGE"
  1836. ahk_do "
  1837. SetTitleMatchMode, 2
  1838. run, braid_windows_r3.exe
  1839. winwait, Braid, install
  1840. controlclick, TButton1
  1841. winwait, Braid, Destination
  1842. controlclick, TButton3
  1843. winwait, Braid, Ready to Install
  1844. controlclick, TButton3
  1845. winwait, Setup, Finishing installation
  1846. sleep 5000
  1847. ; Workaround_winebug 21761
  1848. ifwinactive, Setup, ShellExecuteEx failed
  1849. {
  1850. controlclick, Button1
  1851. }
  1852. winwait, Braid, finished
  1853. controlclick, TButton3
  1854. "
  1855. cd "$olddir"
  1856. if workaround_wine_bug 22161
  1857. then
  1858. try sh "$WINETRICKS" -q d3dx9_36
  1859. fi
  1860. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1861. ${programfilesdrive}:
  1862. cd "$programfilesdir_x86_win\\Braid"
  1863. braid.exe
  1864. __EOF__
  1865. }
  1866. #----------------------------------------------------------------
  1867. verblist_add braid "Braid (Number None, 2009) [download]" braid_windows_r3.exe
  1868. load_braid()
  1869. {
  1870. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/braid-key.txt"
  1871. then
  1872. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  1873. die "Please enter your registration key into $WISOTOOL_CACHE/$PACKAGE/braid-key.txt"
  1874. fi
  1875. BRAID_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/braid-key.txt`
  1876. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/braid_windows_r3.exe"
  1877. then
  1878. download $PACKAGE http://download.instantaction.com/games/pgh_legacy/braid_windows_r3.exe 7ea08ddbf5f2fb2f38057d930389b5af7d737e2c
  1879. fi
  1880. cd "$WISOTOOL_CACHE/$PACKAGE"
  1881. mv downloads.php* braid_windows_r3.exe 2>/dev/null
  1882. ahk_do "
  1883. SetTitleMatchMode, 2
  1884. run, braid_windows_r3.exe
  1885. winwait, Braid, install
  1886. controlclick, TButton1
  1887. winwait, Braid, Destination
  1888. controlclick, TButton3
  1889. winwait, Braid, Ready to Install
  1890. controlclick, TButton3
  1891. winwait, Setup, Finishing installation
  1892. sleep 5000
  1893. ; Workaround_winebug 21761
  1894. ifwinactive, Setup, ShellExecuteEx failed
  1895. {
  1896. controlclick, Button1
  1897. }
  1898. winwait, Braid, finished
  1899. controlclick, TButton3
  1900. "
  1901. if workaround_wine_bug 22161
  1902. then
  1903. try sh "$WINETRICKS" -q d3dx9_36
  1904. fi
  1905. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1906. ${programfilesdrive}:
  1907. cd "$programfilesdir_x86_win\Braid\"
  1908. "braid.exe"
  1909. __EOF__
  1910. # Enter the key
  1911. cd "$DRIVE_C"
  1912. ahk_do "
  1913. SetTitleMatchMode, 2
  1914. run, run-$PACKAGE.bat
  1915. winwait, Braid, Enter Registration
  1916. controlclick, Button4
  1917. winwait, Enter Registration
  1918. send {RAW}$BRAID_KEY
  1919. controlclick, Button1
  1920. sleep 5000
  1921. ; FIXME: Desktop resolution isn't reset after exit
  1922. process, close, braid.exe
  1923. "
  1924. cd "$olddir"
  1925. }
  1926. #----------------------------------------------------------------
  1927. verblist_add cod_demo "Call of Duty (Activision, 2003) [download]" Call_Of_Duty_Demo.exe
  1928. load_cod_demo() {
  1929. download $PACKAGE "http://gamedaily.newaol.com/pub/Call_Of_Duty_Demo.exe" 1c480a1e64a80f7f97fd0acd9582fe190c64ad8e
  1930. cd "$WISOTOOL_CACHE/$PACKAGE"
  1931. ahk_do "
  1932. SetTitleMatchMode, 2
  1933. run Call_Of_Duty_Demo.exe
  1934. WinWait,Call of Duty Single Player Demo,Welcome
  1935. ControlClick Button1 ; I Agree
  1936. WinWait,Call of Duty Single Player Demo,License
  1937. ControlClick Button4 ; Next
  1938. WinWait,Call of Duty Single Player Demo,System
  1939. ControlClick Button4 ; Next
  1940. WinWait,Call of Duty Single Player Demo,Location
  1941. ControlClick Button1 ; Next
  1942. WinWait,Call of Duty Single Player Demo,Select
  1943. ControlClick Button1 ; Next
  1944. WinWait,Call of Duty Single Player Demo,Start
  1945. ControlClick Button1 ; Install
  1946. WinWait,Create Shortcut
  1947. ControlClick Button1 ; Yes
  1948. WinWait,Call of Duty Single Player Demo, Complete
  1949. ControlClick Button1 ; Finish
  1950. "
  1951. if workaround_wine_bug 21558
  1952. then
  1953. # Work around a buffer overflow - not really Wine's fault
  1954. setvar="@if not defined %__GL_ExtensionStringVersion% then echo \"If you get a buffer overflow error, set __GL_ExtensionStringVersion=17700 before starting Wine. See http://bugs.winehq.org/show_bug.cgi?id=21558.\""
  1955. else
  1956. setvar=
  1957. fi
  1958. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  1959. $setvar
  1960. ${programfilesdrive}:
  1961. cd "$programfilesdir_x86_win\\Call of Duty Single Player Demo"
  1962. CoDSP.exe
  1963. __EOF__
  1964. }
  1965. #----------------------------------------------------------------
  1966. verblist_add codmw2 "Call of Duty Modern Warfare 2 (Activision, 2009) [broken]" \
  1967. 6f572261ed954733806daf5b42edf92b3127cd14.iso \
  1968. 3c6e63504d41df4bdb2d4c57f4c5fc7b810d7df8.iso
  1969. load_codmw2()
  1970. {
  1971. warn "This verb isn't quite ready for prime time."
  1972. test -f "$programfilesdir_x86_unix"/Steam/Steam.exe || try sh $WINETRICKS -q steam
  1973. # Get user's key
  1974. CODMW2_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/6f572261ed954733806daf5b42edf92b3127cd14.txt | tr -d -`
  1975. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/6f572261ed954733806daf5b42edf92b3127cd14.iso
  1976. cd "$programfilesdir_x86_unix"/Steam
  1977. ahk_do "
  1978. SetTitleMatchMode, 2
  1979. Run, Steam.exe -login $STEAMUSER $STEAMPW -install ${ISO_MOUNT_LETTER}:
  1980. ; Uncomment these lines if you haven't activated this game via steam on this account before.
  1981. ;winwait, Activation
  1982. ;MouseMove, 30, 400
  1983. ;Click
  1984. ;Sleep 300
  1985. ;send {Raw}$CODMW2_KEY
  1986. ;MouseMove, 306, 566
  1987. ;Click
  1988. ;winwait, Activation
  1989. ;sleep 10000
  1990. ;MouseMove, 310, 565
  1991. ;Click
  1992. winwait, Install
  1993. sendEvent {Enter}
  1994. ; wait for [create start menu and install] question
  1995. sleep 5000
  1996. sendEvent {Enter}
  1997. winwait, Insert
  1998. "
  1999. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/3c6e63504d41df4bdb2d4c57f4c5fc7b810d7df8.iso
  2000. ahk_do "
  2001. SetTitleMatchMode, 2
  2002. Send {Enter}
  2003. ; Need to wait for install to finish. This isn't the way to do it. Ideally we could watch some log file.
  2004. ; The last file created seems to be
  2005. ; Program Files/Steam/steamapps/call of duty modern warfare 2 content.ncf
  2006. ; so wait for that and then another 20 seconds, say.
  2007. winwait, ahk_class USurface_, Install
  2008. ; Now that install has finished, say [don't start app] and [finish].
  2009. Send {Space}
  2010. Send {Enter}
  2011. ; Now wait for the main steam interface to pop up, and close it
  2012. winwait, ahk_class USurface_, Steam
  2013. WinClose
  2014. ; If you choose to start the game above, you could wait for it to be ready to play here.
  2015. ;winwait, ahk_class USurface_8390, Ready
  2016. ;Send {Tab} # select Close
  2017. ;Send {Enter}
  2018. ;winwait, Steam Login
  2019. ;WinClose
  2020. "
  2021. iso_umount
  2022. }
  2023. #----------------------------------------------------------------
  2024. verblist_add cod4mw_demo "Call of Duty 4 Modern Warfare (Activision, 2007) [download]" CoD4MWDemoSetup_v2.exe
  2025. load_cod4mw_demo() {
  2026. download $PACKAGE "http://gamedaily.newaol.com/pub/CoD4MWDemoSetup_v2.exe" 690a5f789a44437ed10784acfdd6418ca4a21886
  2027. cd "$WISOTOOL_CACHE/$PACKAGE"
  2028. ahk_do "
  2029. SetTitleMatchMode, 2
  2030. run CoD4MWDemoSetup_v2.exe
  2031. WinWait,Modern Warfare,Welcome
  2032. ControlClick Button1 ; Next
  2033. WinWait,Modern Warfare, License
  2034. ControlClick Button5 ; accept
  2035. ControlClick Button2 ; Next
  2036. WinWait,Modern Warfare, System Requirements
  2037. ControlClick Button1 ; Next
  2038. ControlClick Button4 ; Next
  2039. WinWait,Modern Warfare, Typical
  2040. ControlClick Button4 ; License
  2041. ControlClick Button1 ; Next
  2042. WinWait,Question, shortcut
  2043. ControlClick Button1 ; Yes
  2044. WinWait,Microsoft DirectX Setup, license
  2045. ControlClick Button1 ; Yes
  2046. WinWait,Modern Warfare, finished
  2047. ControlClick Button1 ; Finished
  2048. "
  2049. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2050. ${programfilesdrive}:
  2051. cd "$programfilesdir_x86_win\\Activision\\Call of Duty 4 - Modern Warfare Demo"
  2052. iw3sp.exe
  2053. __EOF__
  2054. }
  2055. #----------------------------------------------------------------
  2056. verblist_add cnc2 "Command and Conquer Tiberian Sun & Firestorm (Westwood, 2000), [download]" OfficialCnCTiberianSun.rar
  2057. load_cnc2()
  2058. {
  2059. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/OfficialCncTiberianSun.rar"
  2060. then
  2061. download $PACKAGE http://na.llnet.cnc3tv.ea.com/u/f/eagames/cnc3/cnc3tv/Classic/OfficialCnCTiberianSun.rar 591aabd639fb9f2d2476a2150f3c00b1162674f5
  2062. fi
  2063. cd "$WISOTOOL_CACHE/$PACKAGE"
  2064. try_unrar x OfficialCnCTiberianSun.rar "$programfilesdir_x86_unix"
  2065. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2066. ${programfilesdrive}:
  2067. cd "$programfilesdir_x86_win\\EA Games\\Command & Conquer The First Decade\\Command & Conquer(tm) Tiberian Sun(tm)\\SUN"
  2068. Game.exe
  2069. __EOF__
  2070. }
  2071. #----------------------------------------------------------------
  2072. verblist_add civ4 "Civilization IV (Firaxis Games, 2005) [broken-wine-drm]" 6633e9cfbe06aa292b33fb38ce0779faf5a379bb.iso 231eee984062c9acadd336b4c0852fac829b76a8.iso
  2073. load_civ4() {
  2074. if workaround_wine_bug 219
  2075. then
  2076. warn "This game's DRM is not supported by Wine :-( but try patch 3.19 or later, it's said to remove the DRM"
  2077. fi
  2078. if workaround_wine_bug 6856
  2079. then
  2080. try sh "$WINETRICKS" -q msxml3
  2081. fi
  2082. if workaround_wine_bug 11675
  2083. then
  2084. try sh "$WINETRICKS" -q d3dx9_36
  2085. fi
  2086. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/6633e9cfbe06aa292b33fb38ce0779faf5a379bb.iso
  2087. cd "$ISO_MOUNT_ROOT"
  2088. ahk_do "
  2089. run ${ISO_MOUNT_LETTER}:autorun.exe
  2090. SetTitleMatchMode, 2
  2091. winwait, Civilization 4
  2092. ControlClick Button3, Civilization 4
  2093. winwait, Civilization 4 - InstallShield Wizard, Welcome
  2094. ControlClick &Next >, Civilization 4
  2095. winwait, Civilization 4, I &accept the terms of the license agreement
  2096. ControlClick I &accept, Civilization 4
  2097. ControlClick &Next >, Civilization 4
  2098. winwait, Civilization 4 - InstallShield Wizard, Express Install
  2099. ControlClick &Next >, Civilization 4
  2100. winwait, Civilization 4 - InstallShield Wizard, begin installation
  2101. ControlClick &Install, Civilization 4
  2102. winwait, Setup Needs The Next Disk
  2103. "
  2104. iso_umount
  2105. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/231eee984062c9acadd336b4c0852fac829b76a8.iso
  2106. ahk_do "
  2107. SetTitleMatchMode, 2
  2108. ControlClick OK, Setup Needs The Next Disk
  2109. winwait, Civilization 4, Xfire
  2110. ControlClick No, Civilization 4
  2111. ControlClick &Next >, Civilization 4
  2112. winwait, Setup Needs The Next Disk
  2113. "
  2114. iso_umount
  2115. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/6633e9cfbe06aa292b33fb38ce0779faf5a379bb.iso
  2116. ahk_do "
  2117. SetTitleMatchMode, 2
  2118. ControlClick OK, Setup Needs The Next Disk
  2119. winwait, Sid Meier's Civilization 4 - InstallShield Wizard, InstallShield Wizard Complete
  2120. ControlClick Finish, Sid Meier's Civilization 4 - InstallShield Wizard
  2121. "
  2122. download $PACKAGE http://www.firaxis.com/downloads/Patch/Civ4v161.exe 4712e96ef34dcc5aa961d2b75f49ada8bd6b0d92
  2123. cd "$WISOTOOL_CACHE/$PACKAGE"
  2124. ahk_do "
  2125. SetTitleMatchMode, 2
  2126. run Civ4v161.exe
  2127. winwait, Civilization 4
  2128. ControlClick &Next >, Sid Meier's Civilization 4 - InstallShield Wizard
  2129. winwait, Civilization 4, Xfire
  2130. ControlClick No, Civilization 4
  2131. ControlClick &Next >, Civilization 4
  2132. winwait, Civilization 4, Update Complete
  2133. "
  2134. if workaround_wine_bug 6856
  2135. then
  2136. try sh "$WINETRICKS" -q msxml3
  2137. fi
  2138. if workaround_wine_bug 11675
  2139. then
  2140. try sh "$WINETRICKS" -q d3dx9_36
  2141. fi
  2142. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2143. ${programfilesdrive}:
  2144. cd "$programfilesdir_x86_win\\Firaxis Games\\Sid Meier's Civilization 4"
  2145. Civilization4.exe
  2146. __EOF__
  2147. }
  2148. #----------------------------------------------------------------
  2149. verblist_add civ4_demo "Civilization IV Demo (Firaxis Games, 2005) [download]" Civilization4_Demo.zip
  2150. load_civ4_demo()
  2151. {
  2152. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Civilization4_Demo.zip"
  2153. then
  2154. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  2155. die "Please download demo from http://download.cnet.com/Civilization-IV-demo/3000-7489_4-10465206.html and place it in $WISOTOOL_CACHE/$PACKAGE"
  2156. fi
  2157. mkdir -p "$WISOTOOL_TMP"
  2158. cd "$WISOTOOL_CACHE/$PACKAGE"
  2159. try unzip Civilization4_Demo.zip -d "$WISOTOOL_TMP"
  2160. cd "$WISOTOOL_TMP/$PACKAGE"
  2161. chmod +x setup.exe
  2162. ahk_do "
  2163. SetTitleMatchMode, 2
  2164. run, setup.exe
  2165. winwait, Choose Setup Language
  2166. sleep 1000
  2167. Send {enter}
  2168. winwait, Civilization 4, Welcome
  2169. ControlClick &Next >, Civilization 4
  2170. winwait, Civilization 4, I &accept the terms of the license agreement
  2171. ControlClick I &accept, Civilization 4
  2172. ControlClick &Next >, Civilization 4
  2173. winwait, Civilization 4, Express Install
  2174. ControlClick &Next >, Civilization 4
  2175. winwait, Civilization 4, begin installation
  2176. ControlClick &Install, Civilization 4
  2177. winwait, Civilization 4, InstallShield Wizard Complete
  2178. ControlClick Finish, Civilization 4
  2179. winwaitclose
  2180. "
  2181. cd "$olddir"
  2182. if workaround_wine_bug 6856
  2183. then
  2184. try sh "$WINETRICKS" -q msxml3
  2185. fi
  2186. if workaround_wine_bug 6856 # part 2, still need to file a bug
  2187. then
  2188. try sh "$WINETRICKS" -q d3dx9_26
  2189. fi
  2190. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2191. ${programfilesdrive}:
  2192. cd "$programfilesdir_x86_win\\Firaxis Games\\Sid Meier's Civilization 4 Demo"
  2193. Civilization4.exe
  2194. __EOF__
  2195. }
  2196. #----------------------------------------------------------------
  2197. verblist_add cnc3_demo "Command and Conquer 3 Demo (EA, 2007) [download]" CnC3Demo.exe
  2198. load_cnc3_demo()
  2199. {
  2200. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/CnC3Demo.exe"
  2201. then
  2202. download $PACKAGE http://largedownloads.ea.com/pub/demos/CommandandConquer3/CnC3Demo.exe f6af21eba2d17eb6d8bb6a131b501b41c3a7eaf7
  2203. fi
  2204. cd "$WISOTOOL_CACHE/$PACKAGE"
  2205. ahk_do "
  2206. SetTitleMatchMode, 2
  2207. run, CnC3Demo.exe
  2208. winwait, Conquer 3, free space to install
  2209. sleep 1000
  2210. send y
  2211. winwait, WinZip, After installation
  2212. sleep 1000
  2213. send s
  2214. winwait, Conquer 3, InstallShield
  2215. sleep 3000
  2216. controlclick, Button1
  2217. winwait, Conquer 3, license
  2218. controlclick, Button3
  2219. controlclick, Button5
  2220. winwait, Conquer 3, setup type
  2221. controlclick, Button5
  2222. winwait, Conquer 3, EA Link
  2223. controlclick, Button1
  2224. winwait, Conquer 3, GameSpy
  2225. controlclick, Button1
  2226. winwait, Conquer 3, Launch the program
  2227. controlclick, Button1
  2228. "
  2229. cd "$olddir"
  2230. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2231. ${programfilesdrive}:
  2232. cd "$programfilesdir_x86_win\\Electronic Arts\\Command & Conquer 3 Tiberium Wars Demo"
  2233. CNC3Demo.exe
  2234. __EOF__
  2235. }
  2236. #----------------------------------------------------------------
  2237. verblist_add cnc4 "Command and Conquer 4 (EA, 2010) [broken-wine-drm]" f3308e6d3a93e7b5dd2643631404e97b66a0c262.iso
  2238. load_cnc4()
  2239. {
  2240. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/f3308e6d3a93e7b5dd2643631404e97b66a0c262.iso
  2241. cd "$WISOTOOL_CACHE/$PACKAGE"
  2242. ahk_do "
  2243. SetTitleMatchMode, 2
  2244. run, ${ISO_MOUNT_LETTER}:EASetup.exe
  2245. winwait, Tiberian Twilight, License
  2246. controlclick, Button1
  2247. controlclick, Button2
  2248. winwait, Tiberian Twilight, Standard Installation
  2249. controlclick, Button1
  2250. winwait, Tiberian Twilight, to exit the Setup
  2251. controlclick, Button5
  2252. controlclick, Button1
  2253. "
  2254. cd "$olddir"
  2255. iso_umount
  2256. # Bypass the game's launcher: see AppDB
  2257. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2258. ${programfilesdrive}:
  2259. "$programfilesdir_x86_win\\Electronic Arts\\Command & Conquer 4 Tiberian Twilight\\Data\\CNC4.game" -config "$programfilesdir_x86_win\\Electronic Arts\\Command & Conquer 4 Tiberian Twilight\\CNC4_English.SkuDef"
  2260. __EOF__
  2261. # Doesn't work on Wine yet because of DRM?
  2262. }
  2263. #----------------------------------------------------------------
  2264. verblist_add darknesswithin2_demo "Darkness Within 2 Demo (Zoetrope Interactive, 2010) [download]" DarknessWithin2Demo.exe
  2265. load_darknesswithin2_demo()
  2266. {
  2267. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/DarknessWithin2Demo.exe"
  2268. then
  2269. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  2270. die "Please download $WISOTOOL_CACHE/$PACKAGE/DarknessWithin2Demo.exe from http://www.bigdownload.com/games/darkness-within-2-the-dark-lineage/pc/darkness-within-2-the-dark-lineage-demo"
  2271. fi
  2272. cd "$WISOTOOL_CACHE/$PACKAGE"
  2273. ahk_do "
  2274. SetTitleMatchMode, 2
  2275. run, DarknessWithin2Demo.exe
  2276. winwait, Darkness Within, will install
  2277. ControlClick, TNewButton1
  2278. winwait, Darkness, License
  2279. ControlClick, TNewRadioButton1
  2280. ControlClick, TNewButton2
  2281. winwait, Darkness, Location
  2282. ControlClick, TNewButton3
  2283. winwait, Darkness, shortcuts
  2284. ControlClick, TNewButton4
  2285. winwait, Darkness, additional
  2286. ControlClick, TNewButton4
  2287. winwait, Darkness, Ready to Install
  2288. ControlClick, TNewButton4
  2289. winwait, PhysX, License
  2290. ControlClick, Button3
  2291. ControlClick, Button4
  2292. winwait, PhysX, successfully
  2293. ControlClick, Button1
  2294. winwait, Darkness
  2295. ControlClick, TNewListBoxButton1
  2296. ControlClick, TNewButton4
  2297. "
  2298. cd "$olddir"
  2299. if workaround_wine_bug 23041
  2300. then
  2301. sh "$WINETRICKS" -q d3dx9_36
  2302. fi
  2303. # you have to cd to the directory containing DarkLineage.exe before running it
  2304. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2305. ${programfilesdrive}:
  2306. cd "$programfilesdir_x86_win\Iceberg Interactive\Darkness Within 2 Demo"
  2307. "DarkLineage.exe"
  2308. __EOF__
  2309. }
  2310. #----------------------------------------------------------------
  2311. verblist_add daytona_usa_evolutions "Daytona USA Evolutions (Sega, 1997)" daytonev.exe
  2312. # http://appdb.winehq.org/objectManager.php?sClass=application&iId=1136
  2313. load_daytona_usa_evolutions() {
  2314. # Refuses to run on anything newer...
  2315. sh "$WINETRICKS" -q win98
  2316. download $PACKAGE http://www2.sega.co.jp/download/pc/daytonae/daytonev.exe 65c51766e01b582c15200afb0fd569e0ec5ca1ac
  2317. # Installer starts by extracting files, but doesn't seem to be a zip file or a cab file. I tried a few cli arguments,
  2318. # but had no luck. It's only 60 MB extracted, so just extract it fresh each time.
  2319. cd "$WISOTOOL_CACHE/$PACKAGE"
  2320. ahk_do "
  2321. SetTitleMatchMode, 2
  2322. run, daytonev.exe
  2323. winwait, WinSFX32 V2.16.2.6, Install &Directory:
  2324. sleep 1000
  2325. controlclick, Button2, WinSFX32 V2.16.2.6, Install &Directory:
  2326. loop
  2327. {
  2328. ifwinexist, WinSFX32 V2.16.2.6, Install &Directory:
  2329. sleep 5000
  2330. else
  2331. break
  2332. }
  2333. "
  2334. cd daytonev
  2335. # There's a lot of unknown characters (presumably Japanese). Should this require user to run in
  2336. # a Japanese locale?
  2337. ahk_do "
  2338. SetTitleMatchMode, 2
  2339. run, Setup.exe
  2340. winwait, Welcome, ???? DAYTONA USA Evolution ? !
  2341. sleep 1000
  2342. controlclick, Button1, Welcome, ???? DAYTONA USA Evolution ? !
  2343. winwait, ???????????, ???????? PATH ??????????
  2344. sleep 1000
  2345. controlclick, Button1, ???????????, ???????? PATH ??????????
  2346. winwait, Setup, ??????????????????????
  2347. sleep 1000
  2348. controlclick, Button1, Setup, ??????????????????????
  2349. winwait, DirectX Install
  2350. sleep 1000
  2351. ; Damned if you do, damned if you don't...directx install fails if you attempt install, but if you don't, 'joystick.reg setup' fails.
  2352. controlclick, Button2, DirectX Install
  2353. sleep 1000
  2354. winwait, Setup, Joystick.reg setup failed.
  2355. sleep 1000
  2356. controlclick, Button1, Setup, Joystick.reg setup failed.
  2357. winwait, Setup, ???????????????
  2358. sleep 1000
  2359. controlclick, Button1, Setup, ???????????????
  2360. "
  2361. cd "$olddir"
  2362. warn "Gives an error when closing the game, seems safe to ignore."
  2363. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2364. ${programfilesdrive}:
  2365. cd "$DRIVE_C\SEGA\DAYTONA USA Evolution Demo CD"
  2366. "DAYTONA USA Evolution Demo CD.exe"
  2367. __EOF__
  2368. }
  2369. #----------------------------------------------------------------
  2370. verblist_add dc2ba "Doras Carnival 2: Boardwalk Adventure (Nickelodeon, 2008)" InstallDorasCarnival2BoardwalkAdventure.exe
  2371. load_dc2ba() {
  2372. # http://www.nickjr.com/games/p-doras-carnival-2-adventure.jhtml
  2373. download $PACKAGE http://downloadcdn.shockwave.com/pub/doras-carnival-2-boardwalk-adventure/InstallDorasCarnival2BoardwalkAdventure.exe a02559c4d8236581f2ee0e51a1a11f67a901eaba
  2374. if workaround_wine_bug 23749
  2375. then
  2376. sh "$WINETRICKS" -q ie6
  2377. fi
  2378. cd "$WISOTOOL_CACHE/$PACKAGE"
  2379. ahk_do "
  2380. SetTitleMatchMode, 2
  2381. run InstallDorasCarnival2BoardwalkAdventure.exe
  2382. winwait, Welcome
  2383. sleep 1000
  2384. controlclick, Button1, Welcome
  2385. sleep 1000
  2386. winwait, End User License
  2387. sleep 1000
  2388. controlclick, Button1, End User License
  2389. winwait, Choose Destination Location
  2390. sleep 1000
  2391. controlclick, Button1, Choose Destination Location
  2392. winwait, FREE Toolbar
  2393. sleep 1000
  2394. controlclick, Button5, FREE Toolbar
  2395. sleep 1000
  2396. controlclick, Button1, FREE Toolbar
  2397. winwait, Start Installation
  2398. sleep 1000
  2399. controlclick, Button1, Start Installation
  2400. winwait, Installation Complete
  2401. sleep 1000
  2402. controlclick, Button1, Installation Complete
  2403. "
  2404. sleep 5
  2405. killall winefile.exe
  2406. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2407. ${programfilesdrive}:
  2408. cd "$programfilesdir_x86_win\\Shockwave.com\\Dora's Carnival 2 - Boardwalk Adventure"
  2409. "Dora's Carnival 2 - Boardwalk Adventure.exe"
  2410. __EOF__
  2411. # Workarounds needed by the game but not the installer should come at end of verb
  2412. if workaround_wine_bug 13496
  2413. then
  2414. sh "$WINETRICKS" -q vcrun6
  2415. fi
  2416. }
  2417. #----------------------------------------------------------------
  2418. verblist_add deadspace "Dead Space (EA, 2008)" \
  2419. abf250df77bfa96c74e7bcd0343d381a4f327a26.iso
  2420. load_deadspace() {
  2421. DEADSPACEKEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/abf250df77bfa96c74e7bcd0343d381a4f327a26.txt | tr -d -`
  2422. if workaround_wine_bug 23324
  2423. then
  2424. msvcrun_me_harder="
  2425. winwait, Microsoft
  2426. controlclick, Button1
  2427. "
  2428. else
  2429. msvcrun_me_harder=""
  2430. fi
  2431. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/abf250df77bfa96c74e7bcd0343d381a4f327a26.iso
  2432. ahk_do "
  2433. SetTitleMatchMode, 2
  2434. ; note: if this is the second run, the installer skips the registration code prompt
  2435. run, ${ISO_MOUNT_LETTER}:EASetup.exe
  2436. winwait, Dead
  2437. send {Enter}
  2438. winwait, Dead, Registration Code
  2439. send {RAW}$DEADSPACEKEY
  2440. Sleep 1000
  2441. controlclick, Button2
  2442. $msvcrun_me_harder
  2443. winwait, Setup, License
  2444. Sleep 1000
  2445. controlclick, Button1
  2446. Sleep 1000
  2447. send {Enter}
  2448. winwait, Setup, License
  2449. Sleep 1000
  2450. controlclick, Button1
  2451. Sleep 1000
  2452. send {Enter}
  2453. winwait, Setup, Destination
  2454. Sleep 1000
  2455. controlclick, Button1
  2456. winwait, Setup, begin
  2457. Sleep 1000
  2458. controlclick, Button1
  2459. winwait, Setup, Finish
  2460. Sleep 1000
  2461. controlclick, Button5
  2462. controlclick, Button1
  2463. "
  2464. iso_umount
  2465. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2466. ${programfilesdrive}:
  2467. cd "$programfilesdir_x86_win\\Electronic Arts\\Dead Space"
  2468. Dead Space.exe
  2469. __EOF__
  2470. }
  2471. #----------------------------------------------------------------
  2472. verblist_add demolition_company_demo "Demolition Company demo [download]" DemolitionCompanyDemoEN.exe
  2473. load_demolition_company_demo()
  2474. {
  2475. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/DemolitionCompanyDemoEN.exe"
  2476. then
  2477. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  2478. die "Download the demo from http://www.demolitioncompany-thegame.com/demo.php and put it in $WISOTOOL_CACHE/$PACKAGE"
  2479. fi
  2480. cd "$WISOTOOL_CACHE/$PACKAGE"
  2481. ahk_do "
  2482. SetTitleMatchMode, 2
  2483. run, DemolitionCompanyDemoEN.exe
  2484. winwait, Setup - Demolition, This will install
  2485. sleep 1000
  2486. controlclick, TNewButton1, Setup - Demolition, This will install
  2487. winwait, Setup - Demolition, License Agreement
  2488. sleep 1000
  2489. controlclick, TNewRadioButton1, Setup - Demolition, License Agreement
  2490. sleep 1000
  2491. controlclick, TNewButton2, Setup - Demolition, License Agreement
  2492. winwait, Setup - Demolition, Setup Type
  2493. sleep 1000
  2494. controlclick, TNewButton2, Setup - Demolition, Setup Type
  2495. winwait, Setup - Demolition, Ready to Install
  2496. sleep 1000
  2497. controlclick, TNewButton2, Setup - Demolition, Ready to Install
  2498. winwait, Setup - Demolition, Completing
  2499. sleep 1000
  2500. controlclick, TNewButton2, Setup - Demolition, Completing
  2501. "
  2502. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2503. cd "$programfilesdir_x86_win\\Demolition Company Demo\\"
  2504. DemolitionCompany.exe
  2505. __EOF__
  2506. }
  2507. #----------------------------------------------------------------
  2508. verblist_add desperados2 "Desperados 2 (Atari, 2006)" ff13e7c5a96c70a24f91528915ea4ff375b0193e.iso
  2509. load_desperados2()
  2510. {
  2511. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/ff13e7c5a96c70a24f91528915ea4ff375b0193e.iso
  2512. ahk_do "
  2513. SetTitleMatchMode, 2
  2514. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  2515. WinWait, Desperados 2, Choose Setup Language
  2516. WinActivate
  2517. ControlClick Button3 ; next
  2518. WinWait, Desperados 2, License Agreement
  2519. WinActivate
  2520. ControlClick Button3 ; accept eula
  2521. ControlClick Button1 ; next
  2522. WinWait, Desperados 2, Choose Destination Location
  2523. ControlClick Button1 ; next
  2524. WinWait, Desperados 2, Select Program Folder
  2525. WinActivate
  2526. ControlClick Button2 ; next
  2527. WinWait, Desperados 2, Ready to Install
  2528. WinActivate
  2529. ControlClick Button1 ; install
  2530. WinWait, Desperados 2, InstallShield Wizard Complete
  2531. ControlCLick Button1 ; untick shortcut
  2532. ControlClick Button2 ; untick directx setup
  2533. ControlClick Button4 ; finish, also combo breaker
  2534. WinWait, Desperados ; flashy autorun thingy
  2535. MouseMove 103, 417 ; x marks the spot
  2536. Click ; exit
  2537. WinWaitClose
  2538. "
  2539. iso_umount
  2540. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2541. ${programfilesdrive}:
  2542. cd "$programfilesdir_x86_win\\Atari\\Desperados 2"
  2543. Desperados2.exe
  2544. __EOF__
  2545. }
  2546. #----------------------------------------------------------------
  2547. verblist_add deusex2_demo "Deus Ex 2 Demo [download]" dxiw_demo.zip
  2548. load_deusex2_demo()
  2549. {
  2550. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/dxiw_demo.zip"
  2551. then
  2552. download $PACKAGE http://www.techpowerup.com/downloads/1730i/dxiw_demo.zip ccae48fb046d912b3714ea1b4be4294e74bb3092
  2553. fi
  2554. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  2555. cd "$WISOTOOL_CACHE/$PACKAGE"
  2556. try unzip dxiw_demo.zip -d "$WISOTOOL_TMP/$PACKAGE"
  2557. cd "$WISOTOOL_TMP/$PACKAGE"
  2558. chmod +x setup.exe
  2559. ahk_do "
  2560. SetTitleMatchMode, 2
  2561. run, setup.exe
  2562. winwait, Deus Ex - Invisible War Demo - InstallShield
  2563. winwaitclose
  2564. winwait, Deus Ex - Invisible War Demo
  2565. send {Tab}{Enter}
  2566. winwait, Deus Ex - Invisible War Demo - InstallShield
  2567. send n
  2568. winwait, Deus Ex - Invisible War Demo, license
  2569. send an
  2570. winwait, Deus Ex - Invisible War Demo, setup type
  2571. send n
  2572. winwait, Deus Ex - Invisible War Demo, install
  2573. send i
  2574. winwait, Question, ; Readme?
  2575. send n
  2576. winwait, Question, ; Play now?
  2577. send n
  2578. winwait, Deus Ex - Invisible War Demo, install ; Done
  2579. send {Enter}
  2580. winwaitclose
  2581. "
  2582. cd "$olddir"
  2583. if workaround_wine_bug 6971
  2584. then
  2585. warn "This game suffers from The Mouse Bug, see http://wiki.winehq.org/Bug6971 for tips"
  2586. fi
  2587. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2588. ${programfilesdrive}:
  2589. cd "$programfilesdir_x86_win\\Deus Ex - Invisible War Demo\\System\\"
  2590. DX2.exe
  2591. __EOF__
  2592. }
  2593. #----------------------------------------------------------------
  2594. verblist_add diablo2 "Diablo II (Blizzard, 2000)" \
  2595. e20efb1ea60e58b4a25275a00571aabfe3ab4511.iso \
  2596. 51e2c630d5dd017e6168a8cf3ee24e39010316d9.iso \
  2597. 382ea98f270e39855b558b8fac0d609712a54ae8.iso \
  2598. e20efb1ea60e58b4a25275a00571aabfe3ab4511.iso
  2599. load_diablo2() {
  2600. warn "You must have already done 'wisotool load=YOURKEY' on the install disc, and 'wisotool load' on the other three discs."
  2601. download diablo2 http://ftp.blizzard.com/pub/diablo2/patches/PC/D2Patch_113c.exe c78761bfb06999a9788f25a23a1ed30260ffb8ab
  2602. # Force clean-ish install
  2603. test -d "$programfilesdir_unix/Diablo II" && rm -rf "$programfilesdir_unix/Diablo II"
  2604. # Get user's key
  2605. DIABLOIIKEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/e20efb1ea60e58b4a25275a00571aabfe3ab4511.txt | tr -d -`
  2606. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e20efb1ea60e58b4a25275a00571aabfe3ab4511.iso
  2607. ahk_do "
  2608. run ${ISO_MOUNT_LETTER}:setup.exe
  2609. winwait, Diablo II Setup
  2610. send {i}
  2611. winwait, Choose Installation Size
  2612. send {u}
  2613. send {Enter}
  2614. send {Raw}$USERNAME
  2615. send {Tab}{Raw}$DIABLOIIKEY
  2616. send {Enter}
  2617. winwait, Diablo II - choose install directory
  2618. send {Enter}
  2619. winwait, Desktop Shortcut
  2620. send {N}
  2621. winwait, Insert Disc"
  2622. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/51e2c630d5dd017e6168a8cf3ee24e39010316d9.iso
  2623. # Needed by patch 1.13c to avoid disc swapping
  2624. cp "$ISO_MOUNT_ROOT"/d2music.mpq "$programfilesdir_unix/Diablo II/"
  2625. ahk_do "
  2626. send, {Enter}
  2627. Sleep 1000
  2628. winwait, Insert Disc"
  2629. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/382ea98f270e39855b558b8fac0d609712a54ae8.iso
  2630. ahk_do "
  2631. send, {Enter}
  2632. Sleep 1000
  2633. winwait, Insert Disc"
  2634. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e20efb1ea60e58b4a25275a00571aabfe3ab4511.iso
  2635. ahk_do "
  2636. send, {Enter}
  2637. Sleep 1000
  2638. winwait, View ReadMe?
  2639. ControlClick &No, View ReadMe?
  2640. winwait, Register Diablo II Electronically?
  2641. send {N}
  2642. winwait, Diablo II Setup - Video Test
  2643. ControlClick &Cancel, Diablo II Setup - Video Test
  2644. winclose, Diablo II Setup"
  2645. iso_umount
  2646. try "$WINE" "$WISOTOOL_CACHE"/diablo2/D2Patch_113c.exe
  2647. ahk_do "
  2648. winwait Blizzard Updater v2.72
  2649. send {Enter}
  2650. winwait Diablo II
  2651. ControlClick &Cancel, Diablo II"
  2652. # Dagnabbit, the darn updater starts the game after it updates, no matter what I do?
  2653. killall "Game.exe"
  2654. warn "When starting the game, be patient, wait until the menu appears. The game seems to hang if it looses focus, see bug 14456, you may need to set winecfg to virtual desktop."
  2655. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2656. ${programfilesdrive}:
  2657. cd "$programfilesdir_x86_win\Diablo II"
  2658. "Diablo II.exe"
  2659. __EOF__
  2660. }
  2661. #----------------------------------------------------------------
  2662. verblist_add dragonage "Dragon Age: Origins (Bioware / EA, 2009)" 705a6b06d0dd807bf62b4391d278649d728ebda4.iso
  2663. load_dragonage() {
  2664. # Get user's key
  2665. DRAGONAGEKEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/705a6b06d0dd807bf62b4391d278649d728ebda4.txt | tr -d -`
  2666. # Installer has a non-fatal crash on exit, so ignore it.
  2667. sh "$WINETRICKS" -q nocrashdialog physx vcrun2005
  2668. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/705a6b06d0dd807bf62b4391d278649d728ebda4.iso
  2669. ahk_do "
  2670. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  2671. SetTitleMatchMode, 2
  2672. winwait, Installer Language
  2673. send {Enter}
  2674. winwait, Dragon Age: Origins Setup
  2675. ControlClick Next, Dragon Age: Origins Setup
  2676. winwait, Dragon Age: Origins Setup, End User License
  2677. sleep 1000
  2678. ;ControlClick Button4, Dragon Age: Origins Setup ; agree
  2679. send {Tab}a ; agree
  2680. ;ControlClick I agree, Dragon Age: Origins Setup
  2681. send {Enter} ; continue
  2682. SetTitleMatchMode, 1
  2683. winwait, Dragon Age: Origins, Registration
  2684. send $DRAGONAGEKEY
  2685. send {Enter}
  2686. winwait, Dragon Age: Origins Setup, Install Type
  2687. Sleep 1000
  2688. send {Enter}
  2689. loop 100
  2690. {
  2691. IfWinExist, Dragon Age: Origins Setup
  2692. sleep 60000
  2693. }
  2694. exit 0
  2695. "
  2696. iso_umount
  2697. if workaround_wine_bug 22307
  2698. then
  2699. warn "Turn off frame buffer effects to avoid blurry cut scenes. See http://bugs.winehq.org/show_bug.cgi?id=22307"
  2700. fi
  2701. if workaround_wine_bug 22383
  2702. then
  2703. try "$WINETRICKS" -q strictdrawordering=enabled
  2704. fi
  2705. if workaround_wine_bug 23730
  2706. then
  2707. warn "Run with WINEDEBUG=-all to reduce flickering."
  2708. fi
  2709. if workaround_wine_bug 23081
  2710. then
  2711. warn "If you still see flickering, try applying the patch from http://bugs.winehq.org/show_bug.cgi?id=23081"
  2712. fi
  2713. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2714. ${programfilesdrive}:
  2715. cd "$programfilesdir_x86_win\\Dragon Age"
  2716. bin_ship\\daorigins.exe
  2717. __EOF__
  2718. }
  2719. #----------------------------------------------------------------
  2720. verblist_add dts "Death to Spies (1C Company / Haggard Games, 2007)" 3cf30e69986e00794a4ee581a35f3319f82a82dd.iso
  2721. load_dts() {
  2722. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/3cf30e69986e00794a4ee581a35f3319f82a82dd.iso
  2723. ahk_do "
  2724. Run, ${ISO_MOUNT_LETTER}:Death_to_Spies_Setup.exe
  2725. SetTitleMatchMode, 2
  2726. WinWait, Death to Spies
  2727. WinActivate
  2728. ControlClick TNewButton1 ; next
  2729. WinWait, , Select Destination Location
  2730. ControlClick TNewButton3 ; next
  2731. WinWait, , Select Start Menu Folder
  2732. ControlClick TNewButton4 ; next
  2733. WinWait, , Select Additional Tasks
  2734. ControlClick TNewCheckListBox1 ; uncheck shortcut
  2735. ControlClick TNewButton4 ; next
  2736. WinWait, , Ready to Install
  2737. ControlClick TNewButton4 ; next
  2738. WinWait, Microsoft ; direct x
  2739. WinActivate
  2740. ControlClick Button6 ; cancel
  2741. WinWait, Death to Spies
  2742. WinActivate
  2743. ControlClick TNewButton4 ; finish
  2744. "
  2745. iso_umount
  2746. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2747. ${programfilesdrive}:
  2748. cd "$programfilesdir_x86_win\\Aspyr\\Death to Spies Moment of Truth"
  2749. Truth.exe
  2750. __EOF__
  2751. }
  2752. #----------------------------------------------------------------
  2753. verblist_add eve "EVE Online Tyrannis (CCP Games, 2010) [download]" EVE_Premium_Setup_177290_m.exe
  2754. load_eve() {
  2755. # FIXME: download function should avoid checksumming huge old files
  2756. test -s "$WISOTOOL_CACHE/$PACKAGE/EVE_Premium_Setup_177290_m.exe" ||
  2757. download $PACKAGE "http://content.eveonline.com/EVE_Premium_Setup_177290_m.exe" 92624334ed5a431c1b516161ecf7280882b388f6
  2758. cd "$WISOTOOL_CACHE/$PACKAGE"
  2759. ahk_do "
  2760. run, EVE_Premium_Setup_177290_m.exe
  2761. WinWait, EVE Online Installer
  2762. WinActivate
  2763. send {Enter} ; Next
  2764. WinWait, EVE,License Agreement
  2765. WinActivate
  2766. send {Enter} ; Next
  2767. WinWait, EVE,Choose Install
  2768. WinActivate
  2769. send {Enter} ; Install
  2770. WinWait, EVE,Installation Complete
  2771. WinActivate
  2772. send {Enter} ; next
  2773. WinWait, EVE,Installation Complete
  2774. WinActivate
  2775. Send {Tab}{Tab}{Tab} ; select Launch
  2776. Send {Space} ; untick Launch
  2777. Send {Enter} ; Finish
  2778. WinWaitClose
  2779. "
  2780. if workaround_wine_bug 18221
  2781. then
  2782. sh "$WINETRICKS" -q corefonts
  2783. fi
  2784. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2785. ${programfilesdrive}:
  2786. cd "$programfilesdir_x86_win\\CCP\\EVE"
  2787. eve.exe
  2788. __EOF__
  2789. }
  2790. #----------------------------------------------------------------
  2791. verblist_add ewj_demo "Earthworm Jim demo (Shiny Entertainment, 1996) [download]"
  2792. load_ewj_demo() {
  2793. # http://appdb.winehq.org/objectManager.php?sClass=application&iId=4233
  2794. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/ewjdemo.exe"
  2795. then
  2796. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  2797. die "Please download the demo from http://download.cnet.com/Earthworm-Jim-demo/3000-2099_4-10000793.html and put it in $WISOTOOL_CACHE/$PACKAGE"
  2798. fi
  2799. # FIXME: If the user is on a 32-bit OS and has vm.mmap_min_addr=0, they can use Wine to extract the files.
  2800. # So we should try that if arj is not installed.
  2801. if ! [ -x `which arj` ]
  2802. then
  2803. die "You need to install the `arj` utility to extract the demo files. (e.g., sudo apt-get install arj or sudo yum install arj)"
  2804. else
  2805. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  2806. cd "$WISOTOOL_TMP/$PACKAGE"
  2807. arj e "$WISOTOOL_CACHE/$PACKAGE/ewjdemo.exe"
  2808. mkdir -p "$DRIVE_C/ewj_demo"
  2809. cd "$DRIVE_C/ewj_demo"
  2810. arj e "$WISOTOOL_TMP/$PACKAGE/EWJFILES.EXE"
  2811. fi
  2812. if workaround_wine_bug 19531
  2813. then
  2814. warn "Sound does not work in Windows NT+ mode. It does in win98 mode, but then locks up the game. See http://bugs.winehq.org/show_bug.cgi?id=19531"
  2815. else
  2816. sh "$WINETRICKS" win98
  2817. fi
  2818. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2819. cd "$DRIVE_C\\ewj_demo"
  2820. WORM.EXE
  2821. __EOF__
  2822. }
  2823. #----------------------------------------------------------------
  2824. # Sadly, the SHA1SUM of the first disc varies!
  2825. # FIXME: change load function to call it by its volume label instead; right now you have to rename it manually.
  2826. verblist_add fable_tlc "Fable: The Lost Chapters (Microsoft, 2005)" \
  2827. FABLE_DISC_1.iso \
  2828. 755eaa37cd52c1171339d2dae11979147cf62080.iso \
  2829. ed977f38acac7a09b8b6fdcc64a68933076d0cd4.iso \
  2830. 2aa5c8c55d38a4113da4c3ca60d9e69ed2a0d941.iso
  2831. load_fable_tlc() {
  2832. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/FABLE_DISK_1.txt | tr -d -`
  2833. if workaround_wine_bug 657
  2834. then
  2835. try sh "$WINETRICKS" -q mfc42
  2836. fi
  2837. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/FABLE_DISK_1.iso
  2838. ahk_do "
  2839. SetTitleMatchMode, 2
  2840. run, ${ISO_MOUNT_LETTER}:setup.exe
  2841. WinWait,Fable,Welcome
  2842. Sleep 500
  2843. ControlClick Button1 ; Next
  2844. WinWait,Fable,Please
  2845. Sleep 500
  2846. ControlClick Button4 ; Next
  2847. WinWait,Fable,Product Key
  2848. Sleep 500
  2849. Send $KEY
  2850. Send {Enter}
  2851. WinWait,Fable,Disk 2
  2852. "
  2853. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/ed977f38acac7a09b8b6fdcc64a68933076d0cd4.iso
  2854. ahk_do "
  2855. SetTitleMatchMode, 2
  2856. WinWait,Fable,Disk 2
  2857. Sleep 500
  2858. ControlClick Button2 ; Retry
  2859. WinWait,Fable,Disk 3
  2860. "
  2861. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/755eaa37cd52c1171339d2dae11979147cf62080.iso
  2862. ahk_do "
  2863. SetTitleMatchMode, 2
  2864. WinWait,Fable,Disk 3
  2865. Sleep 500
  2866. ControlClick Button2 ; Retry
  2867. WinWait,Fable,Disk 4
  2868. "
  2869. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e435cfeb975e596db1bf953170462e3b81c41396.iso
  2870. ahk_do "
  2871. SetTitleMatchMode, 2
  2872. WinWait,Fable,Disk 4
  2873. Sleep 500
  2874. ControlClick Button2 ; Retry
  2875. WinWait,Fable,Disk 1
  2876. WinKill
  2877. "
  2878. # Now tell game what the real disc is so user can insert disc 1 and run the game!
  2879. cat > "$WISOTOOL_TMP"/$PACKAGE.reg <<_EOF_
  2880. REGEDIT4
  2881. [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\D3BE9C3CAF4226447B48E06CAACF2DDD\InstallProperties]
  2882. "InstallSource"="D:\\"
  2883. _EOF_
  2884. try_regedit "$WISOTOOL_TMP_WIN"\\$PACKAGE.reg
  2885. # Also accept EULA
  2886. cat > "$WISOTOOL_TMP"/$PACKAGE.reg <<_EOF_
  2887. REGEDIT4
  2888. [HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Fable TLC]
  2889. "FIRSTRUN"=dword:00000001
  2890. _EOF_
  2891. try_regedit "$WISOTOOL_TMP_WIN"\\$PACKAGE.reg
  2892. if workaround_wine_bug 24912
  2893. then
  2894. # kill off lingering installer
  2895. ahk_do "
  2896. SetTitleMatchMode, 2
  2897. WinKill,Fable
  2898. "
  2899. $WINESERVER -k
  2900. fi
  2901. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2902. ${programfilesdrive}:
  2903. cd "$programfilesdir_x86_win\\Microsoft Games\\Fable - The Lost Chapters"
  2904. Fable.exe
  2905. __EOF__
  2906. if workaround_wine_bug 24941
  2907. then
  2908. try sh "$WINETRICKS" -q devenum quartz wmp9
  2909. fi
  2910. if workaround_wine_bug 24942
  2911. then
  2912. sh "$WINETRICKS" -q d3dx9_36
  2913. fi
  2914. }
  2915. #----------------------------------------------------------------
  2916. verblist_add fallout3 "Fallout 3 Windows Live Version (Bethesda, 2009)" 4994dca9fa2e105ea592899644f48d754338663f.iso
  2917. load_fallout3()
  2918. {
  2919. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/4994dca9fa2e105ea592899644f48d754338663f.iso
  2920. if workaround_wine_bug 23532
  2921. then
  2922. try "$WINETRICKS" -q xlive
  2923. fi
  2924. cd "$WISOTOOL_CACHE/$PACKAGE"
  2925. ahk_do "
  2926. SetTitleMatchMode, 2
  2927. run, ${ISO_MOUNT_LETTER}:setup.exe
  2928. winwait, Fallout 3, Welcome
  2929. controlclick, Button1
  2930. winwait, Fallout 3, License Agreement
  2931. controlclick, Button3
  2932. controlclick, Button1
  2933. winwait, Fallout 3, Setup Type
  2934. controlclick, Button4
  2935. winwait, Fallout 3, Ready to Install
  2936. controlclick, Button1
  2937. winwait, Fallout 3, InstallShield Wizard Complete
  2938. controlclick, Button1
  2939. controlclick, Button2
  2940. controlclick, Button3
  2941. "
  2942. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  2943. ${programfilesdrive}:
  2944. cd "$programfilesdir_x86_win\\Bethesda Softworks\\Fallout 3"
  2945. "Fallout3.exe"
  2946. __EOF__
  2947. }
  2948. #----------------------------------------------------------------
  2949. verblist_add fallout3_goty "Fallout 3: Game of the Year Edition (Bethesda, 2009)" 379e2daa9bdd1aaf1cb152c1d9f8181f8f24e01b.iso \
  2950. f131e45dba66ed2c98dd7a1e04cc1114b7c5e4b6.iso
  2951. load_fallout3_goty() {
  2952. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=14322
  2953. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/379e2daa9bdd1aaf1cb152c1d9f8181f8f24e01b.iso
  2954. ahk_do "
  2955. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  2956. SetTitleMatchMode, 2
  2957. winwait, Fallout 3 - InstallShield Wizard, Welcome to the InstallShield Wizard for Fallout 3
  2958. sleep 1000
  2959. controlclick, Button1, Fallout 3 - InstallShield Wizard, Welcome to the InstallShield Wizard for Fallout 3
  2960. winwait, Fallout 3 - InstallShield Wizard, Please read the following license agreement carefully.
  2961. sleep 1000
  2962. controlclick, Button3, Fallout 3 - InstallShield Wizard, Please read the following license agreement carefully.
  2963. sleep 1000
  2964. controlclick, Button1, Fallout 3 - InstallShield Wizard, Please read the following license agreement carefully.
  2965. winwait, Fallout 3 - InstallShield Wizard, Please select a setup type.
  2966. sleep 1000
  2967. controlclick, Button4, Fallout 3 - InstallShield Wizard, Please select a setup type.
  2968. winwait, Fallout 3 - InstallShield Wizard, Click Install to begin the installation.
  2969. sleep 1000
  2970. controlclick, Button1, Fallout 3 - InstallShield Wizard, Click Install to begin the installation.
  2971. winwait, Fallout 3 - InstallShield Wizard, InstallShield Wizard Complete
  2972. sleep 1000
  2973. controlclick, Button1, Fallout 3 - InstallShield Wizard, InstallShield Wizard Complete
  2974. sleep 1000
  2975. controlclick, Button2, Fallout 3 - InstallShield Wizard, InstallShield Wizard Complete
  2976. sleep 1000
  2977. controlclick, Button3, Fallout 3 - InstallShield Wizard, InstallShield Wizard Complete
  2978. "
  2979. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/f131e45dba66ed2c98dd7a1e04cc1114b7c5e4b6.iso
  2980. ahk_do "
  2981. Run, ${ISO_MOUNT_LETTER}:EN_Fallout_3_DLC.EXE
  2982. SetTitleMatchMode, 2
  2983. winwait, Fallout 3 - DLC EN - InstallShield Wizard, Welcome to the InstallShield Wizard for Fallout 3 - DLC EN
  2984. sleep 1000
  2985. controlclick, Button1, Fallout 3 - DLC EN - InstallShield Wizard, Welcome to the InstallShield Wizard for Fallout 3 - DLC EN
  2986. winwait, Fallout 3 - DLC EN - InstallShield Wizard, Please read the following license agreement carefully.
  2987. sleep 1000
  2988. controlclick, Button5, Fallout 3 - DLC EN - InstallShield Wizard, Please read the following license agreement carefully.
  2989. sleep 1000
  2990. controlclick, Button2, Fallout 3 - DLC EN - InstallShield Wizard, Please read the following license agreement carefully.
  2991. winwait, Fallout 3 - DLC EN - InstallShield Wizard, Click Install to begin the installation.
  2992. sleep 1000
  2993. controlclick, Button1, Fallout 3 - DLC EN - InstallShield Wizard, Click Install to begin the installation.
  2994. winwait, Fallout 3 - DLC EN - InstallShield Wizard, InstallShield Wizard Complete
  2995. sleep 1000
  2996. controlclick, Button4, Fallout 3 - DLC EN - InstallShield Wizard, InstallShield Wizard Complete
  2997. "
  2998. if workaround_wine_bug 23532
  2999. then
  3000. try "$WINETRICKS" -q xlive
  3001. fi
  3002. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3003. ${programfilesdrive}:
  3004. cd "$programfilesdir_x86_win\\Bethesda Softworks\\Fallout 3"
  3005. "Fallout3.exe"
  3006. __EOF__
  3007. }
  3008. #----------------------------------------------------------------
  3009. verblist_add fallout_nv "Fallout New Vegas (Bethesda, 2010)" f603dfc0343ea4257d04946e1cac8c06dfe8707d.iso
  3010. load_fallout_nv()
  3011. {
  3012. warn "You'll need to have STEAM_USER/STEAM_PASS set in your environment or in $WISOTOOL_CACHE. You'll also need your cd-key for Fallout New Vegas already added to your Steam Account."
  3013. if [ ! "$STEAM_USER" -a ! -f "$WISOTOOL_CACHE"/STEAM_USER ]
  3014. then
  3015. die "You need to set STEAM_USER variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_USER"
  3016. elif [ ! "$STEAM_USER" -a -f "$WISOTOOL_CACHE"/STEAM_USER ]
  3017. then
  3018. STEAM_USER=`cat "$WISOTOOL_CACHE"/STEAM_USER`
  3019. fi
  3020. if [ ! "$STEAM_PASS" -a ! -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  3021. then
  3022. die "You need to set STEAM_PASS variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_PASS"
  3023. elif [ ! "$STEAM_PASS" -a -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  3024. then
  3025. STEAM_PASS=`cat "$WISOTOOL_CACHE"/STEAM_PASS`
  3026. fi
  3027. steam_dir="$programfilesdir_unix/Steam"
  3028. # Game uses Steam to install itself
  3029. try sh $WINETRICKS -q steam
  3030. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/f603dfc0343ea4257d04946e1cac8c06dfe8707d.iso
  3031. cd "$steam_dir"
  3032. # Run Steam, let it update. Then, in a separate thread, run the installer.
  3033. ahk_do "
  3034. SetTitleMatchMode, 2
  3035. SetControlDelay -1
  3036. run, Steam.exe -login $STEAM_USER $STEAM_PASS
  3037. Winwait, Steam - Update News
  3038. ; Close all windows, prevent conflicts with later controlclick's
  3039. winclose, Steam - Update News
  3040. winclose, Steam
  3041. "
  3042. ahk_do "
  3043. SetTitleMatchMode, 2
  3044. SetControlDelay -1
  3045. Run, Steam.exe -install I:\\
  3046. ; Install Fallout New Vegas
  3047. winwait, Install - Fallout- New Vegas
  3048. send, {Enter}
  3049. ; Shortcuts
  3050. sleep 10000
  3051. winwait, Install - Fallout- New Vegas
  3052. send, {Enter}
  3053. ; Installing...
  3054. sleep 10000
  3055. winwait, Install - Fallout- New Vegas
  3056. send, {Enter}
  3057. "
  3058. # Wait for install to finish
  3059. dl_log="$steam_dir/logs/download_log.txt"
  3060. while true
  3061. do
  3062. grep "SetHasAllLocalContent(true) called for 22380" "$dl_log" && break
  3063. sleep 15
  3064. done
  3065. ahk_do "
  3066. send {Enter}
  3067. sleep 1000
  3068. run, Steam.exe -shutdown
  3069. "
  3070. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3071. ${programfilesdrive}:
  3072. cd "$programfilesdir_x86_win\\Steam"
  3073. Steam.exe -login $STEAM_USER $STEAM_PASS -applaunch 22380
  3074. __EOF__
  3075. }
  3076. #----------------------------------------------------------------
  3077. verblist_add fifa10 "Fifa 10 (EA, 2009)" 2038b86319862e1177912949e9f826f333571c48.iso
  3078. load_fifa10() {
  3079. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=14322
  3080. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/2038b86319862e1177912949e9f826f333571c48.iso
  3081. # Get user's key
  3082. fifakey=`cat "$WISOTOOL_CACHE"/$PACKAGE/2038b86319862e1177912949e9f826f333571c48.txt | tr -d -`
  3083. if workaround_wine_bug 23433 'wine-1.2-422*|wine-1.2.*'
  3084. then
  3085. fifatitle="DisplayName from default.wxl"
  3086. else
  3087. # FIXME: What is it on Windows?
  3088. fifatitle="FIFA 10"
  3089. fi
  3090. ahk_do "
  3091. Run, ${ISO_MOUNT_LETTER}:AutoRun.exe
  3092. SetTitleMatchMode, 2
  3093. winwait, FIFA 10, View the readme file
  3094. sleep 1000
  3095. controlclick, Button1, FIFA 10, View the readme file
  3096. winwait, FIFA 10, Please enter the entire Registration Code found either
  3097. sleep 1000
  3098. send $fifakey
  3099. send {Enter}
  3100. winwait, Microsoft Visual C++ 2005, Please read the following license agreement
  3101. sleep 1000
  3102. controlclick, Button1, Microsoft Visual C++ 2005, Please read the following license agreement
  3103. winwait, $fifatitle, I &accept the terms in the End User License Agreement
  3104. sleep 1000
  3105. controlclick, Button1, $fifatitle, I &accept the terms in the End User License Agreement
  3106. sleep 1000
  3107. controlclick, Button3, $fifatitle, I &accept the terms in the End User License Agreement
  3108. ; There are two license agreements...one is for Directx
  3109. winwait, $fifatitle, I &accept the terms in the End User License Agreement
  3110. sleep 1000
  3111. controlclick, Button1, $fifatitle, I &accept the terms in the End User License Agreement
  3112. sleep 1000
  3113. controlclick, Button3, $fifatitle, I &accept the terms in the End User License Agreement
  3114. winwait, $fifatitle, Ready to install $fifatitle
  3115. sleep 1000
  3116. controlclick, Button1, $fifatitle, Ready to install $fifatitle
  3117. winwait, $fifatitle, Click the Finish button to exit the Setup Wizard.
  3118. sleep 1000
  3119. controlclick, Button5, $fifatitle, Click the Finish button to exit the Setup Wizard.
  3120. sleep 1000
  3121. controlclick, Button1, $fifatitle, Click the Finish button to exit the Setup Wizard.
  3122. winwait, Product Registration, Please log into your EA Master Account to continue.
  3123. sleep 1000
  3124. controlclick, Button14, Product Registration, Please log into your EA Master Account to continue.
  3125. "
  3126. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3127. ${programfilesdrive}:
  3128. cd "$programfilesdir_x86_win\\EA Sports\\FIFA 10"
  3129. "FIFA10.exe"
  3130. __EOF__
  3131. }
  3132. #----------------------------------------------------------------
  3133. verblist_add fifa11_demo "FIFA 11 Demo (EA Sports, 2010) [download]" fifa11_pc_demo_NA.zip
  3134. load_fifa11_demo()
  3135. {
  3136. # From http://www.easportsfootball.co.uk/news/item/file/FIFA-11-Demo-Release?om_u=2255229429&om_i=_BMknsPB8Usvnmr
  3137. download $PACKAGE http://static.cdn.ea.com/fifa/u/f/fifa11_pc_demo_NA.zip c3a66284bffb985f31b11e477dade50c0d4cac52
  3138. mkdir "$WISOTOOL_TMP/$PACKAGE"
  3139. try unzip -d "$WISOTOOL_TMP/$PACKAGE" "$WISOTOOL_CACHE/$PACKAGE/fifa11_pc_demo_NA.zip"
  3140. cd "$WISOTOOL_TMP/$PACKAGE"
  3141. ahk_do "
  3142. SetTitleMatchMode, 2
  3143. run, EASetup.exe
  3144. winwait, Microsoft Visual C++ 2008, This wizard will guide you
  3145. sleep 1000
  3146. controlclick, Button12, Microsoft Visual C++ 2008, This wizard will guide you
  3147. winwait, Microsoft Visual C++ 2008, License Terms
  3148. sleep 1000
  3149. controlclick, Button11, Microsoft Visual C++ 2008, License Terms
  3150. sleep 1000
  3151. controlclick, Button8, Microsoft Visual C++ 2008, License Terms
  3152. winwait, Microsoft Visual C++ 2008, Setup Complete
  3153. sleep 2000
  3154. controlclick, Button2, Microsoft Visual C++ 2008, Setup Complete
  3155. ; It doesn't seem to take the first click, so try a second time..
  3156. sleep 2000
  3157. controlclick, Button2, Microsoft Visual C++ 2008, Setup Complete
  3158. ; There are two license agreements...one is for Directx
  3159. winwait, FIFA 11, I &accept the terms in the End User License Agreement
  3160. sleep 1000
  3161. controlclick, Button1, FIFA 11, I &accept the terms in the End User License Agreement
  3162. sleep 1000
  3163. controlclick, Button3, FIFA 11, I &accept the terms in the End User License Agreement
  3164. winwait, FIFA 11, I &accept the terms in the End User License Agreement
  3165. sleep 1000
  3166. controlclick, Button1, FIFA 11, I &accept the terms in the End User License Agreement
  3167. sleep 1000
  3168. controlclick, Button3, FIFA 11, I &accept the terms in the End User License Agreement
  3169. winwait, FIFA 11, Ready to install FIFA 11
  3170. sleep 1000
  3171. controlclick, Button1, FIFA 11, Ready to install FIFA 11
  3172. winwait, FIFA 11, Click the Finish button to exit the Setup Wizard.
  3173. sleep 1000
  3174. controlclick, Button5, FIFA 11, Click the Finish button to exit the Setup Wizard.
  3175. sleep 1000
  3176. controlclick, Button1, FIFA 11, Click the Finish button to exit the Setup Wizard.
  3177. "
  3178. if workaround_wine_bug 22161
  3179. then
  3180. sh "$WINETRICKS" -q d3dx9_36
  3181. fi
  3182. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3183. ${programfilesdrive}:
  3184. cd "$programfilesdir_x86_win\\EA Sports\\FIFA 11 Demo\\Game"
  3185. "fifa.exe"
  3186. __EOF__
  3187. }
  3188. #----------------------------------------------------------------
  3189. verblist_add fifaonline3_beta "FIFA Online 3 Beta (EA Sports, 2010) [download]" FIFAOnlineSetup.exe
  3190. load_fifaonline3_beta()
  3191. {
  3192. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/FIFAOnlineSetup.exe"
  3193. then
  3194. mkdir -p "$WISOTOOL_CACHE"/$PACKAGE
  3195. die "Download the FIFAOnlineSetup.exe from http://fifa-online.easports.com/web/beta/welcome \
  3196. and place it in $WISOTOOL_CACHE/$PACKAGE"
  3197. fi
  3198. cd "$WISOTOOL_CACHE/$PACKAGE"
  3199. ahk_do "
  3200. SetTitleMatchMode, 2
  3201. run, FIFAOnlineSetup.exe
  3202. winwait, C++, License
  3203. controlclick, Yes
  3204. winwait, FIFA, Testing Agreement
  3205. controlclick, Button1
  3206. controlclick, Button3
  3207. winwait, FIFA, Punk
  3208. controlclick, Button1
  3209. controlclick, Button3
  3210. winwait, FIFA, Destination
  3211. controlclick, Button1
  3212. winwait, Setup, Please wait
  3213. sleep 1000
  3214. winwaitclose, Setup, Please wait
  3215. sleep 10000
  3216. send {Right}
  3217. sleep 1000
  3218. send {Space}
  3219. sleep 1000
  3220. send {Right}
  3221. sleep 1000
  3222. send {Space}
  3223. "
  3224. # Wait for download to finish and game to start
  3225. while [ `ps a | grep NFE.exe | grep -v grep | wc -l` != "1" ]
  3226. do
  3227. sleep 5
  3228. done
  3229. # Dont kill game immediately
  3230. sleep 10
  3231. killall "NFE.exe"
  3232. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3233. c:
  3234. cd \Program Files\\EA Sports\\FIFA Online
  3235. Launch.exe
  3236. __EOF__
  3237. # Download audio commentary
  3238. cd "$DRIVE_C"
  3239. ahk_do "
  3240. SetTitleMatchMode, 2
  3241. run, cmd /c run-$PACKAGE.bat
  3242. winwait, EA SPORTS, Download Commentary
  3243. controlclick, Button1, EA SPORTS, Download Commentary
  3244. "
  3245. # Wait for download to finish again and game to start
  3246. while [ `ps a | grep NFE.exe | grep -v grep | wc -l` != "1" ]
  3247. do
  3248. sleep 5
  3249. done
  3250. # Dont kill game immediately
  3251. sleep 10
  3252. killall "NFE.exe"
  3253. cd "$olddir"
  3254. }
  3255. #----------------------------------------------------------------
  3256. verblist_add fifa10_demo "Fifa 10 Demo (EA, 2009)" fifa10_pc_demo_ec.exe
  3257. load_fifa10_demo() {
  3258. download $PACKAGE "http://gamedaily.newaol.com/pub/fifa10_pc_demo_ec.exe" 96200d4962fd6c34715c448ba22f00edd3d70cd6
  3259. # The installer is a self extracting rar file. Make cleanups easy by using $WISOTOOL_TMP
  3260. mkdir "$WISOTOOL_TMP/fifa10"
  3261. cd "$WISOTOOL_TMP/fifa10"
  3262. if workaround_wine_bug 23433 'wine-1.2-422*|wine-1.2.*'
  3263. then
  3264. fifatitle="DisplayName from default.wxl"
  3265. else
  3266. fifatitle="FIFA 10 - Demo"
  3267. fi
  3268. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  3269. cd "$WISOTOOL_CACHE/$PACKAGE"
  3270. ahk_do "
  3271. Run fifa10_pc_demo_ec.exe
  3272. winwait, FIFA 10 PC Demo
  3273. send $WISOTOOL_TMP_WIN\\${PACKAGE}{ENTER}
  3274. winwait, FIFA 10 - Demo, View the readme file
  3275. sleep 1000
  3276. controlclick, Button1, FIFA 10 - Demo, View the readme file
  3277. sleep 1000
  3278. ; FIXME: make this block optional so we dont hang if wine vc2005 runtime passes the check and the game does not show this dialog
  3279. winwait, Microsoft Visual C++ 2005 Redistributable Package (x86)
  3280. sleep 1000
  3281. controlclick, Button1, Microsoft Visual C++ 2005 Redistributable Package (x86)
  3282. sleep 1000
  3283. winwait, $fifatitle Setup, I &accept the terms in the End User License Agreement
  3284. sleep 1000
  3285. controlclick, Button1, $fifatitle Setup, Please read the End User License Agreement for $fifatitle
  3286. sleep 1000
  3287. controlclick, Button3, $fifatitle Setup, Please read the End User License Agreement for $fifatitle
  3288. sleep 1000
  3289. winwait, $fifatitle Setup, Please read the following End User License Agreement carefully
  3290. sleep 1000
  3291. controlclick, Button1, $fifatitle Setup, Please read the following End User License Agreement carefully
  3292. sleep 1000
  3293. controlclick, Button3, $fifatitle Setup, Please read the following End User License Agreement carefully
  3294. sleep 1000
  3295. winwait, $fifatitle Setup, Ready to install $fifatitle
  3296. sleep 1000
  3297. controlclick, Button1, $fifatitle Setup, Ready to install $fifatitle
  3298. ; Very slow installer...
  3299. winwait, $fifatitle Setup, Click the Finish button to exit the Setup Wizard.
  3300. sleep 1000
  3301. controlclick, Button1, $fifatitle Setup, Click the Finish button to exit the Setup Wizard.
  3302. "
  3303. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3304. ${programfilesdrive}:
  3305. cd "$programfilesdir_x86_win\\EA Sports\\FIFA 10 - Demo"
  3306. FIFA10Demo.exe
  3307. __EOF__
  3308. }
  3309. #----------------------------------------------------------------
  3310. verblist_add ffvii_demo "Final Fantasy VII (Square Enix, 1998)" ff7demo.zip
  3311. load_ffvii_demo() {
  3312. download $PACKAGE "http://software-files-l.cnet.com/s/software/89/10/18/ff7demo.zip?e=1284462275&h=47913b28b2f4a0274af12447d1359776&lop=link&ptype=1901&ontid=7538&siteId=4&edId=3&spi=bc2f47421050036bcf32c99124aba9c2&pid=891018&psid=10020419&fileName=ff7demo.zip" 79a555cd1874410a93952486e511bb8492e82a56 ff7demo.zip
  3313. mkdir "$programfilesdir_x86_unix/ffvii_demo"
  3314. cd "$programfilesdir_x86_unix/ffvii_demo"
  3315. try unzip "$WISOTOOL_CACHE/$PACKAGE/ff7demo.zip"
  3316. if workaround_wine_bug 9220
  3317. then
  3318. warn "Doesn't work very well, see http://bugs.winehq.org/show_bug.cgi?id=9220"
  3319. fi
  3320. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3321. ${programfilesdrive}:
  3322. cd "$programfilesdir_x86_unix/ffvii_demo"
  3323. ff7demo.exe
  3324. __EOF__
  3325. }
  3326. #----------------------------------------------------------------
  3327. verblist_add ffxiv_beta "Final Fantasy XIV Beta (Square Enix, 2010)" ffxivsetup.exe
  3328. load_ffxiv_beta() {
  3329. # e6e615e5886c17e744fc4aba7b267e7e3dcbdb52 ffxivsetup.exe
  3330. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/ffxivsetup.exe"
  3331. then
  3332. mkdir -p "$WISOTOOL_CACHE"/$PACKAGE
  3333. die "Register for the beta and download ffxivsetup.exe from https://dev-na.ffxiv.com/ \
  3334. and place it in $WISOTOOL_CACHE/$PACKAGE"
  3335. fi
  3336. cd "$WISOTOOL_CACHE/$PACKAGE"
  3337. ahk_do "
  3338. SetTitleMatchMode, 2
  3339. run, ffxivsetup.exe
  3340. winwait, FINAL FANTASY XIV Beta Version, Select a region and language
  3341. sleep 1000
  3342. controlclick, Button2, FINAL FANTASY XIV Beta Version, Select a region and language
  3343. ; It forces Directx Install :-(
  3344. winwait, FINAL FANTASY XIV Beta Version, A new version of DirectX is required for installation
  3345. sleep 1000
  3346. controlclick, Button2, FINAL FANTASY XIV Beta Version, A new version of DirectX is required for installation
  3347. winwait, Installing Microsoft(R) DirectX(R), Welcome to setup for DirectX
  3348. sleep 1000
  3349. controlclick, Button1, Installing Microsoft(R) DirectX(R), Welcome to setup for DirectX
  3350. sleep 1000
  3351. controlclick, Button4, Installing Microsoft(R) DirectX(R), Welcome to setup for DirectX
  3352. winwait, Installing Microsoft(R) DirectX(R), This install package will search for updated DirectX
  3353. sleep 1000
  3354. Controlclick, Button4, Installing Microsoft(R) DirectX(R), This install package will search for updated DirectX
  3355. winwait, Installing Microsoft(R) DirectX(R), Installation Complete
  3356. sleep 1000
  3357. controlclick, Button5, Installing Microsoft(R) DirectX(R), Installation Complete
  3358. winwait, FINAL FANTASY XIV Beta Version, The InstallShield Wizard will install FINAL FANTASY
  3359. sleep 1000
  3360. Controlclick, Button1, FINAL FANTASY XIV Beta Version, The InstallShield Wizard will install FINAL FANTASY
  3361. winwait, FINAL FANTASY XIV Beta Version, Please shut down any antivirus
  3362. sleep 1000
  3363. ControlClick, Button1, FINAL FANTASY XIV Beta Version, Please shut down any antivirus
  3364. winwait, FINAL FANTASY XIV Beta Version, License Agreement
  3365. sleep 1000
  3366. Controlclick, Button5, FINAL FANTASY XIV Beta Version, License Agreement
  3367. sleep 1000
  3368. Controlclick, Button2, FINAL FANTASY XIV Beta Version, License Agreement
  3369. winwait, FINAL FANTASY XIV Beta Version, To install to this folder
  3370. sleep 1000
  3371. controlclick, Button1, FINAL FANTASY XIV Beta Version, To install to this folder
  3372. winwait, FINAL FANTASY XIV Beta Version, Start Copying Files
  3373. sleep 1000
  3374. controlclick, Button1, FINAL FANTASY XIV Beta Version, Start Copying Files
  3375. winwait, FINAL FANTASY XIV Beta Version, InstallShield Wizard Complete
  3376. sleep 1000
  3377. Controlclick, Button1, FINAL FANTASY XIV Beta Version, InstallShield Wizard Complete
  3378. sleep 1000
  3379. Controlclick, Button4, FINAL FANTASY XIV Beta Version, InstallShield Wizard Complete
  3380. "
  3381. if workaround_wine_bug 24358
  3382. then
  3383. sh "$WINETRICKS" winhttp
  3384. warn "You'll want to forward ports TCP/UDP 55296-55551 and UDP 443 to your computer to speed up the download. See also http://bugs.winehq.org/show_bug.cgi?id=24358"
  3385. fi
  3386. if workaround_wine_bug 24375
  3387. then
  3388. sh "$WINETRICKS" -q ie6
  3389. fi
  3390. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3391. ${programfilesdrive}:
  3392. cd "$programfilesdir_x86_win\\SquareEnix\\FINAL FANTASY XIV Beta Version"
  3393. ffxivboot.exe
  3394. __EOF__
  3395. }
  3396. #----------------------------------------------------------------
  3397. verblist_add ffxivbench "Final Fantasy XIV Benchmark (Square Enix, 2010)" FFXIVBenchmark.zip
  3398. load_ffxivbench() {
  3399. download $PACKAGE http://uk.download.nvidia.com/nzone/international/benchmarks/ffxiv/FFXIVBenchmark.zip 9c2406540306575bdc738c439e59f54eb44304a8
  3400. cd "$programfilesdir_x86_unix"
  3401. try unzip "$WISOTOOL_CACHE/$PACKAGE/FFXIVBenchmark.zip"
  3402. # Setup two batch files, one for high res, one for low res:
  3403. cat > FFXIVBenchmark/data/config.low <<__EOF__
  3404. [FFXIV_BENCHMARK]
  3405. LANGUAGE=1
  3406. CHARACTER=0
  3407. RESOLUTION=1
  3408. LOOP=0
  3409. __EOF__
  3410. cat > FFXIVBenchmark/data/config.high <<__EOF__
  3411. [FFXIV_BENCHMARK]
  3412. LANGUAGE=1
  3413. CHARACTER=0
  3414. RESOLUTION=0
  3415. LOOP=0
  3416. __EOF__
  3417. cat > "$DRIVE_C/run-$PACKAGE-low.bat" <<__EOF__
  3418. ${programfilesdrive}:
  3419. cd "$programfilesdir_x86_win\\FFXIVBenchmark\\data"
  3420. copy config.low config.ini /y
  3421. FFXivWinBenchmark.exe
  3422. __EOF__
  3423. cat > "$DRIVE_C/run-$PACKAGE-high.bat" <<__EOF__
  3424. ${programfilesdrive}:
  3425. cd "$programfilesdir_x86_win\\FFXIVBenchmark\\data"
  3426. copy config.high config.ini /y
  3427. FFXivWinBenchmark.exe
  3428. __EOF__
  3429. if workaround_wine_bug 22555
  3430. then
  3431. try "$WINETRICKS" -q d3dx9_36
  3432. fi
  3433. }
  3434. #----------------------------------------------------------------
  3435. verblist_add fm10_demo "Football Manager 2010 demo (Sony, 2009)" Setup_FM2010_Vanilla_Demo.exe
  3436. load_fm10_demo() {
  3437. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Setup_FM2010_Vanilla_Demo.exe"
  3438. then
  3439. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  3440. die "Download the demo from http://www.mirrorfootball.co.uk/football-manager-2010/ and put it in $WISOTOOL_CACHE/$PACKAGE"
  3441. fi
  3442. cd "$WISOTOOL_CACHE/$PACKAGE"
  3443. ahk_do "
  3444. run, Setup_FM2010_Vanilla_Demo.exe
  3445. winwait, Football Manager 2010 Demo
  3446. sleep 1000
  3447. ; Buttons have no names, and there is no visible window text. Additionally, the windows don't close. :-(
  3448. ; Lastly, controlclick doesn't work, even with coordinates. Luckily, mousemove + click does
  3449. mousemove, 550, 400
  3450. Click
  3451. sleep 2000
  3452. mousemove, 400, 325
  3453. click
  3454. sleep 1000
  3455. mousemove, 550, 400
  3456. click
  3457. sleep 2000
  3458. mousemove, 550, 400
  3459. click
  3460. sleep 2000
  3461. mousemove, 550, 400
  3462. click
  3463. ; Wants directx. Cancel. Convienent, so we know when the install is done.
  3464. winwait, Installing Microsoft
  3465. winclose
  3466. winwait, Football Manager 2010 Demo
  3467. sleep 1000
  3468. mousemove, 550, 400
  3469. click
  3470. "
  3471. if workaround_wine_bug 24417
  3472. then
  3473. sh "$WINETRICKS" -q d3dx9_36
  3474. fi
  3475. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3476. cd $programfilesdir_x86_win\\Sports Interactive\\Football Manager 2010 Demo
  3477. fm.exe
  3478. __EOF__
  3479. }
  3480. # http://www.futurepinball.com/
  3481. verblist_add futurepinball "Future Pinball (Christopher Leathley, 2008) [download]"
  3482. load_futurepinball() {
  3483. download $PACKAGE "http://members.iinet.net.au/~cleathley/downloads/FuturePinballSetup_v1.9.20081225.exe" 1d7f445c03ea508b8144cd56961c6d59136c2b1b
  3484. cd "$WISOTOOL_CACHE/$PACKAGE"
  3485. ahk_do "
  3486. SetTitleMatchMode, 2
  3487. Run, FuturePinballSetup_v1.9.20081225.exe
  3488. WinWait, Setup, Welcome to the Future
  3489. sleep 1000
  3490. ControlClick, TButton1
  3491. WinWait, Setup, License Agreement
  3492. sleep 1000
  3493. ControlClick, TRadioButton1 ; accept
  3494. sleep 1000
  3495. ;ControlClick, TButton2 ; next
  3496. send {Enter}
  3497. WinWait, Setup, Select Destination Location
  3498. sleep 1000
  3499. ControlClick, TButton3
  3500. WinWait, Folder Does Not Exist
  3501. sleep 1000
  3502. ControlClick, Button1
  3503. WinWait, Setup, Select Start Menu Folder
  3504. sleep 1000
  3505. ControlClick, TButton4
  3506. WinWait, Setup, Select Additional Tasks
  3507. sleep 1000
  3508. ControlClick, x53 y163
  3509. ControlClick, TButton4
  3510. WinWait, Setup, Ready to Install
  3511. sleep 1000
  3512. ControlClick, TButton4
  3513. WinWait, Setup, Completing the Future Pinball
  3514. sleep 1000
  3515. send {Space} ; do not launch
  3516. ControlClick, TButton4 ; finish
  3517. "
  3518. if workaround_wine_bug 8780
  3519. then
  3520. try "$WINETRICKS" -q wsh56vb dcom98
  3521. fi
  3522. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3523. ${programfilesdrive}:
  3524. cd "\\Games\\Future Pinball"
  3525. "Future Pinball.exe"
  3526. __EOF__
  3527. }
  3528. #----------------------------------------------------------------
  3529. verblist_add gothic4_demo "Gothic 4 demo (Jowood/Dreamcatcher Games, 2010) [download] (broken)" ArcaniA_Gothic4_Demo_Setup.zip
  3530. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=21507
  3531. load_gothic4_demo() {
  3532. download $PACKAGE http://gamedaily.newaol.com/pub/ArcaniA_Gothic4_Demo_Setup.zip
  3533. try mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  3534. cd "$WISOTOOL_TMP/$PACKAGE"
  3535. try unzip "$WISOTOOL_CACHE/$PACKAGE"/ArcaniA_Gothic4_Demo_Setup.zip
  3536. ahk_do "
  3537. Settitlematchmode, 2
  3538. run, ArcaniA_Gothic4_Demo_Setup.exe
  3539. winwait, Select Setup Language
  3540. sleep 1000
  3541. controlclick, TNewButton1, Select Setup Language
  3542. winwait, Setup - ArcaniA, Welcome to the
  3543. sleep 1000
  3544. controlclick, TNewButton1, Setup - ArcaniA, Welcome to the
  3545. winwait, Setup - ArcaniA, License Agreement
  3546. sleep 1000
  3547. controlclick, TNewRadioButton1, Setup - ArcaniA, License Agreement
  3548. sleep 1000
  3549. controlclick, TNewButton2, Setup - ArcaniA, License Agreement
  3550. winwait, Setup - ArcaniA, Select Destination Location
  3551. sleep 1000
  3552. controlclick, TNewButton3, Setup - ArcaniA, Select Destination Location
  3553. winwait, Setup - ArcaniA, Select Components
  3554. sleep 1000
  3555. controlclick, TNewButton3, Setup - ArcaniA, Select Components
  3556. winwait, Setup - ArcaniA, Select Start Menu
  3557. sleep 1000
  3558. controlclick, TNewButton4, Setup - ArcaniA, Select Start Menu
  3559. winwait, Setup - ArcaniA, Select Additional
  3560. sleep 1000
  3561. controlclick, TNewButton4, Setup - ArcaniA, Select Additional
  3562. winwait, Setup - ArcaniA, Ready to Install
  3563. sleep 1000
  3564. controlclick, TNewButton4, Setup - ArcaniA, Ready to Install
  3565. winwait, Setup - ArcaniA, Information
  3566. sleep 1000
  3567. controlclick, TNewButton4, Setup - ArcaniA, Information
  3568. winwait, Setup - ArcaniA, Completing
  3569. sleep 1000
  3570. ; The two checkboxes share the same button id. App/Wine bug?
  3571. mousemove, 190, 155
  3572. click
  3573. sleep 1000
  3574. mousemove, 190, 180
  3575. click
  3576. sleep 1000
  3577. controlclick, TNewButton4, Setup - ArcaniA, Completing
  3578. "
  3579. if workaround_wine_bug 21939
  3580. then
  3581. sh "$WINETRICKS" -q wmp9
  3582. fi
  3583. if workaround_wine_bug 24250
  3584. then
  3585. sh "$WINETRICKS" -q vcrun2008
  3586. fi
  3587. if workaround_wine_bug 7065
  3588. then
  3589. warn "Game has Securom protection, doesn't work in Wine yet."
  3590. fi
  3591. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3592. cd $programfilesdir_x86_win\\JoWooD Entertainment AG\\ArcaniA - Gothic 4 Demo
  3593. Arcania.exe
  3594. __EOF__
  3595. }
  3596. #----------------------------------------------------------------
  3597. verblist_add grand_ages_rome_demo "Grand Ages: Rome demo (Kalypso, 2009) " GrandAgesRome-EU-XL-Demo.exe
  3598. # http://appdb.winehq.org/objectManager.php?sClass=application&iId=9378
  3599. load_grand_ages_rome_demo() {
  3600. download $PACKAGE http://gamedaily.newaol.com/pub/GrandAgesRome-EU-XL-Demo.exe 175c0dcdd6eb7c2b928f4ece0f775772ae94d8cf
  3601. if workaround_wine_bug 24819
  3602. then
  3603. sh "$WINETRICKS" -q gameux=disabled
  3604. $WINESERVER -w
  3605. fi
  3606. cd "$WISOTOOL_CACHE/$PACKAGE"
  3607. ahk_do "
  3608. Settitlematchmode, 2
  3609. run, GrandAgesRome-EU-XL-Demo.exe
  3610. winwait, Installer Language
  3611. sleep 1000
  3612. controlclick, Button1, Installer Language
  3613. winwait, Grand Ages, Welcome to the
  3614. sleep 1000
  3615. controlclick, Button2, Grand Ages, Welcome to the
  3616. winwait, Grand Ages, Press Page Down
  3617. sleep 1000
  3618. controlclick, Button2, Grand Ages, Press Page Down
  3619. winwait, Grand Ages, Please select installation type
  3620. sleep 1000
  3621. controlclick, Button2, Grand Ages, Please select installation type
  3622. winwait, Grand Ages, Completing the Grand Ages Rome Demo
  3623. sleep 1000
  3624. controlclick, Button4, Grand Ages, Completing the Grand Ages Rome Demo
  3625. sleep 100
  3626. controlclick, Button2, Grand Ages, Completing the Grand Ages Rome Demo
  3627. "
  3628. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3629. cd $programfilesdir_x86_win\\Kalypso\\Grand Ages Rome Demo
  3630. Rome Demo.exe
  3631. __EOF__
  3632. }
  3633. #----------------------------------------------------------------
  3634. verblist_add gta_vc "Grand Theft Auto: Vice City (Rockstar, 2003) " \
  3635. e98c2d323dd0494989a844442586dc2d48fba8f9.iso \
  3636. d31f5c35cc63d804a7ffdb212f550681b97ee5b3.iso
  3637. load_gta_vc() {
  3638. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e98c2d323dd0494989a844442586dc2d48fba8f9.iso
  3639. ahk_do "
  3640. SetTitleMatchMode, 2
  3641. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  3642. winwait, Choose Setup Language
  3643. sleep 1000
  3644. Send {enter}
  3645. winwait, Grand Theft Auto Vice City, Welcome to the InstallShield Wizard
  3646. sleep 1000
  3647. Send {enter}
  3648. winwait, Grand Theft Auto Vice City, License Agreement
  3649. sleep 1000
  3650. Send !a
  3651. send {enter}
  3652. winwait, Grand Theft Auto Vice City, Customer Information
  3653. sleep 1000
  3654. controlclick, edit1
  3655. send $USERNAME
  3656. send {tab}
  3657. send company ; installer won't proceed without something here
  3658. send {enter}
  3659. winwait, Grand Theft Auto Vice City, Choose Destination Location
  3660. sleep 1000
  3661. controlclick, Button1
  3662. winwait, Grand Theft Auto Vice City, Select Components
  3663. sleep 1000
  3664. controlclick, Button2
  3665. winwait, Grand Theft Auto Vice City, Ready to Install the Program
  3666. sleep 1000
  3667. send {enter}
  3668. winwait, Setup Needs The Next Disk, Please insert disk 2
  3669. sleep 1000"
  3670. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/d31f5c35cc63d804a7ffdb212f550681b97ee5b3.iso
  3671. ahk_do "
  3672. sleep 1000
  3673. send {enter}
  3674. winwait, Grand Theft Auto Vice City, InstallShield Wizard Complete
  3675. sleep 1000
  3676. send {enter}
  3677. "
  3678. iso_umount
  3679. if workaround_wine_bug 22414
  3680. then
  3681. try "$WINETRICKS" -q quartz
  3682. fi
  3683. }
  3684. #----------------------------------------------------------------
  3685. verblist_add half_life_goty "Half Life: Game of the Year Edition (Sierra, 2000) " \
  3686. dc32c16bca6c19f14e3501e3be3e4a157ddbee20.iso
  3687. load_half_life_goty() {
  3688. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/dc32c16bca6c19f14e3501e3be3e4a157ddbee20.iso
  3689. ahk_do "
  3690. SetTitleMatchMode, 2
  3691. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  3692. winwait, System Test, Did you hear the sound file?
  3693. sleep 1000
  3694. ControlClick, Button6, System Test, Did you hear the sound file?
  3695. winwait, Welcome, Welcome to the Half-Life Setup program. This program will install Half-Life on your computer.
  3696. sleep 1000
  3697. ControlClick, Button1, Welcome, Welcome to the Half-Life Setup program. This program will install Half-Life on your computer.
  3698. winwait, Software License Agreement, Please read the following License Agreement. Press the PAGE DOWN key to see the rest of the agreement.
  3699. sleep 1000
  3700. ControlClick, Button2, Software License Agreement, Please read the following License Agreement. Press the PAGE DOWN key to see the rest of the agreement.
  3701. winwait, Choose Destination Location, Setup will install Half-Life in the following folder.
  3702. sleep 1000
  3703. ControlClick, Button1, Choose Destination Location, Setup will install Half-Life in the following folder.
  3704. winwait, Install, Setup has placed the Sierra Utilities in your Start Menu.
  3705. sleep 1000
  3706. ControlClick, Button1, Install, Setup has placed the Sierra Utilities in your Start Menu.
  3707. winwait, Install, Setup has determined that there may be updates to your product available.
  3708. sleep 1000
  3709. ControlClick, Button7, Install, Setup has determined that there may be updates to your product available.
  3710. winwait, Install, Please Register Now!
  3711. sleep 1000
  3712. ControlClick, Button1, Install, Please Register Now!
  3713. winwait, Choose Method of Registration, Please choose a registration method
  3714. sleep 1000
  3715. ControlClick, Button8, Choose Method of Registration, Please choose a registration method
  3716. winwait, Select Components, Please ensure you are running the latest drivers appropriate for your hardware
  3717. sleep 1000
  3718. ControlClick, Button11, Select Components, Please ensure you are running the latest drivers appropriate for your hardware
  3719. winwait, Setup Complete, Setup has finished installing Half-Life on your computer.
  3720. sleep 1000
  3721. ControlClick, Button1, Setup Complete, Setup has finished installing Half-Life on your computer.
  3722. Sleep 1000
  3723. ControlClick, Button4, Setup Complete, Setup has finished installing Half-Life on your computer.
  3724. "
  3725. # The key is put in on first run:
  3726. HALF_LIFE_GOTY_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/dc32c16bca6c19f14e3501e3be3e4a157ddbee20.txt`
  3727. cd $DRIVE_C/SIERRA/Half-Life
  3728. # Forcefully closing the process later will screw up the screen resolution, so store the user's current resolution so we can restore it later:
  3729. current_res=`xrandr -q | awk -F'current' -F',' 'NR==1 {gsub("( |current)","");print $2}'`
  3730. # FIXME: Not sure how reliable the ahk_class designation is...
  3731. ahk_do "
  3732. Run, hl.exe
  3733. winwait, ahk_class #32770
  3734. sleep 1000
  3735. ControlClick, Edit1, ahk_class #32770
  3736. Send {RAW}$HALF_LIFE_GOTY_KEY
  3737. sleep 1000
  3738. ControlClick, Button1, ahk_class #32770
  3739. sleep 5000
  3740. ; I tried closing it the nice way, with either PostMessage or Win_close, but neither worked
  3741. process, close, hl.exe
  3742. "
  3743. xrandr -s $current_res
  3744. }
  3745. #----------------------------------------------------------------
  3746. verblist_add hordsoforcs2_demo "Hordes of Orcs 2 Demo (Freeverse, 2010) [download]" HoO2Demo.exe
  3747. load_hordsoforcs2_demo() {
  3748. if ! test -f "$WISOTOOL_CACHE/$PACKAGE"/HoO2Demo.exe
  3749. then
  3750. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  3751. die "Please visit http://www.fileplanet.com/216619/download/Hordes-of-Orcs-2-Demo, download HoO2Demo.exe, and place it in directory $WISOTOOL_CACHE/$PACKAGE"
  3752. fi
  3753. # FIXME: check sha1sum 1ba26d35697e359f89a30915140e471fadc675da
  3754. cd "$WISOTOOL_CACHE/$PACKAGE"
  3755. ahk_do "
  3756. SetTitleMatchMode, 2
  3757. run HoO2Demo.exe
  3758. WinWait,Orcs
  3759. sleep 500
  3760. ControlFocus, Button1, Hordes ; Next
  3761. sleep 500
  3762. Send {Enter}
  3763. WinWait,Orcs,conditions
  3764. sleep 500
  3765. ControlFocus, Button4, Hordes, agree
  3766. sleep 500
  3767. Send {Space}
  3768. sleep 500
  3769. ControlFocus, Button1, Hordes ; Next
  3770. sleep 500
  3771. Send {Enter}
  3772. WinActivate,Orcs,files
  3773. sleep 500
  3774. ControlFocus Button1, Hordes ; Next
  3775. sleep 500
  3776. Send {Enter}
  3777. WinWait,Orcs,exist
  3778. sleep 500
  3779. ControlFocus, Button1, Hordes ; Yes
  3780. sleep 500
  3781. Send {Enter}
  3782. WinActivate,Orcs,T
  3783. sleep 500
  3784. ControlFocus, Button1, Hordes ; Start
  3785. sleep 500
  3786. Send {Enter}
  3787. WinWait,Orcs,E
  3788. sleep 500
  3789. ControlFocus, Button2, successfully
  3790. sleep 500
  3791. Send {Space}
  3792. "
  3793. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3794. ${programfilesdrive}:
  3795. cd "$programfilesdir_x86_win\\Hordes of Orcs 2 Demo"
  3796. HoO2.exe
  3797. __EOF__
  3798. }
  3799. #----------------------------------------------------------------
  3800. hbpdemoexe=Release_HBP_demo_PC_DD_DEMO_FINAL_348428.exe
  3801. verblist_add hphbp_demo "Harry Potter & The Half Blood Prince Demo (EA, 2009) [download]" $hbpdemoexe
  3802. load_hphbp_demo()
  3803. {
  3804. case "$LANG" in
  3805. ""|"C") die "Harry Potter won't install in the Posix locale; please do 'export LANG=en_US.UTF-8' or something like that" ;;
  3806. esac
  3807. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/$hbpdemoexe"
  3808. then
  3809. download $PACKAGE http://largedownloads.ea.com/pub/demos/HarryPotter/Release_HBP_demo_PC_DD_DEMO_Final_348428.exe dadc1366c3b5e641454aa337ad82bc8c5082bad2
  3810. fi
  3811. cd "$WISOTOOL_CACHE/$PACKAGE"
  3812. ahk_do "
  3813. SetTitleMatchMode, 2
  3814. run, $hbpdemoexe
  3815. winwait, Harry Potter, Install
  3816. controlclick, Button1, Harry Potter
  3817. winwait, Setup, License
  3818. controlclick, Button1
  3819. controlclick, Button3
  3820. winwait, Setup, License
  3821. controlclick, Button1
  3822. controlclick, Button3
  3823. winwait, Setup, Destination
  3824. controlclick, Button1
  3825. winwait, Setup, begin
  3826. controlclick, Button1
  3827. winwait, Setup, Finish
  3828. controlclick, Button1
  3829. "
  3830. cd "$olddir"
  3831. # Not sure I trust putting \U2122 in a batch file, so use a wild card to cd to the right dir.
  3832. # Have to "cd pc" as next command, or the wildcard expansion fails on wine?
  3833. # Have to be in the pc directory for the app to find its files.
  3834. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3835. ${programfilesdrive}:
  3836. cd $programfilesdir_x86_win\\Electronic Arts\\Harry Potter and the Half-Blood Prince* Demo
  3837. cd pc
  3838. hp6_demo.exe
  3839. __EOF__
  3840. }
  3841. #----------------------------------------------------------------
  3842. verblist_add hphbp "Harry Potter & The Half Blood Prince (EA, 2009)" 9590f4c4bf2d5e819014cd9b03a5d5408ae2cd7d.iso
  3843. load_hphbp()
  3844. {
  3845. case "$LANG" in
  3846. ""|"C") die "Harry Potter won't install in the Posix locale; please do 'export LANG=en_US.UTF-8' or something like that" ;;
  3847. esac
  3848. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/9590f4c4bf2d5e819014cd9b03a5d5408ae2cd7d.iso
  3849. HPHBP_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/9590f4c4bf2d5e819014cd9b03a5d5408ae2cd7d.txt | tr -d -`
  3850. ahk_do "
  3851. SetTItleMatchMode, 2
  3852. run, ${ISO_MOUNT_LETTER}:EASetup.exe
  3853. winwait, Harry Potter
  3854. send {RAW}$HPHBP_KEY
  3855. controlclick, Button2
  3856. winwait, Setup, License
  3857. controlclick, Button1
  3858. controlclick, Button3
  3859. winwait, Setup, License
  3860. controlclick, Button1
  3861. controlclick, Button3
  3862. winwait, Setup, Destination
  3863. controlclick, Button1
  3864. winwait, Setup, begin
  3865. controlclick, Button1
  3866. winwait, Setup, Finish
  3867. controlclick, Button1
  3868. "
  3869. $WINESERVER -w
  3870. iso_umount
  3871. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3872. ${programfilesdrive}:
  3873. cd $programfilesdir_x86_win\Electronic Arts\Harry Potter and the Half-Blood Prince*
  3874. cd pc
  3875. hp6.exe
  3876. __EOF__
  3877. }
  3878. #----------------------------------------------------------------
  3879. verblist_add hegemonypom_demo "Hegemony: Philip of Macedon Demo (Longbow Games, 2010) [download]" Hegemony_Philip_of_Macedon_Installer.exe
  3880. load_hegemonypom_demo()
  3881. {
  3882. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  3883. cd "$WISOTOOL_CACHE/$PACKAGE"
  3884. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Hegemony_Philip_of_Macedon_Installer.exe"
  3885. then
  3886. download $PACKAGE http://www.longbowgames.com/downloads/Hegemony%20Philip%20of%20Macedon%20Installer.exe d3d2aa020d38b594d112360ae40871662d35dea4
  3887. # Get rid of spaces in exe name, since download leaves them as %20's, and ahk_do might not make it easy to use quotes
  3888. mv Hegemony* Hegemony_Philip_of_Macedon_Installer.exe
  3889. fi
  3890. ahk_do "
  3891. SetTitleMatchMode, 2
  3892. run, Hegemony_Philip_of_Macedon_Installer.exe
  3893. winwait, Hegemony, installation
  3894. controlclick, Button2
  3895. winwait, Hegemony, License
  3896. controlclick, Button2
  3897. winwait, Hegemony, Components
  3898. controlclick, Button2
  3899. winwait, Hegemony, Install Location
  3900. controlclick, Button2
  3901. winwait, Hegemony, shortcuts
  3902. controlclick, Button2
  3903. Loop
  3904. {
  3905. ; Work around wine bug 24484
  3906. IfWinExist, Log message, IKnownFolderManager
  3907. {
  3908. send {Enter}
  3909. }
  3910. ; Work around wine bug 21261
  3911. IfWinExist, Log message, Games Explorer
  3912. {
  3913. send {Enter}
  3914. }
  3915. IfWinExist, Hegemony, has been installed
  3916. {
  3917. break
  3918. }
  3919. Sleep (2000)
  3920. }
  3921. winwait, Hegemony, has been installed
  3922. controlclick, Button4
  3923. controlclick, Button2
  3924. "
  3925. cd "$olddir"
  3926. }
  3927. #----------------------------------------------------------------
  3928. verblist_add help "How to use this tool"
  3929. load_help() {
  3930. warn "If the game is not marked with {download} or {loaded} in the menu, you have to insert its disc and give the 'load' command before you can choose that game in the menu. If the game has multiple discs, you have to do this for each disc."
  3931. warn "If the game has an install key, you have to enter that when loading the first disc. (You have to do that from the commandline, e.g. sh wisotool load=XXXX-YYYY-ZZZZ.)"
  3932. }
  3933. #----------------------------------------------------------------
  3934. honexe=HoNClient-1.0.12.1.exe
  3935. verblist_add hon "Heroes of Newerth (S2 Games, 2010) [download]" \
  3936. $honexe
  3937. load_hon()
  3938. {
  3939. download $PACKAGE http://dl.heroesofnewerth.com/$honexe 27236eca37ac7b90fe80feaf9b2c0f8eb0e49701
  3940. cd "$WISOTOOL_CACHE/$PACKAGE"
  3941. ahk_do "
  3942. SetTitleMatchMode, 2
  3943. run, $honexe
  3944. winwait, Heroes of Newerth
  3945. controlclick, Button2, Heroes of Newerth
  3946. winwait, Heroes of Newerth, License
  3947. controlclick, Button2, Heroes of Newerth, License
  3948. winwait, Heroes of Newerth, Components
  3949. controlclick, Button2, Heroes of Newerth, Components
  3950. winwait, Heroes of Newerth, Install Location
  3951. controlclick, Button2, Heroes of Newerth, Install Location
  3952. winwait, Heroes of Newerth, Start Menu
  3953. controlclick, Button2, Heroes of Newerth, Start Menu
  3954. winwait, Heroes of Newerth, Finish
  3955. controlclick, Button2, Heroes of Newerth, Finish
  3956. "
  3957. cd "$olddir"
  3958. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  3959. ${programfilesdrive}:
  3960. cd "$programfilesdir_x86_win\Heroes of Newerth"
  3961. hon.exe
  3962. __EOF__
  3963. }
  3964. #----------------------------------------------------------------
  3965. verblist_add hod3_jp_demo "The House of the Dead 3 - Japanese - Demo (SEGA, 2005) (broken in wine-1.3.3?) [download]" hod3_trial.exe
  3966. load_hod3_jp_demo() {
  3967. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/hod3_trial.exe"
  3968. then
  3969. download $PACKAGE http://www2.sega.co.jp/download/pc/hod3/hod3_trial.exe f616ac945bcbb5b897d24f3ce568c0f528801d05
  3970. fi
  3971. cd "$WISOTOOL_CACHE/$PACKAGE"
  3972. ahk_do "
  3973. SetTitleMatchMode, 2
  3974. ; Use slow matching because otherwise autohotkey cant find the 1-2-12 in the Asian text
  3975. SetTitleMatchMode, slow
  3976. run hod3_trial.exe
  3977. winwait, THE HOUSE OF THE DEAD 3,Windows
  3978. send {Enter}
  3979. winwait, THE HOUSE OF THE DEAD 3,1-2-12
  3980. Send {Up}
  3981. Send {Space}
  3982. send {Enter}
  3983. winwait, THE HOUSE OF THE DEAD 3,SEGA
  3984. send {Enter}
  3985. winwaitclose
  3986. winwait, THE HOUSE OF THE DEAD 3
  3987. send {Enter}
  3988. ; Installer crashes before putting up finished dialog, but app seems okay anyway
  3989. Loop
  3990. {
  3991. IfWinExist, THE HOUSE OF THE DEAD 3,Finish
  3992. {
  3993. WinActivate
  3994. Send {Enter} ; Finish (I hope, needs testing)
  3995. }
  3996. Process, Exist, hod3_trial.exe ; BmLauncher automatically starts after installation finished.
  3997. retVal = %ErrorLevel%
  3998. if retVal == 0
  3999. {
  4000. ; installer has crashed or exited
  4001. break
  4002. }
  4003. ; work around hang on wine
  4004. if FileExist(\"$programfilesdir_x86_win\\SEGA\\THE HOUSE OF THE DEAD3_JP_TRIAL\\hod3launch.exe\")
  4005. {
  4006. Sleep (10000)
  4007. break
  4008. }
  4009. Sleep (2000)
  4010. }
  4011. "
  4012. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4013. ${programfilesdrive}:
  4014. cd "$programfilesdir_x86_win\\SEGA\\THE HOUSE OF THE DEAD3_JP_TRIAL"
  4015. hod3launch.exe
  4016. __EOF__
  4017. }
  4018. #----------------------------------------------------------------
  4019. verblist_add kq1vga "King Quest I VGA (AGD Interactive, 2009) [download]" Kq1vga40.exe
  4020. # http://www.agdinteractive.com/games/kq1/download/download.html
  4021. # http://agdinteractive.com/countdl.php?action=download&game=11
  4022. # See also http://en.wikipedia.org/wiki/AGD_Interactive
  4023. load_kq1vga() {
  4024. download $PACKAGE http://www.glorianon.com/agdi/Kq1vga40.exe 68627cf51391a7000ba671253421b47dc2d57005
  4025. cd "$WISOTOOL_CACHE/$PACKAGE"
  4026. ahk_do "
  4027. run Kq1vga40.exe
  4028. WinWait, King's Quest I Install Program - Welcome
  4029. Send {Enter}
  4030. WinWait, King's Quest I Install Program - Information
  4031. Send {Enter}
  4032. WinWait, King's Quest I Install Program - Agreement
  4033. ;Click 248, 275 ; check agree
  4034. ;Send !n ; Next
  4035. Send {Up}{Up}{Up}{Space} ; check agree
  4036. Send {Tab}{Enter} ; Next
  4037. WinWait, King's Quest I Install Program - Directory
  4038. Send {Enter}
  4039. IfNotExist, C:\\Program Files\\AGD Interactive\\King's Quest I
  4040. {
  4041. WinWait, King's Quest I Install Program, Do you want it to be created
  4042. Send {Enter}
  4043. }
  4044. WinWait, King's Quest I Install Program - Confirmation
  4045. Send {Enter}
  4046. WinWait, King's Quest I Install Program - End
  4047. ;Sleep 1000
  4048. ;Click 184, 232 ; don't start game
  4049. ;Send {Esc}
  4050. ; Couldn't find a portable way to not start game, so let it start, then kill it
  4051. Send !x ; Exit
  4052. WinWait King's Quest I Launcher
  4053. WinClose
  4054. "
  4055. if workaround_wine_bug 23892
  4056. then
  4057. ahk_do "
  4058. winwait Adventure Game Studio
  4059. send {Enter}
  4060. "
  4061. fi
  4062. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4063. ${programfilesdrive}:
  4064. cd "$programfilesdir_x86_win\\AGD Interactive\\King's Quest I"
  4065. Kq1vga.exe
  4066. __EOF__
  4067. }
  4068. #----------------------------------------------------------------
  4069. verblist_add lhp_demo "LEGO Harry Potter Demo [Years 1-4] (Travellers Tales / WB, 2010) [download]" LEGOHarryPotterDEMO.exe
  4070. load_lhp_demo()
  4071. {
  4072. case "$LANG" in
  4073. *UTF-8*|*utf8*) ;;
  4074. *) die "This installer fails in non-utf-8 locales. Try doing export LANG=en_US.UTF-8"
  4075. esac
  4076. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/LEGOHarryPotterDEMO.exe"
  4077. then
  4078. download $PACKAGE http://static.kidswb.com/legoharrypottergame/LEGOHarryPotterDEMO.exe bb0a30ad9a7cc51c80e1bb1f3eec22e6ccc1a706
  4079. fi
  4080. cd "$WISOTOOL_CACHE/$PACKAGE"
  4081. ahk_do "
  4082. SetTitleMatchMode, 2
  4083. run, LEGOHarryPotterDEMO.exe
  4084. winwait, LEGO, language
  4085. controlclick, Button1
  4086. winwait, LEGO, License
  4087. controlclick, Button1
  4088. controlclick, Button2
  4089. winwait, LEGO, installation method
  4090. controlclick, Button2
  4091. winwait, LEGO, Finish
  4092. controlclick, Button1
  4093. "
  4094. cd "$olddir"
  4095. if workaround_wine_bug 23397
  4096. then
  4097. warn "If you have sound problems, try switching to OSS sound in winecfg"
  4098. fi
  4099. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4100. ${programfilesdrive}:
  4101. cd "$programfilesdir_x86_win\\WB Games\\LEGO*"
  4102. LEGOHarryPotterDEMO.exe
  4103. __EOF__
  4104. }
  4105. #----------------------------------------------------------------
  4106. verblist_add lol "League of Legends (Riot Games, 2009)" LeagueofLegends.exe
  4107. load_lol()
  4108. {
  4109. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=19141
  4110. # http://www.leagueoflegends.com/
  4111. # Outer installer, fetches the latest client
  4112. if ! test -f "${WISOTOOL_CACHE}/${PACKAGE}/LeagueofLegends.exe"
  4113. then
  4114. download ${PACKAGE} http://l3cdn.riotgames.com/Installer/ProdSource.06_29_2010/LeagueofLegends.exe 89cb958c6430c7840c377b61cae7939a0d276249
  4115. fi
  4116. # Holy crap this is broken under Wine! Prepare for a workaround orgy
  4117. if workaround_wine_bug 20296
  4118. then
  4119. warn "You'll need a patch from http://bugs.winehq.org/show_bug.cgi?id=20296 to avoid a crash when starting LoL"
  4120. fi
  4121. if workaround_wine_bug 21870
  4122. then
  4123. sh "$WINETRICKS" -q secur32
  4124. fi
  4125. if workaround_wine_bug 22152
  4126. then
  4127. export GC_DONT_GC=1
  4128. fi
  4129. if workaround_wine_bug 24019 'wine-1.3.[2-9]|wine-1.3.1[0-9]' # fixed in wine-1.3.2
  4130. then
  4131. # Avoid crash in downloader
  4132. warn "Please apply patch from wine bug 24019"
  4133. fi
  4134. if workaround_wine_bug 24020
  4135. then
  4136. # Avoid crash in downloader
  4137. sh "$WINETRICKS" -q vcrun2008
  4138. fi
  4139. if workaround_wine_bug 24025
  4140. then
  4141. warn "The installer's background will be white. Known wine bug, no workaround yet. See http://bugs.winehq.org/show_bug.cgi?id=24025"
  4142. fi
  4143. if ! test -d "$WISOTOOL_CACHE/$PACKAGE/LeagueofLegends"
  4144. then
  4145. cd "${WISOTOOL_CACHE}/${PACKAGE}"
  4146. ahk_do "
  4147. settitlematchmode, 2
  4148. run, LeagueofLegends.exe
  4149. winwait, League of Legends Downloader, Where would you like to save League of Legends?
  4150. sleep 1000
  4151. ; It doesn't always register this click...
  4152. while true
  4153. {
  4154. ifwinexist, League of Legends Downloader, Where would you like to save League of Legends?
  4155. {
  4156. sleep 1000
  4157. controlclick, Static21, League of Legends Downloader, Where would you like to save League of Legends?
  4158. }
  4159. else
  4160. break
  4161. }
  4162. ; After it finishing download, move the files from $DRIVE_C/users/$LOGNAME/Desktop to $WISOTOOL_CACHE/$PACKAGE
  4163. winwaitclose, League of Legends Downloader
  4164. process, close, setup.exe
  4165. process, close, PMB.exe
  4166. "
  4167. # Cache the game files. Assumes that the Desktop directory is under C:\users\$USERNAME or the equivalent on Windows
  4168. # FIXME: Make this more generic(move out of this function, so others can use it) / test on XP and Vista+
  4169. WINEDESKTOP="`$WINE cmd /c echo %USERPROFILE% | tr -d '\r' | sed 's,\\\\,\\\\\\\\,g'`"
  4170. DESKTOPDIR="`$XXXPATH -u $WINEDESKTOP`/Desktop"
  4171. mv "$DESKTOPDIR/LeagueofLegends" "$WISOTOOL_CACHE/$PACKAGE/"
  4172. fi
  4173. cd "$WISOTOOL_CACHE/$PACKAGE/LeagueofLegends"
  4174. ahk_do "
  4175. settitlematchmode, 2
  4176. run, Setup.exe
  4177. winwait, League of Legends, Welcome to the InstallShield Wizard
  4178. sleep 1000
  4179. controlclick, Button1, League of Legends, Welcome to the InstallShield Wizard
  4180. winwait, League of Legends, I &accept the terms of the license agreement
  4181. sleep 1000
  4182. controlclick, Button3, League of Legends, I &accept the terms of the license agreement
  4183. sleep 1000
  4184. controlclick, Button1, League of Legends, I &accept the terms of the license agreement
  4185. winwait, League of Legends, Please select a setup type
  4186. sleep 1000
  4187. controlclick, Button4, League of Legends, Please select a setup type
  4188. winwait, League of Legends, Click Install to begin
  4189. sleep 1000
  4190. controlclick, Button1, League of Legends, Click Install to begin
  4191. winwait, League of Legends, Click Finish to exit the wizard
  4192. sleep 1000
  4193. controlclick, Button1, League of Legends, Click Finish to exit the wizard
  4194. sleep 1000
  4195. controlclick, Button4, League of Legends, Click Finish to exit the wizard
  4196. "
  4197. if workaround_wine_bug 24015
  4198. then
  4199. sh "$WINETRICKS" -q ie6
  4200. fi
  4201. cat > "${DRIVE_C}/run-${PACKAGE}.bat" << __EOF__
  4202. C:
  4203. cd "C:\\Riot Games\\League of Legends"
  4204. lol.launcher.exe
  4205. __EOF__
  4206. set -x
  4207. # Run once to accept EULA and start autoupdater
  4208. rm -f "$DRIVE_C/Riot Games/League of Legends/patcher_lib.log"
  4209. cd "$DRIVE_C"
  4210. ahk_do "
  4211. SetTitleMatchMode, 2
  4212. run, run-$PACKAGE.bat
  4213. winwait, League of Legends Launcher,Accept
  4214. send {Enter}
  4215. "
  4216. log="$DRIVE_C/Riot Games/League of Legends/patcher_lib.log"
  4217. # Wait for autoupdate to start
  4218. while true
  4219. do
  4220. sleep 5
  4221. tail -n 2 "$log"
  4222. if test -f "$log" && ! tail -n 2 "$log" | grep "to .PATCHER_STATE_ALLTASKSCOMPLETE"
  4223. then
  4224. echo Downloader started
  4225. break
  4226. fi
  4227. done
  4228. # Wait for autoupdate to finish
  4229. while true
  4230. do
  4231. sleep 5
  4232. tail -n 2 "$log"
  4233. if tail -n 2 "$log" | grep "to .PATCHER_STATE_ALLTASKSCOMPLETE"
  4234. then
  4235. echo Downloader finished
  4236. break
  4237. fi
  4238. done
  4239. ahk_do "
  4240. SetTitleMatchMode, 2
  4241. winwait, League of Legends Launcher
  4242. winclose
  4243. "
  4244. }
  4245. verblist_add lol_standalone "League of Legends standalone client (Riot Games, 2009)" 'StandAlone_9_21_2010_NA(with%20sse2%20fix).rar'
  4246. load_lol_standalone() {
  4247. download ${PACKAGE} "http://l3cdn.riotgames.com/Installer/lol/StandAlone_9_21_2010_NA(with%20sse2%20fix).rar" 571f8fbb5bff31fe94f3f08280cb0ff6e432bde5
  4248. mkdir -p "$DRIVE_C/Riot Games"
  4249. cd "$DRIVE_C/Riot Games"
  4250. try_unrar x "$WISOTOOL_CACHE/$PACKAGE/StandAlone_9_21_2010_NA(with%20sse2%20fix).rar"
  4251. cat > "${DRIVE_C}/run-${PACKAGE}.bat" << __EOF__
  4252. C:
  4253. cd "C:\\Riot Games\\StandAlone_9_21_2010_NA"
  4254. lol.launcher.exe
  4255. __EOF__
  4256. # Holy crap this is broken under Wine! Prepare for a workaround orgy
  4257. if workaround_wine_bug 20296
  4258. then
  4259. warn "You'll need a patch from http://bugs.winehq.org/show_bug.cgi?id=20296 to avoid a crash when starting LoL"
  4260. fi
  4261. if workaround_wine_bug 21870
  4262. then
  4263. warn "Please apply patch attached to bug 21870, or client will crash on start."
  4264. fi
  4265. if workaround_wine_bug 24102 # fixed in wine-1.3.3, but wine-1.3.3 crashes in secur32 on start? wine-1.3.1 is ok...
  4266. then
  4267. # Crashes on startup in wine below 1.3.3 without this
  4268. sh "$WINETRICKS" -q d3dx9_36
  4269. fi
  4270. if workaround_wine_bug 24015
  4271. then
  4272. sh "$WINETRICKS" -q ie6_full
  4273. fi
  4274. if workaround_wine_bug 24432
  4275. then
  4276. sh "$WINETRICKS" -q vcrun2005
  4277. fi
  4278. }
  4279. #----------------------------------------------------------------
  4280. verblist_add lotsn "Launch of the Screaming Narwhal (Telltale Games / Lucasarts, 2009)" LaunchOfTheScreamingNarwhal_Setup.exe
  4281. load_lotsn()
  4282. {
  4283. if ! test -f "${WISOTOOL_CACHE}/${PACKAGE}/LaunchOfTheScreamingNarwhal_Setup.exe"
  4284. then
  4285. download ${PACKAGE} http://www.telltalegames.com/demo/launchofthescreamingnarwhal 8a9292d89fd5e7efe58e63dcfc84a05bf08ff1d6 LaunchOfTheScreamingNarwhal_Setup.exe
  4286. fi
  4287. load_gecko
  4288. cd "${WISOTOOL_CACHE}/${PACKAGE}"
  4289. chmod +x LaunchOfTheScreamingNarwhal_Setup.exe
  4290. ahk_do "
  4291. SetTitleMatchMode, 2
  4292. run, LaunchOfTheScreamingNarwhal_Setup.exe
  4293. WinWait, Setup
  4294. ControlClick Button2 ; Next
  4295. WinWait, Setup, Checking DirectX
  4296. ControlClick Button5 ; Don't check
  4297. ControlClick Button2 ; Next
  4298. WinWait, Setup, License
  4299. ControlClick Button2 ; Agree
  4300. WinWait, Setup, Location
  4301. ControlClick Button2 ; Install
  4302. WinWait, Setup, has been installed
  4303. ControlClick Button4 ; uncheck Play Now
  4304. ControlClick Button2 ; Finish
  4305. WinWaitClose
  4306. "
  4307. cd "${olddir}"
  4308. cat > "${DRIVE_C}/run-${PACKAGE}.bat" << __EOF__
  4309. ${programfilesdrive}:
  4310. cd "${programfilesdir_x86_win}\\Telltale Games\\Tales of Monkey Island\\Launch of the Screaming Narwhal"
  4311. MonkeyIsland101.exe
  4312. __EOF__
  4313. if workaround_wine_bug 22161
  4314. then
  4315. # Crashes on startup without this
  4316. sh "$WINETRICKS" -q d3dx9_36
  4317. fi
  4318. }
  4319. #----------------------------------------------------------------
  4320. verblist_add lp2bench "Lost Planet 2 Benchmark (Capcom, 2010)" LostPlanet2_Benchmark.zip
  4321. load_lp2bench()
  4322. {
  4323. # http://news.bigdownload.com/2010/08/16/lost-planet-2-pc-due-out-on-october-15-benchmark-test-released/
  4324. if ! test -f "${WISOTOOL_CACHE}/${PACKAGE}/LostPlanet2_Benchmark.zip"
  4325. then
  4326. download ${PACKAGE} http://gamedaily.newaol.com/pub/LostPlanet2_Benchmark.zip 2c9862adc81974a61a450a1865cd60decd82587c
  4327. fi
  4328. cd "${WISOTOOL_CACHE}/${PACKAGE}/"
  4329. if ! test -f "${WISOTOOL_CACHE}/${PACKAGE}/LostPlanet2_Benchmark.exe"
  4330. then
  4331. try unzip "$WISOTOOL_CACHE/$PACKAGE"/LostPlanet2_Benchmark.zip
  4332. fi
  4333. ahk_do "
  4334. SetTitleMatchMode, 2
  4335. run LostPlanet2_Benchmark.exe
  4336. winwait, LOST PLANET 2 Benchmark
  4337. sleep 1000
  4338. controlclick, Button1, LOST PLANET 2 Benchmark
  4339. winwait, LOST PLANET 2 Benchmark, Capcom and NVIDIA have worked
  4340. sleep 1000
  4341. controlclick, Button1, LOST PLANET 2 Benchmark, Capcom and NVIDIA have worked
  4342. winwait, LOST PLANET 2 Benchmark, license agreement
  4343. sleep 1000
  4344. controlclick, Button3, LOST PLANET 2 Benchmark, license agreement
  4345. sleep 1000
  4346. controlclick, Button5, LOST PLANET 2 Benchmark, license agreement
  4347. winwait, LOST PLANET 2 Benchmark, Destination Folder
  4348. sleep 1000
  4349. controlclick, Button1, LOST PLANET 2 Benchmark, Destination Folder
  4350. winwait, LOST PLANET 2 Benchmark, Ready to Install
  4351. sleep 1000
  4352. controlclick, Button1, LOST PLANET 2 Benchmark, Ready to Install
  4353. winwait, LOST PLANET 2 Benchmark, InstallShield Wizard Completed
  4354. sleep 1000
  4355. controlclick, Button3, LOST PLANET 2 Benchmark, InstallShield Wizard Completed
  4356. sleep 1000
  4357. controlclick, Button1, LOST PLANET 2 Benchmark, InstallShield Wizard Completed
  4358. "
  4359. if workaround_wine_bug 21939
  4360. then
  4361. sh "$WINETRICKS" -q wmp9
  4362. fi
  4363. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4364. ${programfilesdrive}:
  4365. cd "$programfilesdir_x86_win\\CAPCOM\\LOST PLANET 2 Benchmark Version"
  4366. .\LP2DX9.exe
  4367. __EOF__
  4368. if workaround_wine_bug 24043
  4369. then
  4370. warn "Benchmark crashes on launch, see http://bugs.winehq.org/show_bug.cgi?id=24043"
  4371. fi
  4372. }
  4373. #----------------------------------------------------------------
  4374. verblist_add lswcs "Lego Star Wars Complete Saga (Lucasarts, 2009)" dc5db10e2ad2892ba40015d3856d1d29dc55893a.iso
  4375. load_lswcs() {
  4376. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/dc5db10e2ad2892ba40015d3856d1d29dc55893a.iso
  4377. ahk_do "
  4378. run ${ISO_MOUNT_LETTER}:setup.exe
  4379. SetTitleMatchMode, 2
  4380. winwait, Choose Setup Language
  4381. send {Enter}
  4382. winwait, LEGO, License Agreement
  4383. send a{Enter}
  4384. winwait, LEGO, method
  4385. ControlClick Easy Installation
  4386. sleep 1000
  4387. winwaitclose, LEGO
  4388. "
  4389. # Installer crashes at end (http://bugs.winehq.org/show_bug.cgi?id=22529) but this doesn't seem to hurt.
  4390. # Wait for all processes to exit, else unmount will fail
  4391. $WINESERVER -w
  4392. iso_umount
  4393. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4394. ${programfilesdrive}:
  4395. cd "$programfilesdir_x86_win\\LucasArts\\LEGO Star Wars - The Complete Saga"
  4396. LEGOStarWarsSaga.exe
  4397. __EOF__
  4398. warn "This game is copy-protected, and requires the real disc in a real drive to run."
  4399. }
  4400. #----------------------------------------------------------------
  4401. # Note: may require load_harder. Result may vary in length and checksum.
  4402. verblist_add manhole "The Manhole Masterpiece Edition (Cyan, 1994)" \
  4403. 39aea1267c2b2b22a7d5c1e9f86ea1f4461457e3.iso
  4404. load_manhole() {
  4405. cd $WISOTOOL_TMP
  4406. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/39aea1267c2b2b22a7d5c1e9f86ea1f4461457e3.iso
  4407. mkdir -p "$DRIVE_C"/manhole
  4408. try cp -r "$ISO_MOUNT_ROOT"/* "$DRIVE_C"/manhole
  4409. iso_umount
  4410. if workaround_wine_bug 22502
  4411. then
  4412. warn "Run with wine-1.0 to avoid crash on startup. Also cancel when prompted to install Quicktime."
  4413. fi
  4414. }
  4415. #----------------------------------------------------------------
  4416. verblist_add masseffect2 "Mass Effect 2 (BioWare, 2010)" \
  4417. 4b817d67c8b7e8e7bc33f8cb6047210ab554fef6.iso \
  4418. 49d1f9b85203049d52a8e34b92cd7d4b96e0c8be.iso
  4419. load_masseffect2() {
  4420. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/4b817d67c8b7e8e7bc33f8cb6047210ab554fef6.iso
  4421. ME2_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/4b817d67c8b7e8e7bc33f8cb6047210ab554fef6.txt | tr -d -`
  4422. if workaround_wine_bug 22091
  4423. then
  4424. warn "Will probably hang at end of installer. If a crash dialog comes up, you can kill it, it's done."
  4425. try sh "$WINETRICKS" -q nocrashdialog
  4426. fi
  4427. if workaround_wine_bug 23126 "wine-1.3.[0-9]*"
  4428. then
  4429. try sh "$WINETRICKS" -q vcrun2005
  4430. fi
  4431. if workaround_wine_bug 23125 "wine-1.3.[0-9]*"
  4432. then
  4433. try sh "$WINETRICKS" d3dx10
  4434. fi
  4435. if workaround_wine_bug 23151
  4436. then
  4437. warn "Disabling glsl to workaround wine bug 23151. Users of nvidia cards will get weird effects without this. If you're on ATI/Intel, you can revert this with 'winetricks glsl-enable'"
  4438. try sh "$WINETRICKS" -q glsl-disable
  4439. fi
  4440. if workaround_wine_bug 22919
  4441. then
  4442. try sh "$WINETRICKS" -q physx
  4443. fi
  4444. ahk_do "
  4445. SetTitleMatchMode, 2
  4446. run, ${ISO_MOUNT_LETTER}:Setup.exe
  4447. winwait, Installer Language
  4448. send {Enter}
  4449. winwait, Mass Effect
  4450. send {Enter}
  4451. winwait, Mass Effect, License
  4452. ControlClick, Button4
  4453. ControlClick, Button2
  4454. winwait, Mass Effect, Registration Code
  4455. send {RAW}$ME2_KEY
  4456. ControlClick, Button2
  4457. winwait, Mass Effect, Install Type
  4458. ControlClick, Button2
  4459. winwait, Insert Disc
  4460. "
  4461. sleep 5
  4462. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/49d1f9b85203049d52a8e34b92cd7d4b96e0c8be.iso
  4463. ahk_do "
  4464. SetTitleMatchMode, 2
  4465. winwait, Insert Disc
  4466. ControlClick, Button4
  4467. ; on windows, the first click doesn't seem to do it, so press enter, too
  4468. sleep 1000
  4469. send {Enter}
  4470. ; Some installs may not get to this point due to an installer hang/crash (bug 22919)
  4471. ; The hang/crash happens after the Physx install but does not seem to affect gameplay
  4472. loop
  4473. {
  4474. ifwinexist, Mass Effect, Finish
  4475. {
  4476. winkill, Mass Effect
  4477. break
  4478. }
  4479. Process, exist, Installer.exe
  4480. me2pid = %ErrorLevel%
  4481. if me2pid = 0
  4482. break
  4483. sleep 1000
  4484. }
  4485. "
  4486. if workaround_wine_bug 6971
  4487. then
  4488. echo "See http://appdb.winehq.org/objectManager.php?sClass=version&iId=19125 for info on how to patch wine to work around bug 6971"
  4489. fi
  4490. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4491. ${programfilesdrive}:
  4492. cd "$programfilesdir_x86_win\Mass Effect 2\Binaries"
  4493. MassEffect2.EXE
  4494. __EOF__
  4495. }
  4496. #----------------------------------------------------------------
  4497. verblist_add masseffect2_demo "Mass Effect 2 (BioWare, 2010)" MassEffect2DemoEN.exe
  4498. load_masseffect2_demo() {
  4499. download ${PACKAGE} http://masseffect.bioware.com/cdn/A/ME2_DEMO/MassEffect2DemoEN.exe cda9a25387a98e29772b3ccdcf609f87188285e2
  4500. if workaround_wine_bug 22091
  4501. then
  4502. warn "Will probably hang at end of installer. If a crash dialog comes up, you can kill it, it's done."
  4503. try sh "$WINETRICKS" -q nocrashdialog
  4504. fi
  4505. if workaround_wine_bug 23126 "wine-1.3.[0-9]*"
  4506. then
  4507. try sh "$WINETRICKS" -q vcrun2005
  4508. fi
  4509. if workaround_wine_bug 23125 "wine-1.3.[0-9]*"
  4510. then
  4511. try sh "$WINETRICKS" d3dx10
  4512. fi
  4513. if workaround_wine_bug 23151
  4514. then
  4515. warn "Disabling glsl to workaround wine bug 23151. Users of nvidia cards will get weird effects without this. If you're on ATI/Intel, you can revert this with 'winetricks glsl-enable'"
  4516. try sh "$WINETRICKS" -q glsl-disable
  4517. fi
  4518. if workaround_wine_bug 22919
  4519. then
  4520. try sh "$WINETRICKS" -q physx
  4521. fi
  4522. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  4523. case "$OS" in
  4524. "Windows_NT")
  4525. cp "$WISOTOOL_CACHE/$PACKAGE/MassEffect2DemoEN.exe" "$WISOTOOL_TMP" ;;
  4526. *)
  4527. ln -sf "$WISOTOOL_CACHE/$PACKAGE/MassEffect2DemoEN.exe" "$WISOTOOL_TMP" ;;
  4528. esac
  4529. cd "$WISOTOOL_TMP"
  4530. ahk_do "
  4531. SetTitleMatchMode, 2
  4532. run, MassEffect2DemoEN.exe
  4533. winwait, Mass Effect 2 Demo
  4534. Sleep 1000
  4535. send {Enter}
  4536. winwait, Mass Effect 2 Demo, conflicts
  4537. Sleep 1000
  4538. send {Enter}
  4539. winwait, Mass Effect, License
  4540. ControlClick, Button4
  4541. ;ControlClick, Button2
  4542. send {Enter}
  4543. winwait, Mass Effect, Install Type
  4544. ControlClick, Button2
  4545. ; Some installs may not get to this point due to an installer hang/crash (bug 22919)
  4546. ; The hang/crash happens after the Physx install but does not seem to affect gameplay
  4547. loop
  4548. {
  4549. ifwinexist, Mass Effect, Finish
  4550. {
  4551. winkill, Mass Effect
  4552. break
  4553. }
  4554. Process, exist, Installer.exe
  4555. me2pid = %ErrorLevel%
  4556. if me2pid = 0
  4557. break
  4558. sleep 1000
  4559. }
  4560. "
  4561. if workaround_wine_bug 6971
  4562. then
  4563. echo "See http://appdb.winehq.org/objectManager.php?sClass=version&iId=19125 for info on how to patch wine to work around bug 6971"
  4564. fi
  4565. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4566. ${programfilesdrive}:
  4567. cd "$programfilesdir_x86_win\\Mass Effect 2 Demo\\Binaries"
  4568. MassEffect2.EXE
  4569. __EOF__
  4570. }
  4571. #----------------------------------------------------------------
  4572. verblist_add maxmagicmarker_demo "Download: Max & the Magic Marker Demo (2010) [download]" max_demo_pc.zip
  4573. load_maxmagicmarker_demo() {
  4574. download $PACKAGE http://www.maxandthemagicmarker.com/maxdemo/max_demo_pc.zip 1a79c583ff40e7b2cf05d18a89a806fd6b88a5d1
  4575. try mkdir "$programfilesdir_x86_unix"/$PACKAGE
  4576. cd "$programfilesdir_x86_unix"/$PACKAGE
  4577. try unzip "$WISOTOOL_CACHE/$PACKAGE"/max_demo_pc.zip
  4578. # Work around bug in game?!
  4579. mv "max and the magic markerdemo pc" "max and the magic markerdemo pc"_Data
  4580. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4581. ${programfilesdrive}:
  4582. cd "$programfilesdir_x86_win\\$PACKAGE"
  4583. max and the magic markerdemo pc.exe
  4584. __EOF__
  4585. }
  4586. #----------------------------------------------------------------
  4587. verblist_add metro2033 "Metro 2033 (THQ, 2010)" 3de89e07449c2573cd4a334b0cd7da012a98f97c.iso
  4588. load_metro2033() {
  4589. warn "You'll need to have STEAM_USER/STEAM_PASS set in your environment or in $WISOTOOL_CACHE. You'll also need your cd-key for Metro 2033 already added to your Steam Account."
  4590. if [ ! "$STEAM_USER" -a ! -f "$WISOTOOL_CACHE"/STEAM_USER ]
  4591. then
  4592. die "You need to set STEAM_USER variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_USER"
  4593. elif [ ! "$STEAM_USER" -a -f "$WISOTOOL_CACHE"/STEAM_USER ]
  4594. then
  4595. STEAM_USER=`cat "$WISOTOOL_CACHE"/STEAM_USER`
  4596. fi
  4597. if [ ! "$STEAM_PASS" -a ! -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  4598. then
  4599. die "You need to set STEAM_PASS variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_PASS"
  4600. elif [ ! "$STEAM_PASS" -a -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  4601. then
  4602. STEAM_PASS=`cat "$WISOTOOL_CACHE"/STEAM_PASS`
  4603. fi
  4604. steam_dir="$programfilesdir_unix/Steam"
  4605. # Game uses Steam to install itself
  4606. try sh $WINETRICKS -q steam
  4607. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/3de89e07449c2573cd4a334b0cd7da012a98f97c.iso
  4608. METRO_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/3de89e07449c2573cd4a334b0cd7da012a98f97c.txt | tr -d -`
  4609. cd "$steam_dir"
  4610. # Run Steam, let it update. Then, in a separate thread, run the installer.
  4611. ahk_do "
  4612. SetTitleMatchMode, 2
  4613. SetControlDelay -1
  4614. run, Steam.exe -login $STEAM_USER $STEAM_PASS
  4615. Winwait, Steam - Update News
  4616. ; Close all windows, prevent conflicts with later controlclick's
  4617. winclose, Steam - Update News
  4618. winclose, Steam
  4619. "
  4620. ahk_do "
  4621. Run, Steam.exe -install I:\\
  4622. ; Install Metro 2033
  4623. winwait, Install - Metro 2033
  4624. send, {Enter}
  4625. ; Shortcuts
  4626. sleep 10000
  4627. winwait, Install - Metro 2033
  4628. send, {Enter}
  4629. ; Installing...
  4630. sleep 10000
  4631. winwait, Install - Metro 2033
  4632. send, {Enter}
  4633. "
  4634. # Wait for install to finish
  4635. dl_log="$steam_dir/logs/download_log.txt"
  4636. while true
  4637. do
  4638. grep "SetHasAllLocalContent(true) called for 43110" "$dl_log" && break
  4639. sleep 15
  4640. done
  4641. ahk_do "
  4642. send {Enter}
  4643. sleep 1000
  4644. run, Steam.exe -shutdown
  4645. "
  4646. warn "You'll need the Xinput2 patch from http://bugs2.winehq.org/attachment.cgi?id=29313 to be able to use the mouse."
  4647. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4648. ${programfilesdrive}:
  4649. cd "$programfilesdir_x86_win\\Steam"
  4650. Steam.exe -login $STEAM_USER $STEAM_PASS -applaunch 43110
  4651. __EOF__
  4652. }
  4653. #----------------------------------------------------------------
  4654. verblist_add mise "Monkey Island: Special Edition (LucasArts, 2009)" SecretOfMonkeyIslandSE_ddsetup.zip
  4655. load_mise() {
  4656. # Archive SHA1SUM 2e32458698c9ec7ebce94ae5c57531a3fe1dbb9e
  4657. if [ ! -f "$WISOTOOL_CACHE/$PACKAGE/SecretOfMonkeyIslandSE_ddsetup.zip" ]
  4658. then
  4659. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  4660. die "Download the game from http://www.direct2drive.com/8241/product/Buy-The-Secret-of-Monkey-Island(R):-Special-Edition-Download and place in $WISOTOOL_CACHE/$PACKAGE. Place the activation code in activationcode.txt in that directory, too."
  4661. fi
  4662. if workaround_wine_bug 22161
  4663. then
  4664. # Doesn't crash, but you only get a black screen and a flood of d3dx fixme's without native d3dx9_36
  4665. sh "$WINETRICKS" -q d3dx9_36
  4666. fi
  4667. if workaround_wine_bug 24545
  4668. then
  4669. # Game wants to install directx, but we delete it. It really only needs xact for x3daudio?_?.dll
  4670. sh "$WINETRICKS" -q xact
  4671. fi
  4672. if workaround_wine_bug 24547
  4673. then
  4674. # It really does need vcrun2005, for msvp80.dll (and potentially one stub from msvcr80)
  4675. sh "$WINETRICKS" -q vcrun2005
  4676. fi
  4677. cd "$WISOTOOL_TMP"
  4678. mkdir $PACKAGE
  4679. cd $PACKAGE
  4680. # Don't extract DirectX/dotnet35 installers, they just take up extra time and aren't needed. Luckily, MISE copes well and just skips them if they are missing:
  4681. try unzip "$WISOTOOL_CACHE/$PACKAGE"/SecretOfMonkeyIslandSE_ddsetup.zip -x DirectX* dotnet*
  4682. ahk_do "
  4683. SetTitleMatchMode, 2
  4684. run, setup.exe
  4685. WinWait, The Secret of Monkey Island, This wizard will guide you
  4686. sleep 1000
  4687. ControlClick, Button2
  4688. WinWait, The Secret of Monkey Island, License Agreement
  4689. sleep 1000
  4690. ControlSend, RichEdit20A1, {CTRL}{END}
  4691. sleep 1000
  4692. ControlClick, Button4
  4693. sleep 1000
  4694. ControlClick, Button2
  4695. WinWait, The Secret of Monkey Island, Setup Type
  4696. sleep 1000
  4697. ControlClick, Button2
  4698. WinWait, The Secret of Monkey Island, Click Finish
  4699. sleep 1000
  4700. ControlClick, Button2
  4701. "
  4702. cd "$olddir"
  4703. # Activate
  4704. if test -f "$WISOTOOL_CACHE"/$PACKAGE/activationcode.txt
  4705. then
  4706. MISE_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/activationcode.txt`
  4707. ahk_do "
  4708. SetTitleMatchMode, 2
  4709. run, $programfilesdir_x86_win\\LucasArts\\The Secret of Monkey Island Special Edition\\MISE.exe
  4710. winwait, Product Activation
  4711. ControlClick, Edit1 ; Activation Code
  4712. send $MISE_KEY
  4713. ControlClick Button4 ; Activate Online
  4714. winwait, Product Activation, SUCCESSFUL
  4715. winClose
  4716. "
  4717. elif test -f "$WISOTOOL_CACHE"/$PACKAGE/unlockcode.txt
  4718. then
  4719. MISE_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/unlockcode.txt`
  4720. ahk_do "
  4721. SetTitleMatchMode, 2
  4722. run, $programfilesdir_x86_win\\LucasArts\\The Secret of Monkey Island Special Edition\\MISE.exe
  4723. winwait, Product Activation
  4724. ControlClick, Edit3 ; Unlock Code
  4725. send $MISE_KEY
  4726. ControlClick Button6 ; Activate manual
  4727. winwait, Product Activation, SUCCESSFUL
  4728. winClose
  4729. "
  4730. fi
  4731. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4732. ${programfilesdrive}:
  4733. cd "$programfilesdir_x86_win\\LucasArts\\The Secret of Monkey Island Special Edition"
  4734. MISE.exe
  4735. __EOF__
  4736. }
  4737. #----------------------------------------------------------------
  4738. verblist_add moh_beta "Medal of Honor: Beta (EA, 2010) [download]" MOHMP_Beta_PC_Client_R2_550504_Installer.zip
  4739. load_moh_beta()
  4740. {
  4741. # Archive SHA1SUM 7585700202ec305017038be4f1cb8ee1b43c24a2
  4742. file="$WISOTOOL_CACHE/$PACKAGE/MOHMP_Beta_PC_Client_R2_550504_Installer.zip"
  4743. test -f "$file" || file="$WISOTOOL_CACHE/$PACKAGE/MOH-MPBetaClient_R2550504_Installer.zip"
  4744. if ! test -f "$file"
  4745. then
  4746. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  4747. die "Download the beta from http://medalofhonor.com/beta or http://www.fileplanet.com/213429/210000/fileinfo/Medal-of-Honor---Multiplayer-Beta-Client and place in $WISOTOOL_CACHE/$PACKAGE"
  4748. fi
  4749. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  4750. try unzip -o "$file" -d "$WISOTOOL_TMP/$PACKAGE"
  4751. cd "$WISOTOOL_TMP/$PACKAGE"
  4752. ahk_do "
  4753. SetTitleMatchMode, 2
  4754. run, setup.exe
  4755. winwait, Medal of Honor, will install
  4756. controlclick, Button1
  4757. winwait, Medal of Honor, License
  4758. controlclick, Button1
  4759. controlclick, Button3
  4760. winwait, Medal of Honor, License
  4761. controlclick, Button1
  4762. controlclick, Button3
  4763. winwait, Medal of Honor, shortcuts
  4764. controlclick, Button1
  4765. winwait, Medal of Honor, Before continuing
  4766. controlclick, Button1
  4767. winwait, Medal of Honor, Finish
  4768. controlclick, Button1
  4769. "
  4770. # Game defaults to Dx10. Must force DxVersion=9
  4771. # This is identical to the BFBC2 bug. Should I file an app specific bug?
  4772. if workaround_wine_bug 22762
  4773. then
  4774. cd "$DRIVE_C/users/$USERNAME/My Documents"
  4775. if test -f "Medal of Honor MP Beta"/settings.ini
  4776. then
  4777. mv "Medal of Honor MP Beta"/settings.ini "Medal of Honor MP Beta"/oldsettings.ini
  4778. sed 's,DxVersion=auto,DxVersion=9,;
  4779. s,Fullscreen=true,Fullscreen=false,' "Medal of Honor MP Beta"/oldsettings.ini > "Medal of Honor MP Beta"/settings.ini
  4780. else
  4781. mkdir -p "Medal of Honor MP Beta"
  4782. echo "[Graphics]" > "Medal of Honor MP Beta"/settings.ini
  4783. echo "DxVersion=9" >> "Medal of Honor MP Beta"/settings.ini
  4784. fi
  4785. fi
  4786. cd "$olddir"
  4787. # fixme: Try to find a way to script this?
  4788. warn "After you sign up at http://medalofhonor.com/beta, you will receive a beta key which you will need to enter the first time you run the game."
  4789. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4790. ${programfilesdrive}:
  4791. cd "$programfilesdir_x86_win\\Electronic Arts\\Medal of Honor MP Beta"
  4792. MoHMPGame.exe
  4793. __EOF__
  4794. }
  4795. #----------------------------------------------------------------
  4796. verblist_add morrowind "The Elder Scrolls III: Morrowind (Bethesda, 2002)" \
  4797. c8368ed30d3f3fcd7fccf8bffcfcdf0a6d4cb68b.iso
  4798. load_morrowind() {
  4799. cd $WISOTOOL_TMP
  4800. # FIXME: Untested on Windows!
  4801. # FIXME: Only supports the main installer, and the construction set (which follows automatically)
  4802. # eventually should support the expansions as well
  4803. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/c8368ed30d3f3fcd7fccf8bffcfcdf0a6d4cb68b.iso
  4804. ahk_do "
  4805. SetTitleMatchMode, 2
  4806. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  4807. winwait, The Elder Scrolls III: Morrowind Setup, The Elder Scrolls III: Morrowind (License Agreement)
  4808. sleep 1000
  4809. controlclick, Button2
  4810. winwait, The Elder Scrolls III: Morrowind Setup, Please read the following important information.
  4811. sleep 1000
  4812. controlclick, Button1
  4813. winwait, The Elder Scrolls III: Morrowind Setup, Setup will install Morrowind in the following folder.
  4814. sleep 1000
  4815. controlclick, Button1
  4816. winwait, The Elder Scrolls III: Morrowind Setup, Setup has enough information to start copying the program files.
  4817. sleep 1000
  4818. controlclick, Button1
  4819. ; Then launched construction set setup
  4820. winwait, The Elder Scrolls Construction Set Setup, The Elder Scrolls Construction Set (License Agreement)
  4821. sleep 1000
  4822. Controlclick, Button2
  4823. ; No confirm screen? (FIXME: verify on windows)
  4824. winwait, The Elder Scrolls Construction Set Setup, Setup has enough information to start copying the program files
  4825. sleep 1000
  4826. controlclick, Button1
  4827. winwait, The Elder Scrolls Construction Set Setup, Setup has finished installing TES Construction Set on your computer.
  4828. sleep 1000
  4829. controlclick, Button4
  4830. ; Exits the Construction set setup on its own, and goes back to main installer
  4831. ; The text box is split into two lines separately, not using word wrap, hence the weird sentence..
  4832. winwait, Question, Would you like to register Morrowind online now? Make sure
  4833. sleep 1000
  4834. controlclick, Button2
  4835. ; Sometimes finicky here, short sleep here works around it
  4836. Sleep 10000
  4837. winwait, The Elder Scrolls III: Morrowind Setup, Setup has finished installing Morrowind on your computer.
  4838. sleep 1000
  4839. controlclick, Button4
  4840. winwait, Information, You have installed Windows XP, which includes DirectX 8.1
  4841. sleep 1000
  4842. ControlClick, Button1
  4843. exit 0"
  4844. sleep 30s
  4845. iso_umount
  4846. cd "$olddir"
  4847. }
  4848. #----------------------------------------------------------------
  4849. mnbw_demo_exe=mb_warband_setup_1113.exe
  4850. verblist_add mnbw_demo "Mount & Blade Warband Demo (Taleworlds, 2010) [download]" ${mnbw_demo_exe}
  4851. load_mnbw_demo()
  4852. {
  4853. if ! test -f "${WISOTOOL_CACHE}/${PACKAGE}/${mnbw_demo_exe}"
  4854. then
  4855. download ${PACKAGE} http://download.taleworlds.com/${mnbw_demo_exe}
  4856. fi
  4857. cd "${WISOTOOL_CACHE}/${PACKAGE}"
  4858. chmod +x ${mnbw_demo_exe}
  4859. ahk_do "
  4860. SetTitleMatchMode, 2
  4861. run, ${mnbw_demo_exe}
  4862. WinWait, Warband
  4863. ControlClick, Button2, Warband
  4864. WinWait, Warband
  4865. ControlClick, Button2, Warband
  4866. WinWait, Warband, Finish
  4867. ControlClick, Button4, Warband
  4868. ControlClick, Button2, Warband
  4869. "
  4870. cd "${olddir}"
  4871. cat > "${DRIVE_C}/run-${PACKAGE}.bat" << __EOF__
  4872. ${programfilesdrive}:
  4873. cd "${programfilesdir_x86_win}\\Mount&Blade Warband"
  4874. mb_warband.exe
  4875. __EOF__
  4876. }
  4877. #----------------------------------------------------------------
  4878. verblist_add nd23_saw_demo "Nancy Drew 23: Shadow at the Waters Edge Demo (Her Interactive, 2010)" SAW_demo1.zip
  4879. load_nd23_saw_demo() {
  4880. # http://www.herinteractive.com/Mystery_Games/Nancy_Drew/Shadow_at_the_Waters_Edge/pc
  4881. download $PACKAGE http://www.herinteractive.com/games/saw/SAW_demo1.zip 29975be19c99f7707c4da218b60e2ed0d70bf4a7
  4882. cd "$DRIVE_C"
  4883. mkdir $PACKAGE
  4884. cd $PACKAGE
  4885. try unzip "$WISOTOOL_CACHE/$PACKAGE"/SAW_demo1.zip
  4886. if workaround_wine_bug 24754
  4887. then
  4888. try sh "$WINETRICKS" -q d3dx9_36
  4889. fi
  4890. cat > "${DRIVE_C}/run-${PACKAGE}.bat" << __EOF__
  4891. c:
  4892. cd "${PACKAGE}"
  4893. Shadow.exe
  4894. __EOF__
  4895. }
  4896. #----------------------------------------------------------------
  4897. verblist_add nfsps_demo "Need For Speed: Pro Street Demo (EA, 2007)" nfsps_pcdemo.exe
  4898. load_nfsps_demo()
  4899. {
  4900. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/ps_pcdemo.exe"
  4901. then
  4902. download $PACKAGE http://largedownloads.ea.com/pub/demos/NFS/prostreet/nfsps_pcdemo.exe 9cf74563d28c29a40920e0c0644c2da6e8e2a888
  4903. fi
  4904. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  4905. cd "$WISOTOOL_CACHE/$PACKAGE"
  4906. ahk_do "
  4907. SetTitleMatchMode, 2
  4908. run, nfsps_pcdemo.exe
  4909. winwait, ProStreet, folder
  4910. send $WISOTOOL_TMP_WIN\\$PACKAGE
  4911. controlclick, Button2
  4912. winwait, ProStreet, View the readme
  4913. controlclick, Button1
  4914. winwait, ProStreet, License
  4915. controlclick, Button1
  4916. controlclick, Button3
  4917. winwait, ProStreet, License
  4918. controlclick, Button1
  4919. controlclick, Button3
  4920. winwait, ProStreet, Destination
  4921. controlclick, Button1
  4922. winwait, ProStreet, Ready
  4923. controlclick, Button1
  4924. winwait, ProStreet, Finish
  4925. controlclick, Button1
  4926. winwait, ProStreet, completed,
  4927. controlclick, Button7
  4928. controlclick, Button4
  4929. "
  4930. cd "$olddir"
  4931. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  4932. ${programfilesdrive}:
  4933. cd "$programfilesdir_x86_win\\Electronic Arts\\Need for Speed ProStreet Demo"
  4934. nfsdemo.exe
  4935. __EOF__
  4936. }
  4937. #----------------------------------------------------------------
  4938. verblist_add nfsshift "Need For Speed: Shift (EA, 2009)" 83d3b7499742ccf77da11fc2613de422c6f30572.iso
  4939. load_nfsshift()
  4940. {
  4941. if workaround_wine_bug 23324
  4942. then
  4943. msvcrun_me_harder="
  4944. winwait, Microsoft
  4945. controlclick, Button1
  4946. "
  4947. else
  4948. msvcrun_me_harder=""
  4949. fi
  4950. NFSSHIFT_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/83d3b7499742ccf77da11fc2613de422c6f30572.txt | tr -d -`
  4951. iso_mount "$WISOTOOL_CACHE/$PACKAGE/83d3b7499742ccf77da11fc2613de422c6f30572.iso"
  4952. ahk_do "
  4953. SetTitleMatchMode, 2
  4954. ; note: if this is the second run, the installer skips the registration code prompt
  4955. run, ${ISO_MOUNT_LETTER}:EASetup.exe
  4956. ; Not sure which of two or three dialogs happens next
  4957. loop
  4958. {
  4959. if winexist, SHIFT, Registration Code
  4960. {
  4961. send {RAW}$NFSSHIFT_KEY
  4962. Sleep 1000
  4963. ;controlclick, Button2
  4964. send {Enter}
  4965. break
  4966. }
  4967. if winexist, Microsoft
  4968. break
  4969. if winexist, Setup, License
  4970. break
  4971. sleep 1000
  4972. }
  4973. $msvcrun_me_harder
  4974. winwait, Setup, License
  4975. Sleep 1000
  4976. ;controlclick, Button1 ; Accept Doesn't work on vista
  4977. send a ; Accept
  4978. Sleep 1000
  4979. send {Enter}
  4980. winwait, Setup, License
  4981. Sleep 1000
  4982. controlclick, Button1
  4983. Sleep 1000
  4984. send {Enter}
  4985. winwait, Setup, Destination
  4986. Sleep 1000
  4987. controlclick, Button1
  4988. winwait, Setup, begin
  4989. Sleep 1000
  4990. controlclick, Button1
  4991. winwait, Setup, Finish
  4992. Sleep 1000
  4993. controlclick, Button5
  4994. ;controlclick, Button1 ; Finish
  4995. send {Enter} ; Finish doesn't respond to click on vista?
  4996. "
  4997. iso_umount
  4998. download $PACKAGE http://cdn.needforspeed.com/data/downloads/shift/SHIFTPCPATCHV1.02_NA.exe 3ec2bf46aeb223c369ffcb0b57c080fba67d5dd9
  4999. cd "$WISOTOOL_CACHE/$PACKAGE"
  5000. ahk_do "
  5001. SetTitleMatchMode, 2
  5002. run SHIFTPCPATCHV1.02_NA.exe
  5003. WinWait Updating
  5004. WinWaitClose Updating
  5005. "
  5006. # Need path on shift.exe, see bug 23319
  5007. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5008. ${programfilesdrive}:
  5009. cd "$programfilesdir_x86_win\\Electronic Arts\\Need for Speed SHIFT"
  5010. .\shift.exe
  5011. __EOF__
  5012. }
  5013. #----------------------------------------------------------------
  5014. verblist_add nfsshift_demo "Need For Speed: SHIFT Demo (EA, 2009) [download]" NFSSHIFTPCDEMO.exe
  5015. load_nfsshift_demo()
  5016. {
  5017. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/NFSSHIFTPCDEMO.exe"
  5018. then
  5019. download $PACKAGE http://cdn.needforspeed.com/data/downloads/shift/NFSSHIFTPCDEMO.exe 7b267654d08c54f15813f2917d9d74ec40905db7
  5020. fi
  5021. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  5022. # FIXME: use ln -s on Linux (in case user has run 'winetricks sandbox'),
  5023. # but run the package from the cache on Windows
  5024. cp "$WISOTOOL_CACHE/$PACKAGE/NFSSHIFTPCDEMO.exe" "$WISOTOOL_TMP"
  5025. cd "$WISOTOOL_TMP"
  5026. ahk_do "
  5027. SetTitleMatchMode, 2
  5028. SetTitleMatchMode, slow
  5029. run, NFSSHIFTPCDEMO.exe
  5030. winwait, WinRAR
  5031. send $PACKAGE
  5032. ControlClick, Button2
  5033. winwait, SHIFT, View the readme
  5034. controlclick, Button1
  5035. ; Not all systems need the Visual C++ runtime
  5036. loop
  5037. {
  5038. ifwinexist, Visual C++
  5039. {
  5040. controlclick, Button1
  5041. break
  5042. }
  5043. ifwinexist, Setup, SHIFT Demo License
  5044. {
  5045. break
  5046. }
  5047. sleep 1000
  5048. }
  5049. winwait, Setup, SHIFT Demo License
  5050. Sleep 1000
  5051. send {Space}
  5052. Sleep 1000
  5053. send {Enter}
  5054. winwait, Setup, DirectX
  5055. Sleep 1000
  5056. send {Space}
  5057. Sleep 1000
  5058. send {Enter}
  5059. winwait, Setup, Destination
  5060. Sleep 1000
  5061. send {Enter}
  5062. winwait, Setup, begin
  5063. Sleep 1000
  5064. controlclick, Button1
  5065. winwait, Setup, Finish
  5066. Sleep 1000
  5067. controlclick, Button5
  5068. controlclick, Button1
  5069. "
  5070. cd "$olddir"
  5071. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5072. ${programfilesdrive}:
  5073. cd "$programfilesdir_x86_win\\Electronic Arts\\Need for Speed SHIFT Demo"
  5074. shiftdemo.exe
  5075. __EOF__
  5076. }
  5077. #----------------------------------------------------------------
  5078. verblist_add oblivion "Elder Scrolls: Oblivion (Bethesda Game Studios, 2006)" 0c6826d55029e7b64150ebe804220284962657e1.iso
  5079. load_oblivion()
  5080. {
  5081. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/0c6826d55029e7b64150ebe804220284962657e1.iso
  5082. ahk_do "
  5083. SetTitleMatchMode, 2
  5084. run, ${ISO_MOUNT_LETTER}:Setup.exe
  5085. winwait, Oblivion, Welcome to the
  5086. controlclick, Button1
  5087. winwait, Oblivion, License Agreement
  5088. controlclick, Button3
  5089. controlclick, Button1
  5090. winwait, Oblivion, Choose Destination
  5091. controlclick, Button1
  5092. winwait, Oblivion, Ready to Install
  5093. controlclick, Button1
  5094. winwait, Oblivion, Complete
  5095. controlclick, Button1
  5096. controlclick, Button2
  5097. controlclick, Button3
  5098. "
  5099. iso_umount
  5100. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5101. ${programfilesdrive}:
  5102. cd "$programfilesdir_x86_win\\Bethesda Softworks Oblivion\\Oblivion"
  5103. Oblivion.exe
  5104. __EOF__
  5105. }
  5106. #----------------------------------------------------------------
  5107. verblist_add orangebox "Orange Box (Valve, 2007) " \
  5108. 976f67eec4b84331de8f6695272bc9192466da6a.iso \
  5109. b86c9297cc4c56e98f8c3f3e489091ffa4b4a11d.iso
  5110. load_orangebox() {
  5111. test -f "$programfilesdir_x86_unix"/Steam/Steam.exe || try sh $WINETRICKS -q steam
  5112. # Have to log in before you can install orangebox!
  5113. $WINE 'c:\Program Files\Steam\Steam' -login $STEAMUSER $STEAMPW
  5114. # Now, um, let it log in for a few seconds. Anyone know how to tell when it's done?
  5115. sleep 45
  5116. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/976f67eec4b84331de8f6695272bc9192466da6a.iso
  5117. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/976f67eec4b84331de8f6695272bc9192466da6a.txt | tr -d -`
  5118. ahk_do "
  5119. SetTitleMatchMode, 2
  5120. Run, ${ISO_MOUNT_LETTER}:Setup.exe
  5121. winwait, ahk_class #32770
  5122. MouseMove, 300, 365
  5123. ; user has to click Install; I can't script it!
  5124. ; FIXME: only do these steps on first run; if you've
  5125. ; already activated Orange Box on your account,
  5126. ; these don't show up.
  5127. ;winwait, Activation
  5128. ;MouseMove, 60, 400
  5129. ;Click
  5130. ;Sleep 300
  5131. ;setKeyDelay, 300
  5132. ;sendEvent {Raw}$KEY
  5133. ;; Skip notice about Team Fortress guest passes
  5134. ;winwait, News
  5135. ;MouseMove, 650, 800
  5136. ;Click
  5137. ;winwait, Activation
  5138. ;MouseMove, 310, 565
  5139. ;Click
  5140. winwait, Install
  5141. sendEvent {Enter}
  5142. ; wait for "create start menu and install" question
  5143. sleep 5000
  5144. sendEvent {Enter}
  5145. winwait, Insert
  5146. "
  5147. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/b86c9297cc4c56e98f8c3f3e489091ffa4b4a11d.iso
  5148. ahk_do "
  5149. SetTitleMatchMode, 2
  5150. Send {Enter}
  5151. winwait, ahk_class MsiDialogCloseClass, Please insert
  5152. "
  5153. iso_umount
  5154. # FIXME: how to tell when update is done? Probably have to launch all games once
  5155. # the the commandline option to exit immediately.
  5156. }
  5157. #----------------------------------------------------------------
  5158. verblist_add osmos_demo "Osmos demo (Hemisphere Games, 2009) [download]" OsmosDemo_Installer_1.5.6.exe
  5159. load_osmos_demo() {
  5160. download $PACKAGE http://gamedaily.newaol.com/pub/OsmosDemo_Installer_1.5.6.exe 7568f97100a73985a0fd625b63b205f4477578e8
  5161. cd "$WISOTOOL_CACHE/$PACKAGE"
  5162. ahk_do "
  5163. SetTitleMatchMode, 2
  5164. run OsmosDemo_Installer_1.5.6.exe
  5165. winwait, Osmos Demo Setup, License Agreement
  5166. sleep 500
  5167. controlclick, Button2, Osmos Demo Setup, License Agreement
  5168. winwait, Osmos Demo Setup, Choose Install Location
  5169. sleep 500
  5170. controlclick, Button2, Osmos Demo Setup, Choose Install Location
  5171. winwait, Osmos Demo Setup, Choose Start Menu Folder
  5172. sleep 500
  5173. controlclick, Button2, Osmos Demo Setup, Choose Start Menu Folder
  5174. winwait, Osmos Demo Setup, Installation Complete
  5175. sleep 500
  5176. controlclick, Button2, Osmos Demo Setup, Installation Complete
  5177. "
  5178. if workaround_wine_bug 24416
  5179. then
  5180. sh "$WINETRICKS" -q vcrun2005
  5181. fi
  5182. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5183. ${programfilesdrive}:
  5184. cd "$programfilesdir_x86_win\\OsmosDemo"
  5185. OsmosDemo.exe
  5186. __EOF__
  5187. }
  5188. #----------------------------------------------------------------
  5189. verblist_add pcmark04 "PC Mark 04 (Futuremark, 2004) [download]" PCMark04_v130_installer.exe
  5190. load_pcmark04() {
  5191. # http://www.futuremark.com/download/pcmark04/
  5192. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/PCMark04_v130_installer.exe"
  5193. then
  5194. die "Sorry, you have to download PCMark04_v130_installer.exe yourself and put it in $WISOTOOL_CACHE/$PACKAGE/PCMark04_v130_installer.exe"
  5195. fi
  5196. warn "Please don't use mouse while this installer is running. Sorry..."
  5197. cd "$WISOTOOL_CACHE/$PACKAGE"
  5198. ahk_do "
  5199. SetTitleMatchMode, 2
  5200. run PCMark04_v130_installer.exe
  5201. ; Skip past the two windows warning about WMP9 etc.
  5202. WinWait, Information
  5203. Send {Enter}
  5204. WinWaitClose, Information
  5205. WinWait, Information
  5206. Send {Enter}
  5207. WinWait ahk_class #32770, Welcome
  5208. Send {Enter}
  5209. WinWait, ahk_class #32770, License
  5210. Send a ; Accept
  5211. Send {Enter} ; Next
  5212. Sleep 3000 ; Wait for Destination window
  5213. Send {Enter}
  5214. Sleep 3000 ; Wait for Install window
  5215. Send {Enter}
  5216. ; Wait for install to finish
  5217. WinWait, PCMark04, Registration
  5218. ; Purchase later
  5219. ; This window won't activate any other way!
  5220. MsgBox, 32, , Preparing your dungeon. Why not enjoy a delicious slime mold while you wait?, 1
  5221. Send {Enter}
  5222. Sleep 3000
  5223. ; Uncheck readme
  5224. Send {Space}
  5225. Send {Tab}
  5226. Send {Tab}
  5227. Send {Enter}
  5228. "
  5229. if workaround_wine_bug 22402
  5230. then
  5231. warn "You may need to apply the patch from bug 22402 to avoid a crash in the tumbling blocks test."
  5232. fi
  5233. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5234. ${programfilesdrive}:
  5235. cd "$programfilesdir_x86_win\Futuremark\PCMark04"
  5236. PCMark04
  5237. __EOF__
  5238. }
  5239. #----------------------------------------------------------------
  5240. verblist_add pcmark05 "PC Mark 05 (Futuremark, 2005) [download]" PCMark05_v120_1901.exe
  5241. load_pcmark05() {
  5242. # http://www.futuremark.com/download/pcmark05/
  5243. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/PCMark05_v120_1901.exe"
  5244. then
  5245. download $PACKAGE http://www.bulletproofnerds.com/uploadedfiles/futuremark/PCMark05_v120_1901.exe 8636fce0e4023cd59bcf7f3e1a027e233ee81193
  5246. fi
  5247. warn "Don't use mouse while this installer is running. Sorry..."
  5248. cd "$WISOTOOL_CACHE/$PACKAGE"
  5249. ahk_do "
  5250. SetTitleMatchMode, 2
  5251. run PCMark05_v120_1901.exe
  5252. ; Skip past the two windows warning about WMP10 etc.
  5253. WinWait, Information
  5254. Send {Enter}
  5255. WinWaitClose, Information
  5256. WinWait, Information
  5257. Send {Enter}
  5258. WinWait ahk_class #32770, Welcome
  5259. Send {Enter}
  5260. WinWait, ahk_class #32770, License
  5261. Send a ; Accept
  5262. Send {Enter} ; Next
  5263. Sleep 3000 ; Wait for 2nd Welcome window
  5264. Send {Enter}
  5265. Sleep 3000 ; Wait for Destination window
  5266. Send {Enter}
  5267. Sleep 3000 ; Wait for Install window
  5268. Send {Enter}
  5269. ; Wait for install to finish
  5270. WinWait, PCMark05, Registration
  5271. ; Purchase later
  5272. ; This window won't activate any other way!
  5273. MsgBox, 32, , Preparing your dungeon. Why not enjoy a delicious slime mold while you wait?, 1
  5274. Send {Enter}
  5275. Sleep 2000
  5276. ; Uncheck readme
  5277. Send {Space}
  5278. Send {Tab}
  5279. Send {Tab}
  5280. Send {Enter}
  5281. "
  5282. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5283. ${programfilesdrive}:
  5284. cd "$programfilesdir_x86_win\Futuremark\PCMark05"
  5285. PCMark05
  5286. __EOF__
  5287. }
  5288. #----------------------------------------------------------------
  5289. # Not finished
  5290. #verblist_add passmark7 "Performance Test 7 (Passmark, 2010) [download]" petst.exe
  5291. load_passmark7() {
  5292. # http://www.passmark.com/download/pt_download.htm
  5293. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/petst.exe"
  5294. then
  5295. download $PACKAGE http://www.passmark.com/ftp/petst.exe 6d9db9c1bc53452cf7a2d3ad07a1195218095f8f
  5296. fi
  5297. cd "$WISOTOOL_CACHE/$PACKAGE"
  5298. ahk_do "
  5299. run petst.exe
  5300. "
  5301. warn "TODO: finish."
  5302. }
  5303. #----------------------------------------------------------------
  5304. verblist_add pscs5 "Photoshop CS5 Demo (Adobe, 2010)" \
  5305. Photoshop_12_LS1.7z \
  5306. Photoshop_12_LS1.exe
  5307. load_pscs5() {
  5308. try cd "$WISOTOOL_CACHE/$PACKAGE"
  5309. if [ ! -f "$WISOTOOL_CACHE/$PACKAGE/Photoshop_12_LS1.7z" ]
  5310. then
  5311. die "You must download Photoshop CS5 trial files and put them in $WISOTOOL_CACHE/$PACKAGE"
  5312. else
  5313. verify_sha1sum 0d8fac96f32963194add553b8ca072c40ca4b912 Photoshop_12_LS1.7z
  5314. fi
  5315. if [ ! -f "$WISOTOOL_CACHE/$PACKAGE/Photoshop_12_LS1.exe" ]
  5316. then
  5317. die "You must download Photoshop CS5 trial files and put them in $WISOTOOL_CACHE/$PACKAGE"
  5318. else
  5319. verify_sha1sum abbfeeef9348c79b6cdde5f8762f5c3f96d32f6e Photoshop_12_LS1.exe
  5320. fi
  5321. try Photoshop_12_LS1.exe /s /x /d .
  5322. try cd "Adobe CS5"
  5323. if workaround_wine_bug 22679
  5324. then
  5325. try sh "$WINETRICKS" -q msxml3
  5326. fi
  5327. warn "Try not to have anything else running, cs5 will complain if firefox is running, and the mouse clicks here are sensitive"
  5328. # Doesn't have clickable buttons, resorting to window positions. May break on non standard dpi settings.
  5329. # Not sure how to detect when the window changes. They all have the same title, and no text is visible to AHK.
  5330. # As a dirty workaround, may try detecting the color on the left side which shows the menu. The current step is darker
  5331. # than the rest.
  5332. ahk_do "
  5333. SetTitleMatchMode, 2
  5334. run Set-up.exe
  5335. winwait, Adobe Photoshop CS5
  5336. sleep 2000
  5337. ControlClick, X750 Y550, Adobe Photoshop CS5
  5338. sleep 2000
  5339. winwait, Adobe Photoshop CS5
  5340. sleep 2000
  5341. ControlClick, X300 Y350, Adobe Photoshop CS5
  5342. sleep 2000
  5343. ControlClick, X700 Y340, Adobe Photoshop CS5
  5344. Send, {Down}{Down}{Enter} ; Choose US English
  5345. sleep 2000
  5346. ControlClick, X750 Y550, Adobe Photoshop CS5
  5347. sleep 2000
  5348. winwait, Adobe Photoshop CS5
  5349. sleep 2000
  5350. ControlClick, X750 Y550, Adobe Photoshop CS5
  5351. ; Installs in about 5 minutes here, but that's not a reliable number.
  5352. ; The final window is indistinguishable from the previous, except that it has a button that the former does not.
  5353. ; Exploit that to close the installer gracefully.
  5354. Loop
  5355. {
  5356. ; Loop every 30 seconds while the installer window is present, and try to click the 'Done' button.
  5357. ; If the window doesn't exist, installer is finally done.
  5358. IfWinExist, Adobe Photoshop CS5
  5359. {
  5360. ControlClick, X750 Y550, Adobe Photoshop CS5
  5361. Sleep 30000
  5362. }
  5363. else break
  5364. }
  5365. "
  5366. try cd ..
  5367. # Remove installer temp files:
  5368. try cd "$WISOTOOL_CACHE/$PACKAGE"
  5369. try rm -rf "Photoshop CS5 Read Me.pdf" "Adobe CS5"
  5370. try cd "$olddir"
  5371. }
  5372. verblist_add pscs5_pickle "Photoshop CS5 Demo (Adobe, 2010)"
  5373. load_pscs5_pickle() {
  5374. warn "This will tar up Photoshop CS5's files from a Windows install, along with needed registry entries, for use in wine with load_pscs5_unpickle()"
  5375. if [ ! -d "$programfilesdir_x86_win/Adobe/Adobe Photoshop CS5/" ]
  5376. then
  5377. load_pscs5
  5378. fi
  5379. try cd "$WISOTOOL_TMP"
  5380. # Setup a skeleton file structure:
  5381. try rm -rf cs5_temp
  5382. try mkdir -p cs5_temp/"Common Files"
  5383. try mkdir -p cs5_temp/"Program Files"
  5384. try mkdir -p cs5_temp/"userhome"
  5385. try cd cs5_temp
  5386. try sleep 1 # Potential race condition, caught me a couple times
  5387. # First, the registry entries:
  5388. try reg.exe export HKLM\\Software\\Adobe adobe_cs5.reg
  5389. # Then the files:
  5390. userprofile_unix="`cygpath $USERPROFILE`"
  5391. system32_unix="`cygpath $WINDIR/system32`"
  5392. try cd "Common Files"
  5393. try cp -r "$programfilesdir_x86_unix/Common Files/Adobe" .
  5394. try cd ../"Program Files"
  5395. try cp -r "$programfilesdir_x86_unix/Adobe" .
  5396. try cd ../userhome
  5397. try cp -r "$appdata_unix/Adobe" .
  5398. try cd ..
  5399. try cp "$system32_unix/odbc32.dll" .
  5400. try cp "$system32_unix/odbcint.dll" .
  5401. try cd "$WISOTOOL_TMP"/cs5_temp
  5402. try tar -c -f "$olddir/adobe_cs5.tar" *
  5403. try cd ..
  5404. try rm -rf cs5_temp
  5405. try cd "$olddir"
  5406. }
  5407. verblist_add pscs5_unpickle "Photoshop CS5 Demo (Adobe, 2010)" \
  5408. adobe_cs5.tar
  5409. load_pscs5_unpickle() {
  5410. warn "This will install Photoshop CS5's files from a Windows install made with pscs5_pickle()"
  5411. # Install dependencies:
  5412. try sh "$WINETRICKS" -q gdiplus ie6 msxml3 vcrun2005sp1 vcrun2008
  5413. try cd "$WISOTOOL_TMP"
  5414. try tar xf "$WISOTOOL_CACHE/$PACKAGE/adobe_cs5.tar"
  5415. try $WINE regedit adobe_cs5.reg
  5416. try cd "$programfilesdir_x86_unix"
  5417. try mv "$WISOTOOL_TMP/Program Files/Adobe" .
  5418. try cd "Common Files"
  5419. try mv "$WISOTOOL_TMP/Common Files/Adobe" .
  5420. try cd "$appdata_win/"
  5421. try mv "$WISOTOOL_TMP/userhome"/* .
  5422. try cd "$WINDIR/system32"
  5423. try mv "$WISOTOOL_TMP/odbc32.dll" .
  5424. try mv "$WISOTOOL_TMP/odbcint.dll" .
  5425. try $WINE regsvr32 odbc32.dll
  5426. try $WINE regsvr32 odbcint.dll
  5427. warn "Do not report bugs to wine with an installation done this way. Wait until the installer bugs are fixed or have patches to workaround them!"
  5428. warn "On the first run, it will tell you your trial has 0 days left. On the second run and after, it will say 30 days."
  5429. }
  5430. #----------------------------------------------------------------
  5431. verblist_add plantsvszombies "Plants vs. Zombies (PopCap Games, 2009) [download]" PlantsVsZombiesSetup.exe
  5432. load_plantsvszombies() {
  5433. if ! test -f "$WISOTOOL_CACHE/plantsvszombies/PlantsVsZombiesSetup.exe"
  5434. then
  5435. download plantsvszombies "http://downloads.popcap.com/www/popcap_downloads/PlantsVsZombiesSetup.exe" c46979be135ef1c486144fa062466cdc51b740f5
  5436. fi
  5437. cd "$WISOTOOL_CACHE/plantsvszombies"
  5438. ahk_do "
  5439. run PlantsVsZombiesSetup.exe
  5440. winwait, Plants vs. Zombies Installer
  5441. send {Enter}
  5442. winwait, Plants vs. Zombies License Agreement
  5443. ControlClick Button1
  5444. winwait, Plants vs. Zombies Installation Complete!
  5445. send {Space}{Enter}
  5446. ControlClick, x309 y278, Plants vs. Zombies Installation Complete!,,,, Pos
  5447. "
  5448. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5449. ${programfilesdrive}:
  5450. cd "$programfilesdir_x86_win\PopCap Games\Plants vs. Zombies"
  5451. PlantsVsZombies
  5452. __EOF__
  5453. }
  5454. #----------------------------------------------------------------
  5455. verblist_add pop2008 "Prince of Persia (Ubisoft, 2008)" e65acd04baaf84481b79589b795edb144d24d1b5.iso
  5456. load_pop2008()
  5457. {
  5458. iso_mount "$WISOTOOL_CACHE/$PACKAGE/e65acd04baaf84481b79589b795edb144d24d1b5.iso"
  5459. ahk_do "
  5460. SetTitleMatchMode, 2
  5461. run, ${ISO_MOUNT_LETTER}:Setup.exe
  5462. winwait, Prince of Persia, Language
  5463. sleep 1000
  5464. ControlClick, Button3
  5465. winwait, Prince of Persia, Welcome
  5466. sleep 1000
  5467. ControlClick, Button1
  5468. winwait, Prince of Persia, License
  5469. sleep 1000
  5470. ControlClick, Button5
  5471. sleep 1000
  5472. ControlClick, Button2
  5473. winwait, Prince of Persia, Click Install
  5474. sleep 1000
  5475. ControlClick, Button1
  5476. winwait, Prince of Persia, Click Finish
  5477. sleep 1000
  5478. ControlClick, Button4
  5479. "
  5480. iso_umount
  5481. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5482. ${programfilesdrive}:
  5483. cd "$programfilesdir_x86_win\\Ubisoft\\Prince of Persia"
  5484. Prince of Persia.exe
  5485. __EOF__
  5486. }
  5487. #----------------------------------------------------------------
  5488. verblist_add popfs "Prince of Persia The Forgotten Sands (Ubisoft, 2010)" \
  5489. bab557c2a75ad67fd1a10804ecd2fb5e5890f03e.iso
  5490. load_popfs()
  5491. {
  5492. iso_mount "$WISOTOOL_CACHE/$PACKAGE/bab557c2a75ad67fd1a10804ecd2fb5e5890f03e.iso"
  5493. ahk_do "
  5494. SetTitleMatchMode, 2
  5495. run, ${ISO_MOUNT_LETTER}:Setup.exe
  5496. winwait, Prince of Persia, Language
  5497. ControlClick, Button3
  5498. winwait, Prince of Persia, Welcome
  5499. ControlClick, Button1
  5500. winwait, Prince of Persia, License
  5501. ControlClick, Button5
  5502. ControlClick, Button2
  5503. winwait, Prince of Persia, Click Install
  5504. ControlClick, Button1
  5505. ;Avoid error when creating desktop shortcut
  5506. Loop
  5507. {
  5508. IfWinActive, Prince of Persia, Click Finish
  5509. break
  5510. IfWinExist, Prince of Persia, desktop shortcut
  5511. {
  5512. ControlClick, Button1, Prince of Persia, desktop shortcut
  5513. break
  5514. }
  5515. sleep 5000
  5516. }
  5517. winwait, Prince of Persia, Click Finish
  5518. ControlClick, Button4
  5519. "
  5520. iso_umount
  5521. if workaround_wine_bug 24346
  5522. then
  5523. sh "$WINETRICKS" -q dsoundbug9612
  5524. fi
  5525. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5526. ${programfilesdrive}:
  5527. cd "$programfilesdir_x86_win\\Ubisoft\\Prince of Persia The Forgotten Sands"
  5528. Prince of Persia.exe
  5529. __EOF__
  5530. }
  5531. #----------------------------------------------------------------
  5532. verblist_add popsot "Prince of Persia Sands of Time (Ubisoft, 2003)" \
  5533. a55dc7459b0e8b40b49c16e62761932c90b6ede2.iso
  5534. load_popsot()
  5535. {
  5536. iso_mount "$WISOTOOL_CACHE/$PACKAGE/a55dc7459b0e8b40b49c16e62761932c90b6ede2.iso"
  5537. ahk_do "
  5538. SetTitleMatchMode, 2
  5539. run, ${ISO_MOUNT_LETTER}:Setup.exe
  5540. winwait, Prince of Persia, Language
  5541. ControlClick, Button3
  5542. winwait, Prince of Persia, Welcome
  5543. ControlClick, Button1
  5544. winwait, Prince of Persia, License
  5545. ControlClick, Button3
  5546. ControlClick, Button1
  5547. winwait, Prince of Persia, Destination
  5548. ControlClick, Button1
  5549. winwait, Question, Proceed
  5550. ControlClick, Button6
  5551. winwait, Prince of Persia, Acrobat Reader
  5552. ControlClick, Button2
  5553. ControlClick, Button11
  5554. winwait, Prince of Persia, Complete
  5555. ControlClick, Button1
  5556. ControlClick, Button4
  5557. sleep 6000
  5558. IfWinExist, register
  5559. {
  5560. ControlClick, OK, register
  5561. }
  5562. "
  5563. iso_umount
  5564. }
  5565. #----------------------------------------------------------------
  5566. verblist_add popsot_demo "Prince of Persia Sands of Time Demo (Ubisoft, 2003)" \
  5567. POP_Demo_Eng.exe
  5568. load_popsot_demo()
  5569. {
  5570. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/POP_Demo_Eng.exe" && ! test -f "$WISOTOOL_CACHE/$PACKAGE/pop_demo_eng.exe"
  5571. then
  5572. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  5573. die "You must manually download the Prince of Persia Sands of Time Demo to $WISOTOOL_CACHE/$PACKAGE/pop_demo_eng.exe; expected sha1sum ed62f4da1f898c661ca09bd4e3a22e4a983a822b"
  5574. fi
  5575. cd "$WISOTOOL_CACHE/$PACKAGE"
  5576. ahk_do "
  5577. SetTitleMatchMode, 2
  5578. run, POP_Demo_Eng.exe
  5579. winwait, Prince of Persia, To continue
  5580. ControlClick, Next, Prince of Persia, To continue
  5581. winwait, Prince of Persia, License Agreement
  5582. ControlClick, Button3, Prince of Persia
  5583. ControlClick, Next, Prince of Persia
  5584. sleep 1000
  5585. IfWinExist, Minimum Configuration
  5586. {
  5587. send {Enter}
  5588. }
  5589. winwait, Prince of Persia, Choose Destination
  5590. ControlClick, Next, Prince of Persia, Choose Destination
  5591. winwait, Question
  5592. ControlClick, Yes, Question
  5593. winwait, Prince of Persia, Installing game
  5594. winwaitclose, Prince of Persia, Installing game
  5595. sleep 3000
  5596. IfWinExist, Prince of Persia, Setup has detected
  5597. {
  5598. ControlClick, Button2, Prince of Persia, Setup has detected
  5599. ControlClick, Next, Prince of Persia, Setup has detected
  5600. }
  5601. sleep 6000
  5602. IfWinExist, register
  5603. {
  5604. ControlClick, OK, register
  5605. }
  5606. winwait, Prince of Persia, View the Readme
  5607. ControlClick, Button1, Prince of Persia, View the Readme
  5608. ControlClick, Finish, Prince of Persia, View the Readme
  5609. "
  5610. cd "$olddir"
  5611. warn "Once you're in the Prince of Persia game, turn off fog or you won't be able to see anything (see wine bug 17423 for explanation, but this isn't a wine bug)"
  5612. }
  5613. #----------------------------------------------------------------
  5614. verblist_add procycling08_demo "Pro Cycling Manager 2008 Demo (Cyanide, 2008) [download, broken in wine]" ProCyclingManager08_Demo.exe
  5615. load_procycling08_demo()
  5616. {
  5617. # FIXME sha1sum 008b91a16c388c9965faaeaaa8242409b9db56b9
  5618. # FIXME homepage http://www.cycling-manager.com/
  5619. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/ProCyclingManager08_Demo.exe"
  5620. then
  5621. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  5622. die "Please download the game to $WISOTOOL_CACHE/$PACKAGE/ProCyclingManager08_Demo.exe from e.g. http://www.fileplanet.com/189566/download/Pro-Cycling-Manager---Tour-de-France-2008---Demo , sha1sum should be 008b91a16c388c9965faaeaaa8242409b9db56b9"
  5623. fi
  5624. cd "$WISOTOOL_CACHE/$PACKAGE"
  5625. ahk_do "
  5626. SetTitleMatchMode, 2
  5627. run, ProCyclingManager08_Demo.exe
  5628. winwait, Pro Cycling Manager, This will
  5629. ControlClick, TButton1, Pro Cycling Manager, This will ; Next
  5630. winwait, Pro Cycling, License
  5631. ControlClick, TRadioButton1, Pro Cycling, License ; Accept License
  5632. ControlClick, TButton2, Pro Cycling, License ; Next
  5633. winwait, Pro Cycling, following folder
  5634. ControlClick, TButton3, Pro Cycling, following folder ; Next
  5635. winwait, Pro Cycling, shortcuts
  5636. ControlClick, TButton4, Pro Cycling, shortcuts ; Next
  5637. winwait, Pro Cycling, Click Install
  5638. ControlClick, TButton4, Pro Cycling, Click Install ; Install
  5639. winwait, Pro Cycling, finished
  5640. ControlClick, TButton4, Pro Cycling, finished ; Finish
  5641. "
  5642. cd "$olddir"
  5643. if workaround_wine_bug 17512
  5644. then
  5645. warn "This game crashes under Wine; see http://bugs.winehq.org/show_bug.cgi?id=17512"
  5646. fi
  5647. }
  5648. #----------------------------------------------------------------
  5649. verblist_add proevolution2010_demo "Pro Evolution Soccer 2010 Demo (Konami, 2009) [download]" PES2010_PC_DEMO_Setup.exe
  5650. load_proevolution2010_demo()
  5651. {
  5652. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=18148
  5653. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/PES2010_PC_DEMO_Setup.exe"
  5654. then
  5655. download $PACKAGE http://gamedaily.newaol.com/pub/PES2010_PC_DEMO_Setup.exe a1c913c367f121adf5f6e4104c76ab48f8d9457e
  5656. fi
  5657. cd "$WISOTOOL_CACHE/$PACKAGE"
  5658. ahk_do "
  5659. SetTitleMatchMode, 2
  5660. run, PES2010_PC_DEMO_Setup.exe
  5661. winwait, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, WARNING: This program is protected
  5662. sleep 1000
  5663. ControlClick, Button1, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, WARNING: This program is protected ; Next
  5664. winwait, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, Please read the following
  5665. sleep 1000
  5666. ControlClick, Button3, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, Please read the ; Accept license
  5667. sleep 1000
  5668. ControlClick, Button5, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, Please read the following license ; Next
  5669. winwait, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, Click Next to install to this folder
  5670. sleep 1000
  5671. ControlClick, Button1, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, Click Next to install to this folder ; Next
  5672. winwait, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, The wizard is ready to begin installation
  5673. sleep 1000
  5674. ControlClick, Button1, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, The wizard is ready to begin installation. ; Install
  5675. winwait, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, InstallShield Wizard Completed
  5676. sleep 1000
  5677. ControlClick, Button1, Pro Evolution Soccer 2010 DEMO - InstallShield Wizard, InstallShield Wizard Completed ; Finished
  5678. "
  5679. cd "$olddir"
  5680. if workaround_wine_bug 23104
  5681. then
  5682. try sh "$WINETRICKS" -q d3dx9_36
  5683. fi
  5684. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5685. ${programfilesdrive}:
  5686. cd "$programfilesdir_x86_win\\KONAMI\\Pro Evolution Soccer 2010 DEMO"
  5687. pes2010.exe
  5688. __EOF__
  5689. }
  5690. #----------------------------------------------------------------
  5691. verblist_add proevolution2011_demo "Pro Evolution Soccer 2011 Demo (Konami, 2010) [download][broken on wine]" PES2011_Demo.exe
  5692. load_proevolution2011_demo()
  5693. {
  5694. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=18148
  5695. # http://www.bigdownload.com/games/pro-evolution-soccer-2011/pc/pro-evolution-soccer-2011-demo/
  5696. download $PACKAGE http://gamedaily.newaol.com/pub/PES2011_Demo.exe 48e281177651637f549fb0ee5b8c4f91affb809a
  5697. if workaround_wine_bug 24438
  5698. then
  5699. warn "Installer probably won't work, see http://bugs.winehq.org/show_bug.cgi?id=24438"
  5700. fi
  5701. # Copied from 2010, the first few dialogs are the same, but can't test all of it because of bug 24438.
  5702. cd "$WISOTOOL_CACHE/$PACKAGE"
  5703. ahk_do "
  5704. SetTitleMatchMode, 2
  5705. run, PES2011_Demo.exe
  5706. winwait, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, WARNING: This program is protected
  5707. sleep 1000
  5708. ControlClick, Button1, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, WARNING: This program is protected ; Next
  5709. winwait, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, Please read the following
  5710. sleep 1000
  5711. ControlClick, Button3, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, Please read the ; Accept license
  5712. sleep 1000
  5713. ControlClick, Button5, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, Please read the following license ; Next
  5714. winwait, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, Click Next to install to this folder
  5715. sleep 1000
  5716. ControlClick, Button1, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, Click Next to install to this folder ; Next
  5717. winwait, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, The wizard is ready to begin installation
  5718. sleep 1000
  5719. ControlClick, Button1, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, The wizard is ready to begin installation. ; Install
  5720. winwait, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, InstallShield Wizard Completed
  5721. sleep 1000
  5722. ControlClick, Button1, Pro Evolution Soccer 2011 DEMO - InstallShield Wizard, InstallShield Wizard Completed ; Finished
  5723. "
  5724. cd "$olddir"
  5725. if workaround_wine_bug 23104
  5726. then
  5727. sh "$WINETRICKS" d3dx9_36
  5728. fi
  5729. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5730. ${programfilesdrive}:
  5731. cd "$programfilesdir_x86_win\\KONAMI\\Pro Evolution Soccer 2011 DEMO"
  5732. pes2011demo.exe
  5733. __EOF__
  5734. }
  5735. #----------------------------------------------------------------
  5736. verblist_add rom "Runes of Magic (Frogster Interactive, 2009) [download]" \
  5737. Runes_of_Magic_3.0.1.2153.part1.exe \
  5738. Runes_of_Magic_3.0.1.2153.part2.rar
  5739. load_rom()
  5740. {
  5741. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Runes_of_Magic_3.0.1.2153.part1.exe" || ! test -f "$WISOTOOL_CACHE/$PACKAGE/Runes_of_Magic_3.0.1.2153.part2.rar"
  5742. then
  5743. download $PACKAGE http://frogster.vo.llnwd.net/o9/FOG/rom/Runes_of_Magic_3.0.1.2153_two.exe/Runes_of_Magic_3.0.1.2153.part1.exe 3263660262c6411f179e80c5ef0906c783d7bb08
  5744. download $PACKAGE http://frogster.vo.llnwd.net/o9/FOG/rom/Runes_of_Magic_3.0.1.2153_two.exe/Runes_of_Magic_3.0.1.2153.part2.rar 569dee9c375fa50394958daa9f8d8a1b02bb9b11
  5745. fi
  5746. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/cached/ROMSetup.exe"
  5747. then
  5748. # Pre-extract files, if unrar is available
  5749. mkdir -p "$WISOTOOL_CACHE/$PACKAGE/cached"
  5750. cd "$WISOTOOL_CACHE/$PACKAGE/cached"
  5751. try_unrar e ../Runes_of_Magic_3.0.1.2153.part1.exe
  5752. fi
  5753. # manual updates from http://forum.runesofmagic.com/showthread.php?t=79267
  5754. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2153.en_3.0.1.2172.en.exe 817391606fd1c05ad6194a06b21f6a5632cacf4f
  5755. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2172.en_3.0.1.2175.en.exe ed120bc8140f8c3b2481a78f504a7a9e76c8642f
  5756. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2175.en_3.0.1.2178.en.exe 012e679402f2165effbf2aaaffe41a5d9405d319
  5757. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2178.en_3.0.1.2181.en.exe c449510566108dfc29882e6229cf716f232102df
  5758. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2181.en_3.0.1.2192.en.exe d5afc10ff1126c3dabafa02b4681f411aa689c57
  5759. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2192.en_3.0.1.2199.en.exe 542ac3b4d0fc4434aadfb784a46868f1815351da
  5760. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.1.2199.en_3.0.2.2189.en.exe c5f6115aeb2e4627dd0428c0024f177dca6f067c
  5761. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.2.2189.en_3.0.2.2213.en.exe bf3183406bcb848826301bba33775a6dfb611859
  5762. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.2.2213.en_3.0.2.2214.en.exe d576596086395ea83cb8c1422877c81ed45a90c9
  5763. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.2.2214.en_3.0.3.2231.en.exe af3f74030f371ef9bc4cfcecf4a9ad1159f28136
  5764. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.3.2231.en_3.0.3.2241.en.exe e46dbb3d2699ddc34a7885a16224c79f80657749
  5765. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.3.2241.en_3.0.3.2246.en.exe 17c49fb1381fb6927a19ed58ef210abd98c3e89f
  5766. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.3.2246.en_3.0.3.2250.en.exe 6484b2d8b23c1c7389f2f9a38681ecda84d856a4
  5767. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.3.2250.en_3.0.4.2237.en.exe a34b20828303cdeaa649b503d0eee915b7a808b3
  5768. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.4.2237.en_3.0.4.2261.en.exe 511bf0281a7f87e9912fcf52649307eec5b7d315
  5769. download $PACKAGE http://frogster.vo.llnwd.net/o9/patch/en/patch_3.0.4.2261.en_3.0.4.2263.en.exe 8d01ef99ae2a72e36d9de2b6d021bc3bbd3cd246
  5770. cd "$WISOTOOL_CACHE/$PACKAGE"
  5771. patches=`ls patch*.exe`
  5772. ahk_do "
  5773. SetTitleMatchMode, 2
  5774. ; Pre-extracting makes it a lot easier to debug this script!
  5775. ifexist, cached\\ROMSetup.exe
  5776. run, cached\\ROMSetup.exe
  5777. else
  5778. run, Runes_of_Magic_3.0.1.2153.part1.exe
  5779. winwait, Runes of Magic, This will install
  5780. sleep 2000
  5781. ControlClick, TNewButton1
  5782. winwait, Runes of Magic, License
  5783. sleep 1000
  5784. ControlClick, TNewRadioButton1 ; Accept
  5785. loop
  5786. {
  5787. ; FIXME find some simpler way of making this reliable on vista
  5788. ifwinexist, Runes of Magic, License
  5789. ControlClick, TNewButton2 ; Next
  5790. sleep 1000
  5791. ifwinexist, Runes of Magic, Destination
  5792. break
  5793. }
  5794. winwait, Runes of Magic, Destination
  5795. ;ControlClick, TNewButton3
  5796. send {Enter}
  5797. winwait, Runes of Magic, shortcuts
  5798. ;ControlClick, TNewButton4
  5799. send {Enter}
  5800. winwait, Runes of Magic, Additional Tasks
  5801. ;ControlClick, TNewButton4
  5802. send {Enter}
  5803. winwait, Runes of Magic, Ready
  5804. ;ControlClick, TNewButton4
  5805. send {Enter}
  5806. winwait, Runes of Magic, finished
  5807. sleep 1000
  5808. ;ControlClick, TNewCheckListBox1
  5809. send {Space} ; don't start
  5810. ;ControlClick, TNewButton4
  5811. send {Enter} ; finish
  5812. ;winwait, Territory # not needed anymore?
  5813. ;send {Esc}
  5814. ; Don't let it autoupdate (not needed anymore?)
  5815. winkill
  5816. "
  5817. # Let installer finish normally
  5818. $WINESERVER -w
  5819. # Create settings file so patches can find game. Normally this is created on first run of game.
  5820. # Use funny tr and | to avoid embedded carriage returns, some editors strip them
  5821. mkdir -p "$DRIVE_C/users/$USERNAME/My Documents/Runes of Magic"
  5822. tr '|' '\015' > "$DRIVE_C/users/$USERNAME/My Documents/Runes of Magic/GameSettings.ini" <<_EOF_
  5823. [Install]|
  5824. GamePath=$programfilesdir_x86_win\\Runes of Magic\\|
  5825. _EOF_
  5826. for patch in $patches
  5827. do
  5828. echo Running $patch
  5829. ahk_do "
  5830. run $patch,,, patchpid
  5831. SetTitleMatchMode, 2
  5832. loop
  5833. {
  5834. ; patch might exit before we notice it
  5835. process, exist, %patchpid%
  5836. if ErrorLevel = 0
  5837. break
  5838. ;ifwinexist, Find game path
  5839. ;{
  5840. ; send {Enter}
  5841. ; winwait, Browse for Folder
  5842. ; ; these coordinates are brittle and only work on empty wine
  5843. ; MouseMove, 76,145 ; on + next to Program Files
  5844. ; Click
  5845. ; MouseMove, 115,207 ; select Runes of Magic
  5846. ; Click
  5847. ; send {Enter}
  5848. ; winwaitclose
  5849. ;}
  5850. ifwinexist, Error
  5851. winwaitclose
  5852. ; Older updaters use title "RomUpdate"
  5853. ifwinexist, RomUpdate
  5854. {
  5855. winwaitclose
  5856. break
  5857. }
  5858. ; Newer updaters use title "Runes of Magic U" (no fooling)
  5859. ifwinexist, Runes of Magic U
  5860. {
  5861. winwaitclose
  5862. break
  5863. }
  5864. sleep 1000
  5865. }
  5866. "
  5867. done
  5868. if workaround_wine_bug 23217
  5869. then
  5870. try sh "$WINETRICKS" -q vcrun2005
  5871. fi
  5872. if workaround_wine_bug 22002
  5873. then
  5874. try sh "$WINETRICKS" -q ie6
  5875. fi
  5876. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5877. ${programfilesdrive}:
  5878. cd "$programfilesdir_x86_win\\Runes of Magic"
  5879. "Runes of Magic.exe"
  5880. __EOF__
  5881. cd "$olddir"
  5882. }
  5883. #----------------------------------------------------------------
  5884. verblist_add re5bench "Resident Evil 5 Benchmark (Capcom, 2009) [download]" nzd_ResidentEvil5_Benchmark.exe
  5885. load_re5bench() {
  5886. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/nzd_ResidentEvil5_Benchmark.exe"
  5887. then
  5888. download $PACKAGE http://download.nvidia.com/downloads/nZone/demos/nzd_ResidentEvil5_Benchmark.exe 041492b9af138f67e7acf97fbd8e926dda59ab12
  5889. fi
  5890. cd "$WISOTOOL_CACHE/$PACKAGE"
  5891. ahk_do "
  5892. run nzd_ResidentEvil5_Benchmark.exe
  5893. WinWait ahk_class MsiDialogCloseClass
  5894. Sleep 1000
  5895. Send {Enter}
  5896. ; ControlClick Button1 ; Next. Doesn't work?
  5897. WinWait ahk_class MsiDialogCloseClass, License
  5898. ControlClick Button3 ; Accept
  5899. ControlClick Button5 ; Next
  5900. WinWait ahk_class MsiDialogCloseClass, Destination
  5901. ControlClick Button1 ; Next
  5902. WinWait ahk_class MsiDialogCloseClass, Ready
  5903. ControlClick Button1 ; Install
  5904. Loop
  5905. {
  5906. ; Only shows up on older Wine versions (e.g., 1.2. Disabling gameux.dll does not help
  5907. IfWinExist, GameExplorerInstall
  5908. {
  5909. ControlClick, Button1, GameExplorerInstall
  5910. Winwait, ahk_class MsiDialogCloseClass, Completed
  5911. ControlClick Button3 ; Uncheck Launch
  5912. ControlClick Button1 ; Finish
  5913. break
  5914. }
  5915. IfWinExist, ahk_class MsiDialogCloseClass, Completed
  5916. {
  5917. ControlClick Button3 ; Uncheck Launch
  5918. ControlClick Button1 ; Finish
  5919. break
  5920. }
  5921. sleep 5000
  5922. }
  5923. "
  5924. if workaround_wine_bug 21939
  5925. then
  5926. try sh "$WINETRICKS" -q wmp9
  5927. fi
  5928. # Should run launcher.exe, but that requires .net and doesn't run on Wine
  5929. # Should give choice of running RE5DX10.EXE, but that requires dx10, which doesn't work on Wine yet
  5930. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5931. ${programfilesdrive}:
  5932. cd "$programfilesdir_x86_win\CAPCOM\RESIDENT EVIL 5 Benchmark Version"
  5933. RE5DX9.EXE
  5934. __EOF__
  5935. }
  5936. #----------------------------------------------------------------
  5937. verblist_add riseofnations_demo "Rise of Nations Trial (Microsoft/Big Huge Games 2003) [download]" RiseOfNationsTrial.exe
  5938. load_riseofnations_demo() {
  5939. if ! test -f "$WISOTOOL_CACHE/$PACKAGE"/RiseOfNationsTrial.exe
  5940. then
  5941. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  5942. die "Please visit http://download.cnet.com/Rise-of-Nations-Trial-Version/3000-7562_4-10730812.html, download RiseOfNationsTrial.exe, and place it in directory $WISOTOOL_CACHE/$PACKAGE"
  5943. fi
  5944. # FIXME: check sha1sum 33cbf1ebc0a93cb840f6296d8b529f6155db95ee
  5945. cd "$WISOTOOL_CACHE/$PACKAGE"
  5946. ahk_do "
  5947. SetTitleMatchMode, 2
  5948. run RiseOfNationsTrial.exe
  5949. WinWait,Rise Of Nations Trial Setup
  5950. sleep 2500
  5951. ControlClick CButtonClassName2
  5952. WinWait,Rise Of Nations Trial Setup, installed
  5953. sleep 2500
  5954. ControlClick CButtonClassName7
  5955. "
  5956. if workaround_wine_bug 9027
  5957. then
  5958. try sh "$WINETRICKS" -q directmusic
  5959. fi
  5960. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  5961. ${programfilesdrive}:
  5962. cd $programfilesdir_x86_win\\Microsoft Games\\Rise of Nations Trial
  5963. nations.exe
  5964. __EOF__
  5965. }
  5966. #----------------------------------------------------------------
  5967. #----------------------------------------------------------------
  5968. verblist_add quake3 "Quake 3 (ID Software, 1999)" 4d2102a8df3c1fea237f2a6a141346c436614d5e.iso
  5969. load_quake3() {
  5970. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/4d2102a8df3c1fea237f2a6a141346c436614d5e.iso
  5971. ahk_do "
  5972. Run ${ISO_MOUNT_LETTER}:Setup.exe
  5973. WinWait, Quake III Arena
  5974. ControlClick, x532 y206 ; Click Install
  5975. WinWait, Welcome
  5976. ControlClick, Button1 ; Click Next
  5977. WinWait, Software License Agreement
  5978. ControlClick, Button2 ; Click Yes
  5979. WinWait, Setup Type
  5980. ControlClick, Button2 ; Click Next
  5981. WinWait, Choose Destination Location
  5982. ControlClick, Button1 ; Click Next
  5983. WinWait, Select Program Folder
  5984. ControlClick, Button2 ; Click Next
  5985. WinWait, Question, Would you like to place a Shortcut on your Desktop?
  5986. ControlClick, Button7 ; Click No
  5987. WinWait, Setup Complete
  5988. ControlClick, Button3 ; Click No I will restart my computer later.
  5989. ControlClick, Button5 ; Click Finish
  5990. "
  5991. iso_umount
  5992. }
  5993. #----------------------------------------------------------------
  5994. verblist_add sammax304_demo "Sam & Max: The Devils Playhouse - Beyond the Alley of the Dolls (Telltale Games, 2010) [download]" SamMax304_v02.18_unlockable_securom_pa_BigDownload.exe
  5995. load_sammax304_demo() {
  5996. if ! test -f "$WISOTOOL_CACHE/$PACKAGE"/SamMax304_v02.18_unlockable_securom_pa_BigDownload.exe
  5997. then
  5998. download $PACKAGE "http://gamedaily.newaol.com/pub/SamMax304_BigDownload.exe.zip" 5d3cefcf0c654d3646105e14cb3d06c61feb32f3
  5999. cd "$WISOTOOL_CACHE/$PACKAGE"
  6000. try unzip SamMax304_BigDownload.exe.zip
  6001. rm -f SamMax304_BigDownload.exe.zip
  6002. fi
  6003. cd "$WISOTOOL_CACHE/$PACKAGE"
  6004. ahk_do "
  6005. SetTitleMatchMode, 2
  6006. run SamMax304_v02.18_unlockable_securom_pa_BigDownload.exe
  6007. WinWait,Sam and Max Beyond the Alley of the Dolls Setup,Welcome
  6008. ControlClick Button2 ; Next
  6009. WinWait,Sam and Max Beyond the Alley of the Dolls Setup,DirectX
  6010. ControlClick Button2 ; Next - Directx check defaulted
  6011. WinWait,Sam and Max Beyond the Alley of the Dolls Setup,License
  6012. ControlClick Button2 ; Agree
  6013. WinWait,Sam and Max Beyond the Alley of the Dolls Setup,Location
  6014. ControlClick Button2 ; Install
  6015. WinWait,Sam and Max Beyond the Alley of the Dolls Setup,Finish
  6016. ControlClick Button4 ; Uncheck Play Now
  6017. ControlClick Button2 ; Finish
  6018. "
  6019. if workaround_wine_bug 24250
  6020. then
  6021. try sh "$WINETRICKS" -q vcrun2005
  6022. fi
  6023. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6024. ${programfilesdrive}:
  6025. cd "$programfilesdir_x86_win\\Telltale Games\\Sam and Max - The Devil's Playhouse\\Beyond the Alley of the Dolls"
  6026. SamMax304.exe
  6027. __EOF__
  6028. }
  6029. #----------------------------------------------------------------
  6030. verblist_add sega_rally_2 "Sega Rally 2 (Sega, 1999)" rally2.exe
  6031. # http://appdb.winehq.org/objectManager.php?sClass=application&iId=6961
  6032. load_sega_rally_2() {
  6033. download $PACKAGE http://www2.sega.co.jp/download/pc/rally2/rally2.exe 1c0560c9f7d22343511a8ad46dbe606c6c7417c9
  6034. # Installer starts by extracting files, but doesn't seem to be a zip file or a cab file. I tried a few cli arguments,
  6035. # but had no luck. It's only 60 MB extracted, so just extract it fresh each time.
  6036. cd "$WISOTOOL_CACHE/$PACKAGE"
  6037. ahk_do "
  6038. SetTitleMatchMode, 2
  6039. run, rally2.exe
  6040. winwait, WinSFX32 V2.16.2.6, Install &Directory:
  6041. sleep 1000
  6042. controlclick, Button2, WinSFX32 V2.16.2.6, Install &Directory:
  6043. loop
  6044. {
  6045. ifwinexist, WinSFX32 V2.16.2.6, Install &Directory:
  6046. sleep 5000
  6047. else
  6048. break
  6049. }
  6050. "
  6051. cd rally2/JP_DEMO
  6052. # There's a lot of unknown characters (presumably Japanese). Should this require user to run in
  6053. # a Japanese locale?
  6054. ahk_do "
  6055. SetTitleMatchMode, 2
  6056. run, RALLY2DEMO.EXE
  6057. winwait, ????, SEGA RALLY 2 DEMO ???????
  6058. sleep 1000
  6059. controlclick, Button1, ????, SEGA RALLY 2 DEMO ???????
  6060. winwait, ??????????, ???????????????? SEGA RALLY 2 DEMO ???????????
  6061. sleep 1000
  6062. controlclick, Button1, ??????????, ???????????????? SEGA RALLY 2 DEMO ???????????
  6063. winwait, ??????? ????????, ??????????????????? ????????????? ????????????????????????????????????????????????????[??]???????????????
  6064. sleep 1000
  6065. controlclick, Button2, ??????? ????????, ??????????????????? ????????????? ????????????????????????????????????????????????????[??]???????????????
  6066. winwait, ??????????, SEGA RALLY 2 DEMO
  6067. sleep 1000
  6068. controlclick, Button4, ??????????, SEGA RALLY 2 DEMO
  6069. ; Automatically runs the game after install. Kill it.
  6070. sleep 3000
  6071. process, close, LAUNCH.exe
  6072. "
  6073. cd "$olddir"
  6074. if workaround_wine_bug 22668
  6075. then
  6076. warn "The game is unplayable due to http://bugs.winehq.org/show_bug.cgi?id=22668. No known workaround."
  6077. fi
  6078. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6079. ${programfilesdrive}:
  6080. cd "$programfilesdir_x86_win\Sega\SEGA RALLY 2 DEMO"
  6081. "SEGA RALLY 2 DEMO.exe"
  6082. __EOF__
  6083. }
  6084. #----------------------------------------------------------------
  6085. verblist_add 7million "7Million (Deep Silver, 2009) [download] [broken on wine]" 7Million_0_17_0-full.exe
  6086. load_7million() {
  6087. download $PACKAGE http://content.deepsilver.com/kochmedia/downloads/7million/de-uk/7Million_0_17_0-full.exe 99d496817367216180c4b3a59180361c23348e1e
  6088. cd "$WISOTOOL_CACHE/$PACKAGE"
  6089. ahk_do "
  6090. SetTitleMatchMode, 2
  6091. run, 7Million_0_17_0-full.exe
  6092. winwait, Choose Setup Language
  6093. ControlClick, Button1
  6094. SetTitleMatchMode, Slow
  6095. winwait, 7Million - InstallShield Wizard
  6096. sleep 2000
  6097. winactivate, 7Million - InstallShield Wizard
  6098. Send {Enter}
  6099. sleep 4000
  6100. winactivate, 7Million - InstallShield Wizard
  6101. Send !a
  6102. Send !n
  6103. winwait, Age verification
  6104. winactivate, Age verification
  6105. Send !y
  6106. sleep 1000
  6107. winactivate, 7Million - InstallShield Wizard
  6108. Send !i
  6109. winwait, 7Million - InstallShield Wizard, InstallShield Wizard Complete
  6110. Send {Enter}
  6111. "
  6112. cd "$olddir"
  6113. cat > "$DRIVE_C/run-$PACKAGE.bat" << __EOF__
  6114. ${programfilesdrive}:
  6115. cd "users\\$LOGNAME\Local Settings\Application Data\7Million"
  6116. 7million
  6117. __EOF__
  6118. if workaround_wine_bug 23248
  6119. then
  6120. warn "This game doesn't work on wine yet"
  6121. fi
  6122. }
  6123. #----------------------------------------------------------------
  6124. verblist_add secondlife_beta "Second Life Viewer - Beta [Download]" Second_Life_2-1-0-207030_Setup.exe
  6125. load_secondlife_beta() {
  6126. download $PACKAGE http://download.cloud.secondlife.com/Viewer-2-1/Second_Life_2-1-0-207030_Setup.exe
  6127. cd "$WISOTOOL_CACHE/$PACKAGE"
  6128. ahk_do "
  6129. SetTitleMatchMode, 2
  6130. run, Second_Life_2-1-0-207030_Setup.exe
  6131. winwait, Installer Language
  6132. send {Enter}
  6133. winwait, Installation Folder
  6134. send {Enter}
  6135. winwait, Second Life, Start Second Life now
  6136. send {Tab}{Enter}
  6137. "
  6138. cd "$olddir"
  6139. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6140. ${programfilesdrive}:
  6141. cd $programfilesdir_x86_win\\SecondLifeViewer2
  6142. SecondLife.exe
  6143. __EOF__
  6144. }
  6145. #----------------------------------------------------------------
  6146. verblist_add segabass "Sega Bass Fishing 2 (SEGA/Activision, 2001) [requires disc]"
  6147. load_segabass() {
  6148. # Can't make a .iso of this disc, so assume the disc is in drive d:
  6149. ahk_do "
  6150. SetTitleMatchMode, 2
  6151. run d:setup.exe
  6152. winwait, SEGA Bass Fishing, License
  6153. send a
  6154. sleep 1000
  6155. send {Enter}
  6156. winwait, SEGA Bass Fishing, Destination
  6157. send {Enter}
  6158. winwait, SEGA Bass Fishing, Ready
  6159. send {Enter}
  6160. winwait, SEGA Bass Fishing, Complete
  6161. send {Enter}
  6162. winwaitclose
  6163. "
  6164. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6165. ${programfilesdrive}:
  6166. cd "$programfilesdir_x86_win\\SEGA\\Sega Bass Fishing"
  6167. BassFishing.exe
  6168. __EOF__
  6169. }
  6170. #----------------------------------------------------------------
  6171. verblist_add sims3 "The Sims 3 (EA, 2009)" 8a82a067f3bb8f68d034a06954e9a16ea381958a.iso
  6172. load_sims3() {
  6173. # Launcher needs .net. (But you don't need the launcher to play the game, so this may be overkill.)
  6174. if false && workaround_wine_bug 22350
  6175. then
  6176. try sh "$WINETRICKS" -q dotnet20
  6177. fi
  6178. if workaround_wine_bug 21517
  6179. then
  6180. try sh "$WINETRICKS" -q d3dx9_36
  6181. fi
  6182. # Get user's key
  6183. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/8a82a067f3bb8f68d034a06954e9a16ea381958a.txt | tr -d -`
  6184. echo KEY is $KEY
  6185. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/8a82a067f3bb8f68d034a06954e9a16ea381958a.iso
  6186. # Default lang, USA, accept defaults, uncheck EA dl mgr, uncheck readme
  6187. ahk_do "
  6188. run ${ISO_MOUNT_LETTER}:Sims3Setup.exe
  6189. winwait, Choose Setup Language
  6190. send {Enter}
  6191. SetTitleMatchMode, 2
  6192. winwait, - InstallShield Wizard
  6193. sleep 1000
  6194. ControlClick &Next >, - InstallShield Wizard
  6195. sleep 1000
  6196. send uuuuuu{Tab}{Tab}{Enter}
  6197. sleep 1000
  6198. send a{Enter}
  6199. sleep 1000
  6200. send {Raw}$KEY
  6201. send {Enter}
  6202. winwait, - InstallShield Wizard, Setup Type
  6203. send {Enter}
  6204. winwait, - InstallShield Wizard, Click Install to begin
  6205. send {Enter}
  6206. winwait, - InstallShield Wizard, EA Download Manager
  6207. ControlClick Yes, - InstallShield Wizard
  6208. send {Enter}
  6209. winwait, - InstallShield Wizard, Complete
  6210. ControlClick View the readme file, - InstallShield Wizard
  6211. ControlClick Finish, - InstallShield Wizard
  6212. "
  6213. iso_umount
  6214. cd "$programfilesdir_unix/Electronic Arts/The Sims 3/Game/Bin"
  6215. echo "Sims3 version info:"
  6216. cat skuversion.txt
  6217. download sims3 http://na.llnet.eadownloads.ea.com/u/f/sims/sims3/patches/Sims3_1.6.6.002001_from_1.0.631.00001.exe 02703d296417750005326ff0d37295fa434a3f49
  6218. cd "$WISOTOOL_CACHE"/sims3
  6219. ahk_do "
  6220. run Sims3_1.6.6.002001_from_1.0.631.00001.exe
  6221. SetTitleMatchMode, 2
  6222. winwait, - InstallShield Wizard, Complete
  6223. ControlClick Finish, - InstallShield Wizard
  6224. "
  6225. # FIXME: apply next patch, too
  6226. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6227. ${programfilesdrive}:
  6228. cd "$programfilesdir_x86_win\\Electronic Arts\\The Sims 3\\Game\\Bin"
  6229. TS3.EXE
  6230. __EOF__
  6231. }
  6232. #----------------------------------------------------------------
  6233. verblist_add singularity "Singularity (Activision, 2010)" cfbba29fa8db1b9f87a90ea2f54c63026757c13d.iso
  6234. load_singularity() {
  6235. # Get user's key
  6236. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/cfbba29fa8db1b9f87a90ea2f54c63026757c13d.txt | tr -d -`
  6237. echo KEY is $KEY
  6238. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/cfbba29fa8db1b9f87a90ea2f54c63026757c13d.iso
  6239. ahk_do "
  6240. run ${ISO_MOUNT_LETTER}:setup.exe
  6241. winwait, Activision(R) - InstallShield, Select the language for the installation from the choices below.
  6242. sleep 1000
  6243. controlclick, Button1, Activision(R) - InstallShield, Select the language for the installation from the choices below.
  6244. sleep 1000
  6245. winwait, Singularity(TM), Keycode Check
  6246. sleep 1000
  6247. Send $KEY
  6248. sleep 1000
  6249. Send {Enter}
  6250. ; Well this is annoying...
  6251. Winwait, Keycode Check, The Keycode you entered appears to be valid.
  6252. sleep 1000
  6253. Send {Enter}
  6254. winwait, Singularity(TM), The InstallShield Wizard will install Singularity(TM) on your computer
  6255. sleep 1000
  6256. controlclick, Button1, Singularity(TM), The InstallShield Wizard will install Singularity(TM) on your computer
  6257. winwait, Singularity(TM), Please read the following license agreement carefully
  6258. sleep 1000
  6259. controlclick, Button5, Singularity(TM), Please read the following license agreement carefully
  6260. sleep 1000
  6261. controlclick, Button2, Singularity(TM), Please read the following license agreement carefully
  6262. winwait, Singularity(TM), Minimum System Requirements
  6263. sleep 1000
  6264. controlclick, Button1, Singularity(TM), Minimum System Requirements
  6265. winwait, Singularity(TM), Select the setup type to install
  6266. controlclick, Button4, Singularity(TM), Select the setup type to install
  6267. sleep 5000
  6268. Loop
  6269. {
  6270. ifwinexist, Singularity(TM)
  6271. sleep 15000
  6272. else
  6273. break
  6274. }
  6275. "
  6276. iso_umount
  6277. if workaround_wine_bug 6971
  6278. then
  6279. sh "$WINETRICKS" -q mwo=force
  6280. fi
  6281. if workaround_wine_bug 22548
  6282. then
  6283. echo "Disabling \'depth of field\'"
  6284. cat > "$WISOTOOL_TMP"/dof.reg <<_EOF_
  6285. REGEDIT4
  6286. [HKEY_CURRENT_USER\Software\Activision\Singularity]
  6287. "DepthOfField"=dword:00000000
  6288. _EOF_
  6289. try_regedit "$WISOTOOL_TMP_WIN"\\dof.reg
  6290. fi
  6291. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6292. ${programfilesdrive}:
  6293. cd "$programfilesdir_x86_win\\Activision\Singularity(TM)\Binaries"
  6294. Singularity.exe
  6295. __EOF__
  6296. }
  6297. #----------------------------------------------------------------
  6298. verblist_add splitsecond_demo "Split Second Demo (Black Rock Studios, 2010) [wine bug 22865]" SplitSecond_Demo.exe
  6299. load_splitsecond_demo()
  6300. {
  6301. if test ! -f "$WISOTOOL_CACHE/$PACKAGE"/SplitSecond*.exe
  6302. then
  6303. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  6304. die "You must download the demo to $WISOTOOL_CACHE/$PACKAGE before running this script. See http://www.fileplanet.com/212404/210000/fileinfo/Split/Second-Demo"
  6305. fi
  6306. if workaround_wine_bug 22774 "wine-1.3.[0-9]*"
  6307. then
  6308. echo "On wine, install takes an extra 7 minutes at the end, please be patient."
  6309. fi
  6310. if workaround_wine_bug 22865
  6311. then
  6312. echo "This game is currently unplayable on wine due to rendering problems; see winehq bug 22865."
  6313. fi
  6314. cd "$WISOTOOL_CACHE/$PACKAGE"
  6315. exe=`ls SplitSecond*.exe`
  6316. ahk_do "
  6317. SetTitleMatchMode, 2
  6318. run, "$exe"
  6319. winwait, Split, Language
  6320. ;ControlClick, Next, Split, Language ; does not quite work, have to use {Enter} instead
  6321. Send {Enter}
  6322. winwait, Split, game installation
  6323. ControlClick, Button1, Split, game installation
  6324. winwait, Split, license
  6325. ControlClick, Button5, Split, license
  6326. ControlClick, Button2, Split, license
  6327. winwait, Split, DirectX
  6328. ControlClick, Button5, Split, DirectX
  6329. ControlClick, Button2, Split, DirectX
  6330. winwait, Split, installation path
  6331. ControlClick, Button1, Split, installation path
  6332. winwait, Split, Game features
  6333. ControlClick, Button2, Split, Game features
  6334. winwait, Split, start copying
  6335. ControlClick, Button1, Split, start copying
  6336. winwait, Split, completed
  6337. ControlClick, Button1, Split, completed
  6338. ControlClick, Button4, Split, completed
  6339. "
  6340. cd "$olddir"
  6341. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6342. ${programfilesdrive}:
  6343. cd "$programfilesdir_x86_win\\Disney Interactive Studios\\Split Second Demo"
  6344. SplitSecondDEMO.exe
  6345. __EOF__
  6346. }
  6347. #----------------------------------------------------------------
  6348. verblist_add splitsecond "Split Second (Black Rock Studios, 2010) [wine bug 22865]" 15548fabe350e1b65432400aae8c3acfb1c930d8.iso
  6349. load_splitsecond()
  6350. {
  6351. if workaround_wine_bug 22774 "wine-1.3.[0-9]*"
  6352. then
  6353. echo "On wine, install takes an extra 7 minutes at the end, please be patient."
  6354. fi
  6355. if workaround_wine_bug 22865
  6356. then
  6357. echo "This game is currently unplayable on wine due to rendering problems; see winehq bug 22865."
  6358. fi
  6359. #KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/15548fabe350e1b65432400aae8c3acfb1c930d8.txt`
  6360. # Key is used in first run activation. TODO: script first run activation.
  6361. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/15548fabe350e1b65432400aae8c3acfb1c930d8.iso
  6362. # Aborts with dialog about FirewallInstallHelper.dll if that's not on the path (e.g. in current dir)
  6363. cd "$ISO_MOUNT_ROOT"
  6364. ahk_do "
  6365. SetTitleMatchMode, 2
  6366. run setup.exe
  6367. winwait, Split, Language
  6368. ;ControlClick, Next, Split, Language ; does not quite work, have to use {Enter} instead
  6369. Send {Enter}
  6370. winwait, Split, game installation
  6371. ControlClick, Button1, Split, game installation
  6372. winwait, Split, license
  6373. ControlClick, Button5, Split, license
  6374. ControlClick, Button2, Split, license
  6375. winwait, Split, DirectX
  6376. ControlClick, Button5, Split, DirectX
  6377. ControlClick, Button2, Split, DirectX
  6378. winwait, Split, installation method
  6379. send {Enter}
  6380. winwait, DirectX needs to be updated
  6381. send {Enter}
  6382. winwait, Split, begin
  6383. ControlClick, Button1
  6384. winwait, Split, completed
  6385. ControlClick, Button1, Split
  6386. ControlClick, Button4, Split
  6387. "
  6388. iso_umount
  6389. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6390. ${programfilesdrive}:
  6391. cd "$programfilesdir_x86_win\\Disney Interactive Studios\\Split Second"
  6392. SplitSecond.exe
  6393. __EOF__
  6394. }
  6395. #----------------------------------------------------------------
  6396. verblist_add spore "Spore (EA, 2008)" d08d1985d3161661d4f0ded30a0d11e705f2fcc2.iso
  6397. load_spore()
  6398. {
  6399. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/d08d1985d3161661d4f0ded30a0d11e705f2fcc2.iso
  6400. SPORE_KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/d08d1985d3161661d4f0ded30a0d11e705f2fcc2.txt | tr -d -`
  6401. ahk_do "
  6402. SetTitleMatchMode, 2
  6403. run, ${ISO_MOUNT_LETTER}:SPORESetup.exe
  6404. winwait, Language
  6405. controlclick, Button1
  6406. winwait, SPORE, Welcome
  6407. controlclick, Button1
  6408. winwait, SPORE, License
  6409. controlclick, Button3
  6410. controlclick, Button1
  6411. winwait, SPORE, Registration Code
  6412. send {RAW}$SPORE_KEY
  6413. controlclick, Button2
  6414. winwait, SPORE, Setup Type
  6415. controlclick, Button6
  6416. winwait, SPORE, Shortcut
  6417. controlclick, Button6
  6418. winwait, SPORE, begin
  6419. controlclick, Button1
  6420. winwait, Question
  6421. ; download managers are usually a pain, so always say no to such questions
  6422. controlclick, Button2
  6423. winwait, SPORE, complete
  6424. controlclick, Button1
  6425. controlclick, Button2
  6426. controlclick, Button4
  6427. "
  6428. iso_umount
  6429. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6430. ${programfilesdrive}:
  6431. cd "$programfilesdir_x86_win\\Electronic Arts\\SPORE\\Sporebin"
  6432. SporeApp.exe
  6433. __EOF__
  6434. }
  6435. #----------------------------------------------------------------
  6436. verblist_add ssdd2 "SpongeBob SquarePants Diner Dash 2 (Nickelodeon/Big Fish, 2007) [download]" InstallSpongeBobDinerDash2.exe
  6437. load_ssdd2()
  6438. {
  6439. # Main page: http://arcade.nick.com/nick/gameinfo.jsp?s=SpongeBobDinerDash2
  6440. # old: 8407dae2c062ce62b38408eeac3a9f95be202b96
  6441. # 27 Oct 2010: 440c4f2e9484ba150782cae8754ff8eaaad3b01e
  6442. download $PACKAGE http://nickdownloads.shockwave.com/InstallSpongeBobDinerDash2.exe 440c4f2e9484ba150782cae8754ff8eaaad3b01e
  6443. if workaround_wine_bug 23749
  6444. then
  6445. sh "$WINETRICKS" -q ie6
  6446. fi
  6447. cd "$WISOTOOL_CACHE/$PACKAGE"
  6448. ahk_do "
  6449. SetTitleMatchMode, 2
  6450. run InstallSpongeBobDinerDash2.exe
  6451. winwait, Welcome
  6452. sleep 1000
  6453. controlclick, Button1, Welcome
  6454. sleep 1000
  6455. winwait, End User License
  6456. sleep 1000
  6457. controlclick, Button1, End User License
  6458. winwait, Choose Destination Location
  6459. sleep 1000
  6460. controlclick, Button1, Choose Destination Location
  6461. winwait, FREE Toolbar
  6462. sleep 1000
  6463. controlclick, Button5, FREE Toolbar
  6464. sleep 1000
  6465. controlclick, Button1, FREE Toolbar
  6466. winwait, Start Installation
  6467. sleep 1000
  6468. controlclick, Button1, Start Installation
  6469. winwait, Installation Complete
  6470. sleep 1000
  6471. controlclick, Button1, Installation Complete
  6472. "
  6473. sleep 5
  6474. killall winefile.exe
  6475. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6476. ${programfilesdrive}:
  6477. cd "$programfilesdir_x86_win\\Nick Arcade\\SpongeBob SquarePants Diner Dash 2"
  6478. "SpongeBob SquarePants Diner Dash 2.exe"
  6479. __EOF__
  6480. }
  6481. #----------------------------------------------------------------
  6482. verblist_add sonicdxb_demo "Sonic Adventure Deluxe Trial B (Sega, 2003) [download]" sadx_trial_b.exe
  6483. load_sonicdxb_demo() {
  6484. # http://sega.jp/pc/sonicdx/
  6485. # http://sega.jp/pc/sonicdx/trial.shtml
  6486. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/sadx_trial_b.exe"
  6487. then
  6488. download $PACKAGE 'http://sega.jp/cgi-bin/link.cgi?url=sadx_trial_b' f76fc33d3cb1b062437e03ba4e0687be07d903ad
  6489. mv "$WISOTOOL_CACHE"/$PACKAGE/'link.cgi?url=sadx_trial_b' "$WISOTOOL_CACHE/$PACKAGE/sadx_trial_b.exe"
  6490. fi
  6491. # Switch to Japanese locale so freedesktop.org menu item works
  6492. # (This works for Scott, at least)
  6493. OLDLANG=${LANG}
  6494. export LANG=ja_JP.utf8
  6495. cd "$WISOTOOL_CACHE/$PACKAGE"
  6496. ahk_do "
  6497. run, sadx_trial_b.exe
  6498. WinWait ahk_class SONIC_DX_PC_LC_B
  6499. ControlClick, x450 y90
  6500. WinWait ahk_class #32770
  6501. ControlClick, Button3
  6502. ControlClick, Button1
  6503. WinWait ahk_class #32770
  6504. ControlClick, Button1
  6505. WinWait ahk_class #32770
  6506. ControlClick, Button1
  6507. WinWaitActive ahk_class SONIC_DX_PC_LC_G_B
  6508. ControlClick, x450 y130
  6509. "
  6510. LANG=${OLDLANG}
  6511. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6512. ${programfilesdrive}:
  6513. cd "$programfilesdir_x86_win\\Sega\\SONICADVENTUREDX_DEMO_B"
  6514. sonic.exe
  6515. __EOF__
  6516. }
  6517. #----------------------------------------------------------------
  6518. verblist_add stalker_pripyat_bench "S.T.A.L.K.E.R Call of Pripyat benchmark (GSC Game World, 2009) [download]" stkcop-bench-setup.exe
  6519. load_stalker_pripyat_bench() {
  6520. # FIXME: There's a much faster download at
  6521. # http://www.bigdownload.com/games/stalker-call-of-pripyat/pc/stalker-call-of-pripyat-benchmark
  6522. # Should we direct users to download from there manually?
  6523. download $PACKAGE http://files.gsc-game.com/st/bench/stkcop-bench-setup.exe 8691c3f289ecd0521bed60ffd46e65ad080206e0
  6524. cd "$WISOTOOL_CACHE/$PACKAGE"
  6525. # FIXME: a bit fragile, if you're browsing the web while installing, it sometimes gets stuck.
  6526. ahk_do "
  6527. SetTitleMatchMode, 2
  6528. run stkcop-bench-setup.exe
  6529. WinWait,Setup - Call Of Pripyat Benchmark,Pripyat
  6530. sleep 1000
  6531. ControlClick TNewButton1 ; Next
  6532. WinWait,Setup - Call Of Pripyat Benchmark,License
  6533. sleep 1000
  6534. ControlClick TNewRadioButton1 ; accept
  6535. sleep 1000
  6536. ControlClick TNewButton2 ; Next
  6537. WinWait,Setup - Call Of Pripyat Benchmark,Destination
  6538. sleep 1000
  6539. ControlClick TNewButton3 ; Next
  6540. WinWait,Setup - Call Of Pripyat Benchmark,shortcuts
  6541. sleep 1000
  6542. ControlClick TNewButton4 ; Next
  6543. WinWait,Setup - Call Of Pripyat Benchmark,tasks
  6544. sleep 1000
  6545. send {Enter}
  6546. WinWait,Setup - Call Of Pripyat Benchmark,ready
  6547. sleep 1000
  6548. ControlClick, TNewButton4 ; Next (nah, who reads doc?)
  6549. WinWait,Setup - Call Of Pripyat Benchmark,finished
  6550. sleep 1000
  6551. Send {Space} ; uncheck launch
  6552. sleep 1000
  6553. ControlClick TNewButton4 ; Finish
  6554. "
  6555. if workaround_wine_bug 24868
  6556. then
  6557. sh "$WINETRICKS" d3dx9_31 d3dx9_42
  6558. fi
  6559. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6560. ${programfilesdrive}:
  6561. cd "$programfilesdir_x86_win\\Call Of Pripyat Benchmark"
  6562. Benchmark.exe
  6563. __EOF__
  6564. }
  6565. #----------------------------------------------------------------
  6566. verblist_add starcraft "Starcraft Battle Chest (Blizzard, 1998)" 8d6cc11bc76b8af22868a95e17e0282277e9c53c.iso 966bae1f2e2035e066139e78137e623c92838254.iso
  6567. load_starcraft() {
  6568. warn "You must have already done 'wisotool load=YOURKEY' on the install disc, and 'wisotool load' on the other disc."
  6569. # Force clean-ish install
  6570. test -d "$programfilesdir_unix/StarCraft" && rm -rf "$programfilesdir_unix/StarCraft"
  6571. # Get user's key
  6572. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/8d6cc11bc76b8af22868a95e17e0282277e9c53c.txt`
  6573. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/8d6cc11bc76b8af22868a95e17e0282277e9c53c.iso
  6574. ahk_do "
  6575. run ${ISO_MOUNT_LETTER}:StarCraft (Windows).exe
  6576. winwait, StarCraft - Brood War
  6577. send {i}
  6578. winwait, End User License Agreement
  6579. Sleep 2000
  6580. send {a}
  6581. winwait, CD-Key
  6582. send $USERNAME
  6583. send {Tab}$KEY
  6584. send {Enter}
  6585. winwait, Installation Destination Directory
  6586. send {Enter}
  6587. winwait,,Please insert"
  6588. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/966bae1f2e2035e066139e78137e623c92838254.iso
  6589. ahk_do "
  6590. send, {Enter}
  6591. SetTitleMatchMode, 2
  6592. winwait, - StarCraft
  6593. winwaitclose, - StarCraft
  6594. Sleep 2000
  6595. send {e}"
  6596. iso_umount
  6597. # FIXME: apply patch, follow instructions in http://us.blizzard.com/support/article.xml?articleId=21150
  6598. }
  6599. #----------------------------------------------------------------
  6600. verblist_add starcraft2 "Starcraft II (Blizzard, 2010)" Installer Tome 1.MPQE Installer UI 1.MPQ Installer UI 2.MPQE Installer.app Installer.exe
  6601. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=20882
  6602. load_starcraft2() {
  6603. load_gecko
  6604. for x in "Installer Tome 1.MPQE" "Installer UI 1.MPQ" "Installer UI 2.MPQE" "Installer.app" "Installer.exe"
  6605. do
  6606. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/$x"
  6607. then
  6608. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  6609. die "Please download the installer files using the Blizzard downloader from https://us.battle.net/account/management/sc2/download.html?gameRegion=NA&lang=en-US&platform=win and put them in $WISOTOOL_CACHE/$PACKAGE"
  6610. fi
  6611. done
  6612. # Force clean-ish install
  6613. test -d "$programfilesdir_unix/StarCraft II" && rm -rf "$programfilesdir_unix/StarCraft II"
  6614. cd "$WISOTOOL_CACHE/$PACKAGE"
  6615. ahk_do "
  6616. SetTitleMatchMode, 2
  6617. run, Installer.exe
  6618. winwait, StarCraft II Installer
  6619. ControlClick, x300 y200
  6620. winwait, End User License Agreement
  6621. winactivate
  6622. MouseMove, 300, 300
  6623. Click WheelDown, 70
  6624. Sleep, 1000
  6625. ControlClick, Agree
  6626. winwait, StarCraft II Installer
  6627. sleep 1000
  6628. ControlClick, x800 y500
  6629. winwait, StarCraft II Activation
  6630. sleep 1000
  6631. ; Skip activation
  6632. controlclick, Button2, StarCraft II Activation
  6633. winwait, StarCraft II v, update was successful
  6634. winclose
  6635. "
  6636. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6637. ${programfilesdrive}:
  6638. cd "$programfilesdir_x86_win\StarCraft II"
  6639. "StarCraft II.exe"
  6640. __EOF__
  6641. }
  6642. #----------------------------------------------------------------
  6643. verblist_add sto "Star Trek Online (Cryptic, 2010)" f891dab46d05d771e0123a1e7ec969f3601064a6.iso
  6644. load_sto()
  6645. {
  6646. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/f891dab46d05d771e0123a1e7ec969f3601064a6.iso
  6647. # Note: http://www.startrekonline.com/download shows how to download the
  6648. # client using bittorrent. If the iso is not present, we should try that path.
  6649. if workaround_wine_bug 22943
  6650. then
  6651. # Install is fine without ie6, but can't log in or download patch without ie6,
  6652. # and the installer launches the app when it's done.
  6653. # Even with ie6, it's not perfect, there are lots of annoying script error prompts.
  6654. sh "$WINETRICKS" -q ie6
  6655. fi
  6656. ahk_do "
  6657. SetTitleMatchMode, 2
  6658. run ${ISO_MOUNT_LETTER}:setup.exe
  6659. winwait, Installer
  6660. Send {Enter} ; Accept English as default language
  6661. winwait, Star Trek Online
  6662. ControlClick, Button2
  6663. winwait, Star Trek, License
  6664. ControlClick, Button2,
  6665. winwait, Star Trek, Location
  6666. ControlClick, Button2
  6667. winwait, Star Trek, shortcuts
  6668. ControlClick, Button2
  6669. winwait, Star Trek, additional
  6670. ControlClick, Button2
  6671. winwait, Star Trek, Launch
  6672. ControlClick, Button2
  6673. "
  6674. iso_umount
  6675. # FIXME: register using the key that came with the DVD?
  6676. # FIXME: log in and download patch?
  6677. # FIXME: kill game?
  6678. }
  6679. #----------------------------------------------------------------
  6680. verblist_add stfu "Starwars: The Force Unleashed (Aspyr, 2009)" 0d0f4e826c3a04542a68d7bcc971f4df7526965b.iso 5d6e2eb1b08b9d4a71b2390b385c3048ec91f3df.iso
  6681. load_stfu() {
  6682. load_autohotkey
  6683. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/0d0f4e826c3a04542a68d7bcc971f4df7526965b.iso
  6684. warn "Starting installer. This can be very slow, please be patient."
  6685. ahk_do "
  6686. run ${ISO_MOUNT_LETTER}:setup.exe
  6687. SetTitleMatchMode, 2
  6688. winwait, Select Setup Language
  6689. send {Enter}
  6690. winwait, Setup, Welcome
  6691. send {Enter}
  6692. winwait, Setup, License
  6693. sleep 500
  6694. send {Tab}a{Space}{Enter}
  6695. winwait, Setup, Destination
  6696. send {Enter}
  6697. winwait, Setup, Menu
  6698. send {Enter}
  6699. winwait, Setup, Tasks
  6700. send {Space}{Enter}
  6701. winwait, Setup, begin
  6702. sleep 1000
  6703. ControlClick &Install, Setup
  6704. winwait, Setup Needs the Next Disk
  6705. "
  6706. iso_umount
  6707. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/5d6e2eb1b08b9d4a71b2390b385c3048ec91f3df.iso
  6708. ahk_do "
  6709. SetTitleMatchMode, 2
  6710. send {Enter}
  6711. winwait, Setup, Completing
  6712. send {Space}{Tab} ; don't show readme
  6713. send {Space}{Tab} ; don't start app
  6714. send {Enter}
  6715. "
  6716. iso_umount
  6717. # Patch to 1.2
  6718. # FIXME: add a commandline option to disable patching in general
  6719. # URL from http://www.lucasfiles.com/index.php?s=&action=download&id=1537&agree=true
  6720. # See also http://www.forceunleashed.net/news/force-unleashed-patch-1-2/
  6721. download stfu http://xfer.lfnetwork.com/lucasfiles.com/downloads/1537/SWTFU_PC_EF_1.2_Update.exe cfd8043c4b86f4dc0ff0acd4c108b11c4b76e716
  6722. cd "$WISOTOOL_CACHE/stfu"
  6723. ahk_do "
  6724. run SWTFU_PC_EF_1.2_Update.exe
  6725. SetTitleMatchMode, 2
  6726. winwait, Patch
  6727. send {Enter}
  6728. winwait, Patch, Finish
  6729. send {Enter}
  6730. "
  6731. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6732. ${programfilesdrive}:
  6733. cd "$programfilesdir_x86_win\StarCraft II Beta"
  6734. "StarCraft II.exe"
  6735. __EOF__
  6736. # Should start SWTFU Launcher.exe, but that doesn't run in Wine?
  6737. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6738. ${programfilesdrive}:
  6739. cd "$programfilesdir_x86_win\Aspyr\Star Wars The Force Unleashed"
  6740. SWTFU.exe
  6741. __EOF__
  6742. }
  6743. #----------------------------------------------------------------
  6744. verblist_add sf4bench "Street Fighter 4: Benchmark (CAPCOM, 2009) [download]" StreetFighterIV_Benchmark.exe
  6745. load_sf4bench()
  6746. {
  6747. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/StreetFighterIV_Benchmark.exe"
  6748. then
  6749. download $PACKAGE http://gamedaily.newaol.com/pub/StreetFighterIV_Benchmark.exe f7754210308b3a0ff2bb3be3a62b22767519ca62
  6750. fi
  6751. cd "$WISOTOOL_CACHE"/$PACKAGE
  6752. ahk_do "
  6753. SetTitleMatchmode, 2
  6754. run, StreetFighterIV_Benchmark.exe
  6755. winwait, Choose
  6756. controlclick, Button1
  6757. winwait, STREET, To continue, click Next
  6758. controlclick, Button1
  6759. winwait, STREET, license agreement
  6760. controlclick, Button3
  6761. controlclick, Button5
  6762. winwait, STREET, Destination Folder
  6763. controlclick, Button1
  6764. winwait, STREET, ready to begin
  6765. controlclick, Button1
  6766. winwait, STREET, successfully installed
  6767. controlclick, Button1
  6768. "
  6769. # The game has a flickering graphics problem when parallel rendering is enabled.
  6770. # You can disable it and tweak benchmark settings via the config.ini file.
  6771. if workaround_wine_bug 23647
  6772. then
  6773. cd "$DRIVE_C/users/$USERNAME/Local Settings/Application Data"
  6774. if test -f CAPCOM/STREETFIGHTERIVBENCHMARK/config.ini
  6775. then
  6776. cd CAPCOM/STREETFIGHTERIVBENCHMARK
  6777. mv config.ini config.ini.old
  6778. sed 's,RenderingThread=ON,RenderingThread=OFF,' config.ini.old > config.ini
  6779. else
  6780. mkdir -p "CAPCOM/STREETFIGHTERIVBENCHMARK"
  6781. cd "CAPCOM/STREETFIGHTERIVBENCHMARK"
  6782. cat > config.ini <<__EOF__
  6783. [SYSTEM]
  6784. RenderingThread=OFF
  6785. [DISPLAY]
  6786. Resolution=1024x768
  6787. RefreshRate=60Hz
  6788. FullScreen=YES
  6789. VSync=OFF
  6790. FrameRate=VARIABLE
  6791. Aspect=AUTO
  6792. [GRAPHICS]
  6793. MSAA=NONE
  6794. TextureFilter=DEFAULT
  6795. ModelQuality=HIGH
  6796. StageQuality=HIGH
  6797. SoftShadowQuality=LOW
  6798. SelfShadowQuality=LOW
  6799. MotionBlurQuality=LOW
  6800. ParticleQuality=MIDDLE
  6801. ExtraTouch=OFF
  6802. Brightness=50
  6803. [BENCHMARK]
  6804. Type=BATTLE+DEMO
  6805. Loop=OFF
  6806. [GAME]
  6807. FPS=ON
  6808. __EOF__
  6809. fi
  6810. fi
  6811. cd "$olddir"
  6812. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6813. ${programfilesdrive}:
  6814. cd "$programfilesdir_x86_win\\CAPCOM\\STREETFIGHTERIV_BENCHMARK"
  6815. StreetFighterIV_Benchmark.exe
  6816. __EOF__
  6817. }
  6818. #----------------------------------------------------------------
  6819. verblist_add smbx "Super Mario Bros. X (Indie, 2009) [download]" smbx122.exe
  6820. load_smbx() {
  6821. # Download URL embedded in http://www.supermariobrothers.org/downloads/smbx122.html
  6822. download $PACKAGE http://www.tehgamez.com/a/smbx122.exe 269eb60d502e57fdfae9c3601ad9ee22801cb5d1
  6823. # This winetricks verb doesn't work on Windows yet, but that's ok-ish, Windows comes with vb6 runtime
  6824. sh "$WINETRICKS" -q vb6run
  6825. if workaround_wine_bug 23821
  6826. then
  6827. # http://www.supermariobrothers.org/forums/viewtopic.php?f=8&t=6711
  6828. # claims this works
  6829. sh "$WINETRICKS" -q quartz
  6830. fi
  6831. cd "$WISOTOOL_CACHE/$PACKAGE"
  6832. ahk_do "
  6833. SetTitleMatchMode, 2
  6834. run smbx122.exe
  6835. WinWait, Setup - Super Mario Bros. X, Welcome
  6836. Send {Enter}
  6837. WinWait, Setup - Super Mario Bros. X, Information
  6838. Send {Enter}
  6839. WinWait, Setup - Super Mario Bros. X, Select Destination Location
  6840. Send {Enter}
  6841. WinWait, Setup - Super Mario Bros. X, Select Start Menu Folder
  6842. Send {Enter}
  6843. WinWait, Setup - Super Mario Bros. X, Additional Tasks
  6844. Send {Enter}
  6845. WinWait, Setup - Super Mario Bros. X, Recommended by
  6846. MouseMove, 36,274
  6847. Click ; Don't install recommended (Ad) software
  6848. Send {Enter}
  6849. WinWait, Setup - Super Mario Bros. X, Ready to Install
  6850. Send {Enter}
  6851. WinWait, Setup - Super Mario Bros. X, Information
  6852. Send {Enter}
  6853. WinWait, Setup - Super Mario Bros. X, Completing
  6854. Send {Space} ; Don't run game
  6855. Send {Enter}
  6856. "
  6857. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6858. C:
  6859. cd C:\\SMBX
  6860. smbx.exe
  6861. __EOF__
  6862. }
  6863. #----------------------------------------------------------------
  6864. verblist_add timezattack_demo "Timez Attack Demo (BigBrainz, 2005) [download]" Win_TimezAttackFreeInstaller.exe
  6865. load_timezattack_demo() {
  6866. download $PACKAGE http://s3.amazonaws.com/BigBrainz/Win_TimezAttackFreeInstaller.exe aa30905e064c1f28949b56a8ab5ffe1ffa86618c
  6867. cd "$WISOTOOL_CACHE/$PACKAGE"
  6868. # autohotkey can't read any text from this one :-(
  6869. ahk_do "
  6870. settitlematchmode, 2
  6871. run, Win_TimezAttackFreeInstaller.exe
  6872. winwait, Setup
  6873. send {Enter}
  6874. sleep 5000
  6875. send {Tab}{Tab}{Space}{Tab}{Tab}{Tab}{Enter}
  6876. sleep 5000
  6877. send {Enter}
  6878. sleep 5000
  6879. send {Enter}
  6880. sleep 40000 ; fixme: wait for last file to be created
  6881. send {Enter}
  6882. sleep 5000
  6883. ControlClick TkChild14 ; uncheck (start game). fixme: cannot uncheck
  6884. send {Enter}
  6885. sleep 2000
  6886. "
  6887. # fixme: only works on linux
  6888. killall TimezAttack.exe
  6889. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6890. C:
  6891. cd C:\\TimezAttack
  6892. TimezAttack.app\\TimezAttack.exe
  6893. __EOF__
  6894. if workaround_wine_bug 24537
  6895. then
  6896. sh "$WINETRICKS" -q corefonts
  6897. fi
  6898. }
  6899. #----------------------------------------------------------------
  6900. verblist_add tlr_demo "The Last Remnant Demo (Square Enix, 2009) [download]" d96a2ebbd15c3d03286d1b8b5601e7038cab46b1.iso
  6901. load_tlr_demo() {
  6902. # http://appdb.winehq.org/objectManager.php?sClass=version&iId=15997
  6903. # http://news.bigdownload.com/2009/02/26/download-the-last-remnant-demo/
  6904. if ! test -f "$WISOTOOL_CACHE"/$PACKAGE/TheLastRemnant_PC_Demo.zip
  6905. then
  6906. download $PACKAGE http://gamedaily.newaol.com/pub/TheLastRemnant_PC_Demo.zip 86b093eec133393ef47bb1dcd268b38b12927899
  6907. fi
  6908. cd "$WISOTOOL_TMP"
  6909. try unzip "$WISOTOOL_CACHE/$PACKAGE/TheLastRemnant_PC_Demo.zip"
  6910. cd "The Last Remnant Trial Version"
  6911. ahk_do "
  6912. settitlematchmode, 2
  6913. run, setup.exe
  6914. winwait, The Last Remnant Trial Version, Please close all unnecessary running
  6915. sleep 1000
  6916. controlclick, Button1, The Last Remnant Trial Version, Please close all unnecessary running
  6917. winwait, The Last Remnant Trial Version, Welcome to the InstallShield Wizard
  6918. sleep 1000
  6919. controlclick, Button1, The Last Remnant Trial Version, Welcome to the InstallShield Wizard
  6920. winwait, The Last Remnant Trial Version, License Agreement
  6921. sleep 1000
  6922. controlclick, Button5, The Last Remnant Trial Version, License Agreement
  6923. sleep 1000
  6924. controlclick, Button2, The Last Remnant Trial Version, License Agreement
  6925. winwait, The Last Remnant Trial Version, Choose Destination Location
  6926. sleep 1000
  6927. controlclick, Button1, The Last Remnant Trial Version, Choose Destination Location
  6928. winwait, The Last Remnant Trial Version, The wizard is ready to begin installation.
  6929. sleep 1000
  6930. controlclick, Button1, The Last Remnant Trial Version, The wizard is ready to begin installation.
  6931. winwait, The Last Remnant Trial Version, InstallShield Wizard Complete
  6932. sleep 1000
  6933. controlclick, Button4, The Last Remnant Trial Version, InstallShield Wizard Complete
  6934. "
  6935. # FIXME: When running, the window has the wrong size. Wine or app bug?
  6936. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6937. ${programfilesdrive}:
  6938. cd "$programfilesdir_x86_win\\SquareEnix\\The Last Remnant Trial Version\\Binaries"
  6939. TLRDemo.exe
  6940. __EOF__
  6941. warn "The mouse seems broken, see bug 6971 for possible workarounds (mwo={force,disabled,enabled} didn't work for me)."
  6942. }
  6943. #----------------------------------------------------------------
  6944. verblist_add tmnationsforever "TrackMania Nations Forever (Nadeo, 2009) [download]" tmnationsforever_setup.exe
  6945. load_tmnationsforever() {
  6946. if workaround_wine_bug 20915
  6947. then
  6948. warn "Gameplay and sound may be very choppy on some machines :-("
  6949. fi
  6950. download $PACKAGE "http://files.trackmaniaforever.com/tmnationsforever_setup.exe" cab0cf66db0471bc2674a3b1aebc35de0bca6ed0
  6951. cd "$WISOTOOL_CACHE/$PACKAGE"
  6952. ahk_do "
  6953. SetTitleMatchMode, 2
  6954. run tmnationsforever_setup.exe
  6955. WinWait,Select Setup Language,language
  6956. Sleep 1000
  6957. ControlClick TNewButton1 ; OK
  6958. WinWait,Setup - TmNationsForever,Welcome
  6959. Sleep 1000
  6960. ControlClick TNewButton1 ; Next
  6961. WinWait,Setup - TmNationsForever,License
  6962. Sleep 1000
  6963. ControlClick TNewRadioButton1 ; Accept
  6964. Sleep 1000
  6965. ControlClick TNewButton2 ; Next
  6966. WinWait,Setup - TmNationsForever,Where
  6967. Sleep 1000
  6968. ControlClick TNewButton3 ; Next
  6969. WinWait,Setup - TmNationsForever,shortcuts
  6970. Sleep 1000
  6971. ControlClick TNewButton4 ; Next
  6972. WinWait,Setup - TmNationsForever,perform
  6973. Sleep 1000
  6974. ControlClick TNewButton4 ; Next
  6975. WinWait,Setup - TmNationsForever,installing
  6976. Sleep 1000
  6977. ControlClick TNewButton4 ; Install
  6978. WinWait,Setup - TmNationsForever,finished
  6979. Sleep 1000
  6980. ControlFocus, TNewCheckListBox1, TmNationsForever, finished
  6981. Sleep 1000
  6982. Send {Space} ; don't start game
  6983. ControlClick TNewButton4 ; Finish
  6984. "
  6985. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  6986. ${programfilesdrive}:
  6987. cd "$programfilesdir_x86_win\\TmNationsForever"
  6988. TmForever.exe
  6989. __EOF__
  6990. }
  6991. #----------------------------------------------------------------
  6992. verblist_add twfc "Transformers: War for Cybertron (Activision, 2010)" d96a2ebbd15c3d03286d1b8b5601e7038cab46b1.iso
  6993. load_twfc() {
  6994. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/d96a2ebbd15c3d03286d1b8b5601e7038cab46b1.iso
  6995. KEY=`cat "$WISOTOOL_CACHE"/$PACKAGE/d96a2ebbd15c3d03286d1b8b5601e7038cab46b1.txt | tr -d -`
  6996. ahk_do "
  6997. run ${ISO_MOUNT_LETTER}:setup.exe
  6998. SetTitleMatchMode, 2
  6999. winwait, Activision, Select the language for the installation
  7000. sleep 1000
  7001. controlclick, Button1, Activision, Select the language for the installation
  7002. winwait, Transformers, Press NEXT to verify your key
  7003. sleep 1000
  7004. send $KEY
  7005. send {Enter}
  7006. winwait, Keycode Check, The Keycode you entered appears to be valid
  7007. sleep 1000
  7008. send {Enter}
  7009. winwait, Transformers, The InstallShield Wizard will install Transformers
  7010. sleep 1000
  7011. controlclick, Button1, Transformers, The InstallShield Wizard will install Transformers
  7012. winwait, Transformers, License Agreement
  7013. sleep 1000
  7014. controlclick, Button5, Transformers, License Agreement
  7015. sleep 1000
  7016. controlclick, Button2, Transformers, License Agreement
  7017. winwait, Transformers, Minimum System Requirements
  7018. sleep 1000
  7019. controlclick, Button1, Transformers, Minimum System Requirements
  7020. winwait, Transformers, Select the setup type to install
  7021. sleep 1000
  7022. controlclick, Button4, Transformers, Select the setup type to install
  7023. ; Installer exits silently. Prevent an early umount:
  7024. sleep 5000
  7025. Loop
  7026. {
  7027. ifwinexist, Transformers
  7028. sleep 15000
  7029. else
  7030. break
  7031. }
  7032. "
  7033. iso_umount
  7034. if workaround_wine_bug 6971
  7035. then
  7036. sh "$WINETRICKS" mwo=force
  7037. fi
  7038. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7039. ${programfilesdrive}:
  7040. cd "$programfilesdir_x86_win\Activision\Transformers - War for Cybertron\Binaries"
  7041. TWFC.exe
  7042. __EOF__
  7043. }
  7044. #----------------------------------------------------------------
  7045. verblist_add tropico3_demo "Tropico 3 Demo (Kalypso Media GmbH, 2009) [download]" Tropico3Demo.exe
  7046. load_tropico3_demo() {
  7047. if ! test -f "$WISOTOOL_CACHE/$PACKAGE"/Tropico3Demo.exe
  7048. then
  7049. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  7050. die "Please visit http://www.fileshack.com/file_download.x/15191 or http://www.tropico3.com/?p=downloads, download Tropico3Demo.exe, and place it in directory $WISOTOOL_CACHE/$PACKAGE"
  7051. fi
  7052. # FIXME: check sha1sum e031749db346ac3a87a675787c81eb1ca8cb5909
  7053. if workaround_wine_bug 24819
  7054. then
  7055. sh "$WINETRICKS" gameux=disabled
  7056. $WINESERVER -w
  7057. fi
  7058. cd "$WISOTOOL_CACHE/$PACKAGE"
  7059. ahk_do "
  7060. SetTitleMatchMode, 2
  7061. run Tropico3Demo.exe
  7062. WinWait,Installer Language,select
  7063. sleep 1000
  7064. ControlClick Button1 ; OK
  7065. WinWait,Tropico,Welcome
  7066. sleep 1000
  7067. ControlClick Button2 ; Next
  7068. WinWait,Tropico,License
  7069. sleep 1000
  7070. ControlClick Button2 ; Agree
  7071. WinWait,Tropico,Typical
  7072. sleep 1000
  7073. ControlClick Button2 ; Next
  7074. WinWait,Tropico,Completing
  7075. sleep 1000
  7076. ControlClick Button4 ; Uncheck Run Now
  7077. ControlClick Button2 ; Finish
  7078. "
  7079. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7080. ${programfilesdrive}:
  7081. cd "$programfilesdir_x86_win\\Kalypso\\Tropico 3 Demo"
  7082. Tropico3 Demo.exe
  7083. __EOF__
  7084. if workaround_wine_bug 16328
  7085. then
  7086. # 20540 is a dup of 16328, but it describes the problem nicely
  7087. warn "seawater is invisible due to wine bug 20540, work around this by applying the patch from http://bugs.winehq.org/show_bug.cgi?id=16328#c180"
  7088. fi
  7089. if workaround_wine_bug 24845
  7090. then
  7091. sh "$WINETRICKS" mmdevapi=disabled
  7092. fi
  7093. }
  7094. #----------------------------------------------------------------
  7095. verblist_add typingofthedead_demo "Typing of the Dead Demo (Sega, 1999) [download]" Tod_e_demo.exe
  7096. load_typingofthedead_demo() {
  7097. download $PACKAGE "http://downloads.pcworld.com/pub/new/fun_and_games/other/tod-demo.zip" 96fe3edb2431210932af840e29c59bce6b7fc80f
  7098. cd "$WISOTOOL_CACHE/$PACKAGE"
  7099. mkdir "$WISOTOOL_TMP/tod-demo"
  7100. cp tod-demo.zip "$WISOTOOL_TMP/tod-demo"
  7101. cd "$WISOTOOL_TMP/tod-demo"
  7102. unzip tod-demo.zip
  7103. rm tod-demo.zip
  7104. ahk_do "
  7105. SetTitleMatchMode, 2
  7106. run SETUP.EXE
  7107. WinWait,InstallShield Wizard,where
  7108. sleep 1000
  7109. ControlClick Button1 ; Next
  7110. WinWait,InstallShield Wizard,icons
  7111. sleep 1000
  7112. ControlClick Button2 ; Next
  7113. ; installer crashes here?
  7114. Sleep 20000
  7115. "
  7116. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7117. ${programfilesdrive}:
  7118. cd "$programfilesdir_x86_win\\SEGA\\TOD-Demo"
  7119. Tod_e_demo.exe
  7120. __EOF__
  7121. }
  7122. #----------------------------------------------------------------
  7123. verblist_add unigine_heaven "Unigen Heaven 2 Benchmark (Unigen, 2010) [download]" Unigine_Heaven-2.0.msi
  7124. load_unigine_heaven() {
  7125. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Unigine_Heaven-2.0.msi"
  7126. then
  7127. warn "This download is slow, you may want to do a manual download from http://downloads.guru3d.com/Unigine-Heaven-DirectX-11-benchmark-2.0-download-2414.html instead"
  7128. #download $PACKAGE http://www.techpowerup.com/downloads/1775e/Unigine_Heaven-2.0.msi 6a0bd499ae8ed8d73d74d964d3c4312a0a40b7e6
  7129. download $PACKAGE http://unigine.com/download/files/Unigine_Heaven-2.0.msi 6a0bd499ae8ed8d73d74d964d3c4312a0a40b7e6
  7130. fi
  7131. cd "$WISOTOOL_CACHE/$PACKAGE"
  7132. ahk_do "
  7133. run msiexec /i Unigine_Heaven-2.0.msi
  7134. WinWait ahk_class MsiDialogCloseClass
  7135. Sleep 1000
  7136. Send {Enter}
  7137. WinWait ahk_class MsiDialogCloseClass, License
  7138. ControlClick Button1 ; Accept
  7139. ControlClick Button3 ; Accept
  7140. WinWait ahk_class MsiDialogCloseClass, Choose
  7141. ControlClick Button1 ; Typical
  7142. WinWait ahk_class MsiDialogCloseClass, Ready
  7143. ControlClick Button2 ; Install
  7144. ; FIXME: on systems with OpenAL already (Win7?), the next four lines
  7145. ; are not needed. We should somehow wait for either OpenAL window
  7146. ; *or* Completed window.
  7147. WinWait ahk_class OpenAL Installer
  7148. ControlClick Button2 ; OK
  7149. WinWait ahk_class #32770
  7150. ControlClick Button1 ; OK
  7151. WinWait ahk_class MsiDialogCloseClass, Completed
  7152. Sleep 500
  7153. ControlClick Button1 ; Finish
  7154. Send {Enter}
  7155. "
  7156. if workaround_wine_bug 22614
  7157. then
  7158. # hope your card actually has 1GB of RAM
  7159. sh "$WINETRICKS" videomemorysize=1024
  7160. fi
  7161. # Should start Heaven.exe, but that doesn't run in Wine
  7162. # Should give option to run Heaven_gl.bat (even works in Wine)
  7163. # or the dx10 or dx11 versions (doesn't).
  7164. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7165. ${programfilesdrive}:
  7166. cd "$programfilesdir_x86_win\Unigine\Heaven"
  7167. cmd /c Heaven_d3d9.bat
  7168. __EOF__
  7169. }
  7170. #----------------------------------------------------------------
  7171. verblist_add vegas "Rainbow Six: Vegas (Ubisoft, 2006) [broken-wine-drm]" \
  7172. be7cf72572708e9776af73c9bec8ee07952385af.iso \
  7173. abd625abe57c7a9ffe5083e69ddc9f2a978c9e84.iso
  7174. load_vegas() {
  7175. if workaround_wine_bug 7065
  7176. then
  7177. warn "This game's DRM is not supported by wine"
  7178. fi
  7179. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/be7cf72572708e9776af73c9bec8ee07952385af.iso
  7180. ahk_do "
  7181. SetTitleMatchMode, 2
  7182. Run, ${ISO_MOUNT_LETTER}:setup.exe
  7183. WinWait, Choose Setup Language
  7184. WinActivate
  7185. ControlClick Button1 ; OK
  7186. WinWait, , Welcome
  7187. WinActivate
  7188. ControlClick Button1 ; next
  7189. WinWait, , License Agreement
  7190. WinActivate
  7191. ControlClick Button3 ; accept eula
  7192. ControlClick Button1 ; next
  7193. WinWait, , Choose Destination Location
  7194. WinActivate
  7195. ControlClick Button4 ; next
  7196. WinWait, , Ready to Install
  7197. WinActivate
  7198. ControlClick Button1 ; install
  7199. WinWait, Setup Needs The Next Disk
  7200. WinActivate
  7201. "
  7202. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/abd625abe57c7a9ffe5083e69ddc9f2a978c9e84.iso
  7203. ahk_do "
  7204. SetTitleMatchMode, 2
  7205. Send {Enter}
  7206. WinWait, Microsoft DirectX Setup
  7207. WinActivate
  7208. ControlClick Button2 ; no
  7209. WinWait, , It is STRONGLY recommended that you install the latest DirectX runtimes
  7210. WinActivate
  7211. ControlClick Button1 ; ok
  7212. WinWait, Microsoft DirectX Setup
  7213. WinActivate
  7214. ControlClick Button2 ; No
  7215. WinWait, , Installation Completed
  7216. ControlClick Button1 ; untick desktop icon
  7217. ControlClick Button2 ; untick registration
  7218. ControlClick Button4 ; finish
  7219. WinWait, Detection
  7220. WinActivate
  7221. ControlClick Button1 ; quit
  7222. Sleep 1000 ; does not detect system properly, wait for warning popup and quit
  7223. Send {Enter} ; quit
  7224. "
  7225. iso_umount
  7226. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7227. cd "$programfilesdir_x86_win\\Ubisoft\\Tom Clancy's Rainbow Six Vegas\\Binaries"
  7228. R6Vegas_Launcher.exe
  7229. __EOF__
  7230. }
  7231. #----------------------------------------------------------------
  7232. verblist_add vegas2 "Rainbow Six: Vegas 2 (Ubisoft, 2008) [broken-wine-drm]" \
  7233. e720e914eeb98dbd2ec140d15d32ce6317e24f86.iso \
  7234. 1430fdaa49165d1bed439ddffa65e9fa2af4d498.iso
  7235. load_vegas2() {
  7236. if workaround_wine_bug 219
  7237. then
  7238. warn "This game's DRM is not supported by wine"
  7239. fi
  7240. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e720e914eeb98dbd2ec140d15d32ce6317e24f86.iso
  7241. ahk_do "
  7242. SetTitleMatchMode, 2
  7243. Run, ${ISO_MOUNT_LETTER}:setup.exe
  7244. WinWait, Tom Clancy
  7245. WinActivate
  7246. ControlClick Button3 ; next
  7247. WinWait, , Welcome
  7248. WinActivate
  7249. ControlClick Button1 ; next
  7250. WinWait, , License Agreement
  7251. WinActivate
  7252. ControlClick Button5 ; accept eula
  7253. ControlClick Button2 ; next
  7254. WinWait, , Ready to Install
  7255. WinActivate
  7256. ControlClick Button1 ; install
  7257. WinWait, Setup Needs The Next Disk
  7258. WinActivate
  7259. "
  7260. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/1430fdaa49165d1bed439ddffa65e9fa2af4d498.iso
  7261. ahk_do "
  7262. SetTitleMatchMode, 2
  7263. Send {Enter}
  7264. WinWait, Detection
  7265. WinActivate
  7266. ControlClick Button1 ; close
  7267. WinWait, Setup Needs The Next Disk
  7268. WinActivate
  7269. "
  7270. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/e720e914eeb98dbd2ec140d15d32ce6317e24f86.iso
  7271. ahk_do "
  7272. SetTitleMatchMode, 2
  7273. Send {Enter}
  7274. WinWait, , Installation Completed
  7275. WinActivate
  7276. ControlClick Button4 ; finish
  7277. "
  7278. iso_umount
  7279. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7280. cd "$programfilesdir_x86_win\\Ubisoft\\Tom Clancy's Rainbow Six Vegas 2\\Binaries"
  7281. R6Vegas2_Launcher.exe
  7282. __EOF__
  7283. }
  7284. #----------------------------------------------------------------
  7285. verblist_add victoria2_demo "Victoria 2 Demo (Paradox Interactive, 2010) [download]"
  7286. load_victoria2_demo() {
  7287. # download zip file via torrent from http://www.gamershell.com/download_62070.shtml
  7288. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/Victoria2_Demo.zip"
  7289. then
  7290. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  7291. die "Download Victoria2_Demo.zip from http://www.gamershell.com/download_62070.shtml and place in $WISOTOOL_CACHE/$PACKAGE"
  7292. fi
  7293. # FIXME: check sha1sum 20bac88a3ace1010e4fb116d72baf95e92976b39
  7294. # or better, check sha1sum of extracted .exe, since different
  7295. # sources add their own readme in the .zip file
  7296. mkdir -p "$WISOTOOL_TMP"/$PACKAGE/
  7297. cd "$WISOTOOL_TMP"/$PACKAGE/
  7298. try unzip "$WISOTOOL_CACHE/$PACKAGE"/Victoria2_Demo.zip
  7299. # Clean up old temp files from installer extractor (it leaves them around)
  7300. rm -rf temp_files_for_v2
  7301. # Run installer -- the ifwinactive statements are due to things that may not appear in Win7
  7302. ahk_do "
  7303. SetTitleMatchMode, 2
  7304. run, Victoria2_Demo.exe
  7305. winwait, WinRAR
  7306. ControlClick, Button2, WinRAR
  7307. winwait, InstallShield, Welcome to the
  7308. sleep 1000
  7309. ControlClick, Button1, InstallShield, Welcome to the
  7310. winwait, InstallShield, License Agreement
  7311. sleep 1000
  7312. ControlClick, Button2, InstallShield, License Agreement
  7313. winwait, InstallShield, Setup will install
  7314. sleep 1000
  7315. ControlClick, Button1, InstallShield, Setup will install
  7316. winwait, InstallShield, Setup will add program icons
  7317. sleep 1000
  7318. ControlClick, Button2, InstallShield, Setup will add program icons
  7319. WinWait, InstallShield, Setup is performing
  7320. WinWaitClose, InstallShield, Setup is performing
  7321. loop
  7322. {
  7323. ifwinexist, Microsoft Visual C++, Please read the following license
  7324. {
  7325. winactivate, Microsoft Visual C++, Please read the following license
  7326. sleep 1000
  7327. ControlClick, Button1, Microsoft Visual C++, Please read the following license
  7328. WinWaitClose, Microsoft Visual C++
  7329. WinWaitClose, Microsoft Visual C++
  7330. WinWaitClose, Microsoft Visual C++
  7331. }
  7332. ifwinexist, DirectX, Welcome to setup for DirectX
  7333. {
  7334. sleep 1000
  7335. ControlClick, Button6, DirectX, Welcome to setup for DirectX
  7336. WinWaitClose, DirectX, Welcome to setup for DirectX
  7337. }
  7338. ifwinexist, InstallShield, InstallShield Wizard Complete
  7339. {
  7340. sleep 1000
  7341. break
  7342. }
  7343. sleep 100
  7344. }
  7345. ControlClick, Button1, InstallShield, InstallShield Wizard Complete
  7346. ControlClick, Button2, InstallShield, InstallShield Wizard Complete
  7347. ControlClick, Button4, InstallShield, InstallShield Wizard Complete
  7348. winwaitclose, InstallShield, InstallShield Wizard Complete
  7349. "
  7350. if workaround_wine_bug 24422
  7351. then
  7352. sh "$WINETRICKS" -q d3dx9_36
  7353. fi
  7354. if workaround_wine_bug 24217
  7355. then
  7356. sh "$WINETRICKS" -q dsoundbug9612
  7357. fi
  7358. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7359. ${programfilesdrive}:
  7360. cd "$programfilesdir_x86_win\\Paradox Interactive\\Victoria 2 - DEMO"
  7361. v2demo.exe
  7362. __EOF__
  7363. }
  7364. #----------------------------------------------------------------
  7365. verblist_add vf2_demo "Virtua Fighter 2 demo (Sega, 1997) [download]" vf2_demo.exe
  7366. load_vf2_demo()
  7367. {
  7368. if ! test -f "$WISOTOOL_CACHE/$PACKAGE/vf2_demo.exe"
  7369. then
  7370. download $PACKAGE http://www.sega.com/support/pcdownloads/vf2_demo/vf2_demo.exe efd34dd079cdfd7b2ccc195b584d7ca10ec7e82b
  7371. fi
  7372. mkdir -p "$WISOTOOL_TMP/$PACKAGE"
  7373. cd "$WISOTOOL_CACHE/$PACKAGE"
  7374. try unzip vf2_demo.exe -d "$WISOTOOL_TMP/$PACKAGE"
  7375. cd "$WISOTOOL_TMP/$PACKAGE"
  7376. # installer refuses to run in Windows NT 5 or higher, so set win98 mode
  7377. # FIXME: undo this when verb is done
  7378. case "$OS" in
  7379. "Windows_NT")
  7380. export __COMPAT_LAYER=Win95
  7381. ;;
  7382. *)
  7383. sh $WINETRICKS win98
  7384. ;;
  7385. esac
  7386. chmod +x SETUP.EXE
  7387. ahk_do "
  7388. SetTitleMatchMode, 2
  7389. run, setup.exe
  7390. winwait, Welcome, Virtua
  7391. send {Enter}
  7392. winwait, Get Destination Path
  7393. send {Enter} ; accept default path
  7394. winwait, Setup
  7395. send {Enter} ; yes, create or replace
  7396. winwaitclose ; wait for error message window to go away
  7397. winwaitclose, Get Destination Path
  7398. winwait, Setup, Play
  7399. send E ; Don't play
  7400. winwaitclose
  7401. "
  7402. cd "$olddir"
  7403. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7404. C:
  7405. cd C:\\SEGA\\VF2DEMO
  7406. rem FIXME: __COMPAT_LAYER seems to be needed for XP, but breaks vista
  7407. set __COMPAT_LAYER=Win95
  7408. VF2DEMO.exe
  7409. __EOF__
  7410. case "$OS" in
  7411. "Windows_NT")
  7412. warn "$PACKAGE requires an 8 or 16 bit display, so change desktop settings before running. Also, on Windows XP, you'll need to set C:\\SEGA\\VF2DEMO\VF2DEMO.exe to Win95 mode."
  7413. ;;
  7414. *)
  7415. warn "$PACKAGE requires an 8 or 16 bit display. On Linux, try pressing CTRL+ALT+F1, and running 'startx -- :1 -depth 16'. "
  7416. ;;
  7417. esac
  7418. }
  7419. #----------------------------------------------------------------
  7420. verblist_add wog "World of Goo demo (2D Boy, 2008) [download]" WorldOfGooDemo.1.0.exe
  7421. load_wog() {
  7422. if ! test -f "$WISOTOOL_CACHE/wog/WorldOfGooDemo.1.0.exe"
  7423. then
  7424. # Get temporary download location
  7425. download wog "http://www.worldofgoo.com/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe"
  7426. URL=`cat "$WISOTOOL_CACHE/wog/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe" |
  7427. grep WorldOfGooDemo.1.0.exe | sed 's,.*http,http,;s,".*,,'`
  7428. rm "$WISOTOOL_CACHE/wog/dl2.php?lk=demo&filename=WorldOfGooDemo.1.0.exe"
  7429. download wog "$URL" e61d8253b9fe0663cb3c69018bb3d2ec6152d488
  7430. fi
  7431. cd "$WISOTOOL_CACHE/wog"
  7432. ahk_do "
  7433. run WorldOfGooDemo.1.0.exe
  7434. winwait, World of Goo Setup, License Agreement
  7435. sleep 1000
  7436. send {Enter}
  7437. winwait, World of Goo Setup, Choose Components
  7438. send {Enter}
  7439. winwait, World of Goo Setup, Choose Install Location
  7440. send {Enter}
  7441. winwait, World of Goo Setup, Thank you
  7442. ControlClick, Make me dirty right now, World of Goo Setup, Thank you
  7443. send {Enter}
  7444. "
  7445. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7446. ${programfilesdrive}:
  7447. cd "$programfilesdir_x86_win\WorldOfGooDemo"
  7448. WorldOfGoo.exe
  7449. __EOF__
  7450. }
  7451. #----------------------------------------------------------------
  7452. verblist_add wowtrial "World of Warcraft trial(Blizzard, 2009)" TryWoW.exe
  7453. load_wowtrial() {
  7454. download $PACKAGE https://www.worldofwarcraft.com/downloads/files/pc/enUS/TryWoW.exe 832866b591ea20fa2e5d30c36dcca92aec9ea36a
  7455. ahk_do "
  7456. SetTitleMatchMode, slow
  7457. run "$WISOTOOL_CACHE/$PACKAGE/TryWoW.exe"
  7458. winwait, World of Warcraft Trial v2.0.0.373
  7459. sleep 1000
  7460. controlclick, Button2, World of Warcraft Trial v2.0.0.373
  7461. winwait, World of Warcraft Trial v2.0.0.373, &Agree
  7462. sleep 1000
  7463. controlclick, Static2, World of Warcraft Trial v2.0.0.373
  7464. sleep 1000
  7465. controlclick, Button3, World of Warcraft Trial v2.0.0.373
  7466. winwait, World of Warcraft Trial v2.0.0.373, C:\Program Files\World of Warcraft Trial
  7467. sleep 1000
  7468. controlclick, Button2, World of Warcraft Trial v2.0.0.373, C:\Program Files\World of Warcraft Trial
  7469. ; FIXME: What does the success window look like?
  7470. winwait, Launcher, Launcher requires write permission
  7471. sleep 1000
  7472. controlclick, Button1, Launcher
  7473. "
  7474. }
  7475. #----------------------------------------------------------------
  7476. verblist_add wowbc "World of Warcraft: Battle Chest (Blizzard, 2008)" \
  7477. c874f5bc676eef8e60d3d232fe6db185c4632fb3.iso
  7478. load_wowbc() {
  7479. test -f "$WINDIR"/utorrent.exe || try sh $WINETRICKS utorrent
  7480. case "$LANG" in
  7481. en_US*) ;;
  7482. *) die "This script probably only works for World of Warcraft in the enUS locale."
  7483. esac
  7484. # Torrent file URLs found on http://www.wowwiki.com/Patch_mirrors
  7485. # Patches 3.3.2.11403-to-3.3.3.11685-enUS-patch.exe up to 3.3.5 are downloaded from http://alexsmith.im/wow-patches/enus-patches
  7486. download $PACKAGE "http://a.wirebrain.de/wow/torrent/WoW-3.x.x.x-3.2.0.10192-x86-Win-enUS.torrent" f9e96e7b4edc6a4c22faad084eef147853e3ebb5
  7487. download $PACKAGE "http://a.wirebrain.de/wow/torrent/WoW-3.2.0.10192-3.3.0.10958-x86-Win-enUS.torrent" 33bdf8749b3c3781451b5f6ac2a59ba29d6c61bd
  7488. download $PACKAGE "http://a.wirebrain.de/wow/torrent/WoW-3.3.0.10958-3.3.0.11159-x86-Win-enUS.torrent" b7ad37a75713f6d8e578558ca1e321927192c6c6
  7489. download $PACKAGE "http://a.wirebrain.de/wow/torrent/WoW-3.3.0.11159-to-3.3.2.11403-enUS-patch.torrent" f73763541197fecdcca9b9f8cf91e83cde989a49
  7490. download $PACKAGE "http://uk1.files.alexsmith.im/enUS/WoW-3.3.2.11403-to-3.3.3.11685-enUS-patch.exe" ce73a0a8aa9f6eaf00b5e7cd0a34eb928738fd36
  7491. download $PACKAGE "http://uk1.files.alexsmith.im/enUS/WoW-3.3.3.11685-to-3.3.3.11723-enUS-patch.exe"
  7492. download $PACKAGE "http://uk1.files.alexsmith.im/enUS/WoW-3.3.3.11723-to-3.3.5.12213-enUS-patch.exe"
  7493. cd "$WISOTOOL_CACHE/$PACKAGE"
  7494. patch1=`stat -Lc%s WoW-3.2.0-enUS-patch.exe`
  7495. patch2=`stat -Lc%s WoW-3.2.0.10192-to-3.3.0.10958-enUS-patch.exe`
  7496. patch3=`stat -Lc%s WoW-3.3.0.10958-to-3.3.0.11159-enUS-patch.exe`
  7497. patch4=`stat -Lc%s WoW-3.3.0.11159-to-3.3.2.11403-enUS-patch.exe`
  7498. patch5=`stat -Lc%s WoW-3.3.2.11403-to-3.3.3.11685-enUS-patch.exe`
  7499. patch6=`stat -Lc%s WoW-3.3.3.11685-to-3.3.3.11723-enUS-patch.exe`
  7500. patch7=`stat -Lc%s WoW-3.3.3.11723-to-3.3.5.12213-enUS-patch.exe`
  7501. if [ $patch5 -ne 128600432 ] || [ $patch6 -ne 4959280 ] || [ $patch7 -ne 24886168 ]
  7502. then
  7503. die "Failed to download patch 3.3.3.11685, or patch 3.3.3.11723, or patch 3.3.5.12213"
  7504. fi
  7505. if [ $patch1 -eq 1323316774 ] && [ $patch2 -eq 572045930 ] && [ $patch3 -eq 5101376 ] && [ $patch4 -eq 167050587 ]
  7506. then
  7507. echo "All patches have been downloaded"
  7508. else
  7509. UT_WINPATH="$WISOTOOL_CACHE_WIN\\wowbc"
  7510. for torrent in `ls *.torrent`
  7511. do
  7512. try $WINE utorrent "/DIRECTORY" "$UT_WINPATH" "$UT_WINPATH\\$torrent" &
  7513. done
  7514. # Start uTorrent, have it wait until all downloads are finished
  7515. ahk_do "
  7516. SetTitleMatchMode, 2
  7517. winwait, Torrent
  7518. sleep 3000
  7519. ;App doesnt remember the set as default setting
  7520. winwait, Torrent, default
  7521. send n
  7522. sleep 3000
  7523. ;Cancels bandwidth test on first run of uTorrent
  7524. ifwinactive, Torrent, Bandwidth
  7525. {
  7526. controlclick, Button5, Torrent, Bandwidth
  7527. }
  7528. sleep 1000
  7529. ;Sets paramater to close uTorrent once all downloads are complete
  7530. send !o
  7531. send a{Down}{Enter}
  7532. winwaitclose, Torrent
  7533. "
  7534. fi
  7535. cd "$olddir"
  7536. if ! test -d "$WISOTOOL_TMP"/$PACKAGE/tempcd
  7537. then
  7538. try mkdir -p "$WISOTOOL_TMP"/$PACKAGE/tempcd
  7539. iso_mount "$WISOTOOL_CACHE"/$PACKAGE/c874f5bc676eef8e60d3d232fe6db185c4632fb3.iso
  7540. sleep 5
  7541. try cp -r "$ISO_MOUNT_ROOT"/* "$WISOTOOL_TMP"/$PACKAGE/tempcd
  7542. fi
  7543. # Checks if WoW is installed. If so, skips primary install and proceeds to applying patches
  7544. if ! test -d "$DRIVE_C/Program Files/World of Warcraft"
  7545. then
  7546. ahk_do "
  7547. run "$WISOTOOL_TMP_WIN"/$PACKAGE/tempcd/Installer.exe
  7548. SetTitleMatchMode, 2
  7549. winwait, Burning Crusade Installer
  7550. sleep 4000
  7551. send b
  7552. sleep 2000
  7553. send o
  7554. winwait, License Agreement
  7555. winactivate
  7556. MouseMove, 300, 300
  7557. Click WheelDown, 90
  7558. Sleep, 2000
  7559. ControlClick, Button1
  7560. winwait, Installation Destination Directory
  7561. send {Enter}
  7562. winwait, Manage
  7563. ControlClick, Button2
  7564. Loop
  7565. {
  7566. ; World Of Warcraft directory is created as .temp, then renamed when done
  7567. ifExist, C:\Program Files\World of Warcraft\Logs\Burning Crusade Install Log.html
  7568. break
  7569. Sleep 10000
  7570. }
  7571. "
  7572. killall Launcher.exe
  7573. killall Installer.exe
  7574. fi
  7575. cd "$WISOTOOL_CACHE/$PACKAGE"
  7576. for file in \
  7577. WoW-3.2.0-enUS-patch.exe\
  7578. WoW-3.2.0.10192-to-3.3.0.10958-enUS-patch.exe\
  7579. WoW-3.3.0.10958-to-3.3.0.11159-enUS-patch.exe\
  7580. WoW-3.3.0.11159-to-3.3.2.11403-enUS-patch.exe\
  7581. WoW-3.3.2.11403-to-3.3.3.11685-enUS-patch.exe\
  7582. WoW-3.3.3.11685-to-3.3.3.11723-enUS-patch.exe\
  7583. WoW-3.3.3.11723-to-3.3.5.12213-enUS-patch.exe
  7584. do
  7585. ahk_do "
  7586. run "$WISOTOOL_CACHE"/$PACKAGE/$file
  7587. SetTitleMatchMode, 2
  7588. winwait, Blizzard Updater
  7589. IfWinExist, Blizzard Updater, unable to start ;Exit if patch is already applied
  7590. {
  7591. ControlClick, Button1, Blizzard Updater, unable to start
  7592. exit
  7593. }
  7594. else
  7595. {
  7596. winwait, Blizzard Updater, The update was successful
  7597. ControlClick, Button1
  7598. winwait, Launcher
  7599. winkill, Launcher
  7600. winwait, World of Warcraft
  7601. sleep 5000 ; Give time for Play button to appear
  7602. IfWinExist, World of Warcraft, Play ;Exit if last patch is applied
  7603. {
  7604. ; Done! No more patches.
  7605. winkill, World of Warcraft, Play
  7606. }
  7607. else
  7608. {
  7609. ; Dont let it download the next patch
  7610. winwait, World of Warcraft, Estimated time
  7611. winkill, World of Warcraft, Estimated time
  7612. }
  7613. }
  7614. "
  7615. echo "Patched $file"
  7616. sleep 5
  7617. done
  7618. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7619. ${programfilesdrive}:
  7620. cd "$programfilesdir_x86_win\\World of Warcraft"
  7621. Wow.exe
  7622. __EOF__
  7623. }
  7624. #----------------------------------------------------------------
  7625. verblist_add zootycoon2_demo "Zoo Tycoon 2 demo (Microsoft, 2004) [download]" Zoo2Trial.exe
  7626. load_zootycoon2_demo() {
  7627. download $PACKAGE "http://download.microsoft.com/download/9/f/6/9f6a95f0-f34a-4312-9749-77b81d3de245/Zoo2Trial.exe" 60ad1bb34351f97b579c58234b926055f7979126
  7628. cd "$WISOTOOL_CACHE/$PACKAGE"
  7629. ahk_do "
  7630. ; Uses winwaitactive, because the windows appear and immediately after another window
  7631. ; gets in the way, then disappears after a second or so
  7632. SetTitleMatchMode, 2
  7633. run Zoo2Trial.exe
  7634. winwaitclose, APPMESSAGE
  7635. winwaitactive, Zoo Tycoon 2 Trial, AUTORUN
  7636. sleep 1000
  7637. controlclick, CButtonClassName1, Zoo Tycoon 2 Trial, AUTORUN
  7638. winwaitclose, APPMESSAGE
  7639. winwaitactive, Zoo Tycoon 2 Trial, INSTALLTYPE
  7640. ; 1 second was not enough.
  7641. sleep 3000
  7642. controlclick, CButtonClassName1, Zoo Tycoon 2 Trial, INSTALLTYPE
  7643. winwaitactive, Zoo Tycoon 2 Trial, COMPLETE
  7644. winclose, Zoo Tycoon 2 Trial, COMPLETE
  7645. "
  7646. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7647. ${programfilesdrive}:
  7648. cd "$programfilesdir_x86_win\\Microsoft Games\\Zoo Tycoon 2 Trial Version"
  7649. zt2demoretail.exe
  7650. __EOF__
  7651. }
  7652. #----------------------------------------------------------------
  7653. # Generic Positech installer
  7654. _load_positech()
  7655. {
  7656. dl_path="$1"
  7657. hash_sum="$2"
  7658. installer_name="$3"
  7659. window_title="$4"
  7660. installed_dir="$5"
  7661. installed_exe="$6"
  7662. download $PACKAGE $dl_path $hash_sum
  7663. cd "$WISOTOOL_CACHE/$PACKAGE"
  7664. ahk_do "
  7665. run, $installer_name
  7666. WinWait, $window_title
  7667. WinActivate
  7668. ControlClick TNewButton1 ; Next
  7669. WinWait, $window_title,Select Destination
  7670. WinActivate
  7671. ControlClick TNewButton3 ; Next
  7672. WinWait, $window_title,Select Start
  7673. WinActivate
  7674. ControlClick TNewButton4 ; Next
  7675. WinWait, $window_title,Ready to Install
  7676. WinActivate
  7677. ControlClick TNewButton4 ; Install
  7678. WinWait, $window_title,Completing
  7679. WinActivate
  7680. Send {Space} ; Untick launch
  7681. ControlClick TNewButton4 ; Finish
  7682. "
  7683. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7684. ${programfilesdrive}:
  7685. cd "$programfilesdir_x86_win\\$installed_dir"
  7686. $installed_exe
  7687. __EOF__
  7688. }
  7689. verblist_add gsb_demo "Gratuitous Space Battles demo (Positech Games, 2009) [download]" GSBDemoInstaller.exe
  7690. load_gsb_demo() {
  7691. _load_positech "http://www.positech.co.uk/gratuitousspacebattles/downloads/GSBDemoInstaller.exe" 83dab80aa3bb94aa886c94b2cb68fa54558fe563 "GSBDemoInstaller.exe" "Setup - Gratuitous Space Battles Demo" "Gratuitous Space Battles Demo" "GSBDemo.exe"
  7692. if workaround_wine_bug 22393
  7693. then
  7694. sh "$WINETRICKS" -q d3dx9_36
  7695. fi
  7696. if workaround_wine_bug 24395
  7697. then
  7698. warn "If the game crashes with 'Error initializing output device. ..\src\GUI_Sounds.cpp 661', try disabling pulseaudio, and post a comment to bug 24395 saying whether it helped."
  7699. fi
  7700. }
  7701. verblist_add democracy2_demo "Democracy2 demo (Positech Games, 2007) [download]" Democracy2Demo.exe
  7702. load_democracy2_demo() {
  7703. _load_positech "http://www.positech.co.uk/democracy2/Democracy2Demo.exe" 117cb63119adb3f79034ee3fcf641629dc825615 "Democracy2Demo.exe" "Setup - Democracy 2 Demo" "Democracy2 Demo" "Democracy2.exe"
  7704. }
  7705. verblist_add kudos2_demo "Kudos 2 demo (Positech Games, 2008) [download]" Kudos2DemoInstaller.exe
  7706. load_kudos2_demo() {
  7707. _load_positech "http://www.positech.co.uk/kudos2/Kudos2DemoInstaller.exe" 31abe5a4ce10eb111e0306c8c1b5570f2fd43f33 "Kudos2DemoInstaller.exe" "Setup - Kudos 2 Demo" "Kudos 2 Demo" "Kudos2Demo.exe"
  7708. }
  7709. verblist_add rocklegend_demo "Rock Legend demo (Positech Games, 2007) [download]" RockLegendDemo.exe
  7710. load_rocklegend_demo() {
  7711. _load_positech "http://www.positech.co.uk/rocklegend/RockLegendDemo.exe" b9f090d2e6a9e7be860a52c339d599e3c7bfe516 "RockLegendDemo.exe" "Setup - Kudos Rock Legend Demo" "Kudos Rock Legend Demo" "KudosRockLegendDemo.exe"
  7712. }
  7713. #----------------------------------------------------------------
  7714. # Generic Steam installer
  7715. # Usage: app_id game_title game_folder
  7716. # app_id
  7717. # Application ID. See http://developer.valvesoftware.com/wiki/Steam_Application_IDs for list.
  7718. # game_title
  7719. # Used for AutoHotKey. FIXME: is this guaranteed to match the wiki?
  7720. # game_cache_file
  7721. # .gcf or .ncf file name. Note: Does _NOT_ always match the game folder name below.
  7722. # game_folder
  7723. # Folder where files are stored under $STEAMDIR/steamapps/common/
  7724. # game_extra_files
  7725. # Most games/demos come with one .gcf or .ncf file, then everything else in the
  7726. # $STEAMDIR/steamapps/common/$game_folder directory. Some (Total War demos) have several
  7727. # more .gcf/.ncf files. This should be a list, separated by commas.
  7728. #
  7729. #
  7730. # Note: Requires $STEAMUSER $STEAMPASS to be set in your environment or in
  7731. # "$WISOTOOL_CACHE"/STEAM_USER" and in "$WISOTOOL_CACHE"/STEAM_PASS"
  7732. _load_steam_app()
  7733. {
  7734. if [ ! "$STEAM_USER" -a ! -f "$WISOTOOL_CACHE"/STEAM_USER ]
  7735. then
  7736. die "You need to set STEAM_USER variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_USER"
  7737. elif [ ! "$STEAM_USER" -a -f "$WISOTOOL_CACHE"/STEAM_USER ]
  7738. then
  7739. STEAM_USER=`cat "$WISOTOOL_CACHE"/STEAM_USER`
  7740. fi
  7741. if [ ! "$STEAM_PASS" -a ! -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  7742. then
  7743. die "You need to set STEAM_PASS variable in your environment or put it in "$WISOTOOL_CACHE"/STEAM_PASS"
  7744. elif [ ! "$STEAM_PASS" -a -f "$WISOTOOL_CACHE"/STEAM_PASS ]
  7745. then
  7746. STEAM_PASS=`cat "$WISOTOOL_CACHE"/STEAM_PASS`
  7747. fi
  7748. steam_dir="$programfilesdir_unix/Steam"
  7749. test -f "$steam_dir/Steam.exe" || try sh $WINETRICKS -q steam
  7750. app_id="$1"
  7751. game_title="$2"
  7752. game_cache_file="$3"
  7753. game_folder="$4"
  7754. game_extra_files="$5"
  7755. # If files are already cached, skipped downloading/installing and just restore from cache:
  7756. if [ ! -f "$WISOTOOL_CACHE/$PACKAGE/$game_cache_file" ]
  7757. then
  7758. cd "$steam_dir"
  7759. sleep 5
  7760. ahk_do "
  7761. ; Originally used:
  7762. ; run, Steam.exe -login $STEAM_USER $STEAM_PASS -applaunch $app_id
  7763. ; but that doesn't work for all programs. Some would silently fail to start.
  7764. ; Instead, run steam in the background, sleep for 30s to give it enough time
  7765. ; to start, then use the steam:// prototol to install:
  7766. run, Steam.exe -login $STEAM_USER $STEAM_PASS
  7767. ; FIXME: should detect steam running properly...
  7768. ;
  7769. ; Give Steam up to a minute to update itself. Once it is, let it update.
  7770. ; Then give it 30 more seconds.
  7771. ; FIXME: perhaps there's a log/file showing if steam is up to date...
  7772. Winwait, Steam - Updating,,60
  7773. Loop
  7774. {
  7775. SetTitleMatchMode, Slow
  7776. IfWinExist, Steam - Updating
  7777. sleep 10000
  7778. IfWinNotExist, Steam - Updating
  7779. break
  7780. }
  7781. sleep 30000
  7782. run, steam://install/$app_id
  7783. ; Info screen, disk space required, etc.
  7784. winwait, Install - $game_title
  7785. winactivate, Install - $game_title
  7786. ; FIXME: How long should this take?
  7787. sleep 10000
  7788. send {enter}
  7789. sleep 10000
  7790. ; Install shortcuts?
  7791. winwait, Install - $game_title
  7792. winactivate, Install - $game_title
  7793. ; FIXME: How long should this take?
  7794. sleep 10000
  7795. send {enter}
  7796. sleep 10000
  7797. ; Here, it's getting the .gcf/.ncf files. This is normally quick, but can take a long time.
  7798. ; Most finish in a few seconds, but the Total War demos takes a couple minutes.
  7799. ; So, we'll exit AHK, then wait for all the game files to be present,
  7800. ; before continuing the install.
  7801. exit
  7802. "
  7803. if test ! "$game_extra_files" = ""
  7804. then
  7805. # FIXME: Should we perhaps sha1sum? That would get messy...
  7806. cd steamapps
  7807. IFS=$','
  7808. for x in $game_extra_files
  7809. do
  7810. while true
  7811. do
  7812. if test -f $x
  7813. then
  7814. break
  7815. else
  7816. sleep 5
  7817. fi
  7818. done
  7819. done
  7820. unset IFS
  7821. cd ..
  7822. fi
  7823. # FIXME: Is this a long enough sleep?
  7824. sleep 30
  7825. ahk_do "
  7826. winwait, Install - $game_title
  7827. winactivate, Install - $game_title
  7828. ; FIXME: How long should this take?
  7829. sleep 10000
  7830. send {enter}
  7831. "
  7832. # now wait for the download to complete. We're lucky, Steam has some nice logging
  7833. # so we wait until Steam reports the download is complete. Then, to be safe, sleep
  7834. # and extra 30 seconds, shutdown steam nicely, and finally, cache everything.
  7835. # These are the lines I found for success:
  7836. #
  7837. # $steam_dir/logs/download_log.txt
  7838. # [2010-06-17 00:53:06]: Got eSteamNotifyAppDownloadingPaused for AppID 6110
  7839. # [2010-06-17 00:53:06]: AppID 6110 is now marked not downloading
  7840. # [2010-06-17 00:53:06]: Got eSteamNotifyCacheLoadingCompleted for AppID 6110
  7841. # [2010-06-17 00:53:06]: SetHasAllLocalContent(true) called for 6110
  7842. # FIXME: are any of these safe to use?
  7843. dl_log="$steam_dir/logs/download_log.txt"
  7844. while true
  7845. do
  7846. grep "SetHasAllLocalContent(true) called for $app_id" "$dl_log" && break
  7847. sleep 15
  7848. done
  7849. sleep 30
  7850. $WINE Steam.exe -shutdown
  7851. mkdir -p "$WISOTOOL_CACHE/$PACKAGE"
  7852. cp -r "$steam_dir/steamapps/common/$game_folder" "$WISOTOOL_CACHE/$PACKAGE"
  7853. cp -r "$steam_dir/steamapps/$game_cache_file" "$WISOTOOL_CACHE/$PACKAGE"
  7854. if test ! "$game_extra_files" = ""
  7855. then
  7856. IFS=$','
  7857. for x in $game_extra_files
  7858. do
  7859. cp "$steam_dir/steamapps/$x" "$WISOTOOL_CACHE/$PACKAGE"
  7860. done
  7861. unset IFS
  7862. fi
  7863. else
  7864. mkdir -p "$steam_dir/steamapps/common"
  7865. cp -r "$WISOTOOL_CACHE/$PACKAGE/$game_folder" "$steam_dir/steamapps/common"
  7866. cp -r "$WISOTOOL_CACHE/$PACKAGE/$game_cache_file" "$steam_dir/steamapps"
  7867. if test ! "$game_extra_files" = ""
  7868. then
  7869. IFS=$','
  7870. for x in $game_extra_files
  7871. do
  7872. cp "$WISOTOOL_CACHE/$PACKAGE/$x" "$steam_dir/steamapps"
  7873. done
  7874. unset IFS
  7875. fi
  7876. fi
  7877. cat > "$DRIVE_C/run-$PACKAGE.bat" <<__EOF__
  7878. ${programfilesdrive}:
  7879. cd "$programfilesdir_x86_win\Steam"
  7880. .\Steam.exe -login $STEAM_USER $STEAM_PASS -applaunch $app_id
  7881. __EOF__
  7882. }
  7883. # Sorted by app_id:
  7884. verblist_add multiwinia_demo_steam "Multiwinia: Demo (Steam, 2008)" "multiwinia content.ncf"
  7885. load_multiwinia_demo_steam()
  7886. {
  7887. _load_steam_app "1540" "Multiwinia Demo" "multiwinia content.ncf" "multiwinia"
  7888. }
  7889. verblist_add arx_fatalis_demo_steam "Arx Fatalis Demo (Steam, 2008)" "arx fatalis base.ncf"
  7890. load_arx_fatalis_demo_steam()
  7891. {
  7892. _load_steam_app "1710" "Arx Fatalis" "arx fatalis base.ncf" "arx fatalis"
  7893. }
  7894. verblist_add painkiller_demo_steam "Painkiller Demo (Steam, 2004)" "painkiller demo content.ncf"
  7895. load_painkiller_demo_steam()
  7896. {
  7897. _load_steam_app "3210" "Painkiller Demo" "painkiller demo content.ncf" "painkiller demo"
  7898. }
  7899. verblist_add bookworm_adventures_deluxe_demo_steam "Bookworm Adventures Deluxe Demo (Steam, 2007)" "bookworm adventures deluxe content.ncf"
  7900. load_bookworm_adventures_deluxe_demo_steam()
  7901. {
  7902. _load_steam_app "3270" "Bookworm Adventures Deluxe Demo" "bookworm adventures deluxe content.ncf" "bookworm adventures deluxe"
  7903. }
  7904. verblist_add zen_of_sudoku_demo_steam "Zen of Sudoku Demo (Steam, 2006)" "zenofsudoku.ncf"
  7905. load_zen_of_sudoku_demo_steam()
  7906. {
  7907. _load_steam_app "4910" "Zen of Sudoku Demo" "zenofsudoku.ncf" "zen of sudoku"
  7908. }
  7909. verblist_add eets_demo_steam "Eets Demo (Steam, 2006)" "eets content.ncf"
  7910. load_eets_demo_steam()
  7911. {
  7912. _load_steam_app "6110" "Eets Demo" "eets content.ncf" "eets"
  7913. }
  7914. verblist_add longest_journey_demo_steam "The Longest Journey Demo (Steam, 2000)" "the longest journey demo content.ncf"
  7915. load_longest_journey_demo_steam()
  7916. {
  7917. _load_steam_app "6320" "The Longest Journey Demo" "the longest journey demo content.ncf" "the longest journey demo"
  7918. }
  7919. verblist_add joint_task_force_demo_steam "Joint Task Force Demo (Steam, 2006)" "joint task force demo content.ncf"
  7920. load_joint_task_force_demo_steam()
  7921. {
  7922. _load_steam_app "6410" "Joint Task Force Demo" "joint task force demo content.ncf" "joint task force demo"
  7923. }
  7924. verblist_add lost_planet_dx9_demo_steam "Lost Planet Extreme Condition Demo (Steam, 2007)" "lost planet demo dx9 content.ncf"
  7925. load_lost_planet_dx9_demo_steam()
  7926. {
  7927. _load_steam_app "6530" "Lost Planet Extreme Condition Demo" "lost planet demo dx9 content.ncf" "lost planet demo"
  7928. }
  7929. verblist_add lost_planet_dx10_demo_steam "Lost Planet Extreme Condition DX10 Demo (Steam, 2007)" "lost planet demo dx10 content.ncf"
  7930. load_lost_planet_dx10_demo_steam()
  7931. {
  7932. _load_steam_app "6540" "Lost Planet Extreme Condition DX10 Demo" "lost planet demo dx10 content.ncf" "lost planet dx10 demo"
  7933. }
  7934. verblist_add total_war_and_empire_demo_steam "Empire: Total War Demo (Steam, 2009)" "empire total war demo main.ncf"
  7935. load_total_war_and_empire_demo_steam()
  7936. {
  7937. _load_steam_app "10620" "Empire: Total War" "empire total war demo main.ncf" "empire total war demo" "empire total war demo english.ncf,empire total war demo executable.ncf,empire total war demo redist.ncf"
  7938. if workaround_wine_bug 18490
  7939. then
  7940. warn "You'll probably want the patch from http://bugs.winehq.org/show_bug.cgi?id=18490. Otherwise, the game will crash when starting a battle."
  7941. fi
  7942. }
  7943. verblist_add napoleon_total_war_demo_steam "Napoleon: Total War Demo (Steam, 2010)" "napoleon total war demo english.ncf"
  7944. load_napoleon_total_war_demo_steam()
  7945. {
  7946. _load_steam_app "34050" "Napoleon: Total War" "napoleon total war demo english.ncf" "napoleon total war demo" "napoleon total war demo data_34052.ncf,napoleon total war demo exe_34051.ncf,napoleon total war demo redist_34053.ncf"
  7947. if workaround_wine_bug 23126
  7948. then
  7949. try sh "$WINETRICKS" -q vcrun2005
  7950. fi
  7951. if workaround_wine_bug 23356
  7952. then
  7953. try sh "$WINETRICKS" -q d3dx9
  7954. fi
  7955. if workaround_wine_bug 18490
  7956. then
  7957. warn "You'll probably want the patch from http://bugs.winehq.org/show_bug.cgi?id=18490. Otherwise, the game will crash when starting a battle."
  7958. fi
  7959. }
  7960. #----------------------------------------------------------------
  7961. print_version() {
  7962. echo "$VERSION"
  7963. }
  7964. #--------- Main program -----------------------------------------
  7965. olddir=`pwd`
  7966. srcdir=`dirname $0`
  7967. srcdir=`cd $srcdir; /bin/pwd`
  7968. # Load external verbs. Filenames may not contain spaces.
  7969. if cd "$WISOTOOL_VERBS"
  7970. then
  7971. for file in `find . -type f -name '*.verb' 2>/dev/null`
  7972. do
  7973. . $file
  7974. done
  7975. fi
  7976. cd "$olddir"
  7977. verblist_finish
  7978. # On Solaris, choose more modern commands (needed for id -u).
  7979. case `uname -s` in
  7980. SunOS) PATH="/usr/xpg6/bin:/usr/xpg4/bin:$PATH"
  7981. ;;
  7982. esac
  7983. case "$1" in
  7984. -V|--version)
  7985. echo "wisotool version $VERSION. (C) 2007-2010 Dan Kegel et al. LGPL."
  7986. exit 0
  7987. ;;
  7988. esac
  7989. detect_menu
  7990. detect_sudo
  7991. GUI=0
  7992. case x"$1" in
  7993. x) GUI=1 ;;
  7994. x-h|x--help|xhelp) usage ; exit 1 ;;
  7995. esac
  7996. case "$OS" in
  7997. "Windows_NT")
  7998. ;;
  7999. *)
  8000. # Prevent running with wrong user id.
  8001. # It's bad to create files as the wrong user!
  8002. die_if_user_not_dirowner "$WINEPREFIX"
  8003. # Wine misbehaves strangely if user doesn't own the parent of $WINEPREFIX.
  8004. die_if_user_not_dirowner "$WINEPREFIX/.."
  8005. if [ ! -x "`which "$WINE" 2>/dev/null`" ]
  8006. then
  8007. die "Cannot find wine ($WINE)"
  8008. fi
  8009. # Create wineprefix if not already there
  8010. test -d "$WINEPREFIX" || WINEDLLOVERRIDES=mshtml= $WINE cmd /c echo yes > /dev/null 2>&1
  8011. ;;
  8012. esac
  8013. mkdir -p "$WISOTOOL_TMP"
  8014. case $GUI in
  8015. 1) showmenu ; set $todo ;;
  8016. esac
  8017. mkdir -p "$WISOTOOL_CACHE"
  8018. WINETRICKS="$srcdir/winetricks"
  8019. if ! test -f "$WINETRICKS"
  8020. then
  8021. WINETRICKS="$WISOTOOL_CACHE/winetricks"
  8022. download . http://kegel.com/wine/winetricks
  8023. fi
  8024. # The folder-name is localized!
  8025. programfilesdir_win="`unset WINEDEBUG; WINEDLLOVERRIDES=mshtml= $WINE cmd.exe /c echo "%ProgramFiles%" | tr -d '\015'`"
  8026. test x"$programfilesdir_win" != x || die "$WINE cmd.exe /c echo '%ProgramFiles%' returned empty string"
  8027. case "$programfilesdir_win" in
  8028. %*) die "$WINE cmd.exe /c echo '%ProgramFiles%' returned unexpanded string... do you own the parent of $WINEPREFIX ?"
  8029. esac
  8030. programfilesdir_unix="`unset WINEDEBUG; $XXXPATH -u "$programfilesdir_win" | tr -d '\015' `"
  8031. test x"$programfilesdir_unix" != x || die "winepath -u $programfilesdir_win returned empty string"
  8032. wisotool_tmp_win="`$XXXPATH -w "$WISOTOOL_TMP"`"
  8033. # 64 bit windows has a second directory for program files
  8034. programfilesdir_x86_win="${programfilesdir_win} (x86)"
  8035. programfilesdir_x86_unix="${programfilesdir_unix} (x86)"
  8036. if ! test -d "$programfilesdir_x86_unix"
  8037. then
  8038. programfilesdir_x86_win="${programfilesdir_win}"
  8039. programfilesdir_x86_unix="${programfilesdir_unix}"
  8040. fi
  8041. # FIXME: why export this?
  8042. export programfilesdir_x86_unix
  8043. # FIXME: don't hardcode
  8044. programfilesdrive=c
  8045. # localized, and different across Windows versions:
  8046. appdata_win="`unset WINEDEBUG; WINEDLLOVERRIDES=mshtml= $WINE cmd.exe /c echo "%AppData%" | tr -d '\015'`"
  8047. appdata_unix="`unset WINEDEBUG; $XXXPATH -u "$appdata_win" | tr -d '\015' `"
  8048. # (Fixme: get fonts path from SHGetFolderPath
  8049. # See also http://blogs.msdn.com/oldnewthing/archive/2003/11/03/55532.aspx)
  8050. #
  8051. # Did the user rename Fonts to fonts?
  8052. if test ! -d "$WINDIR"/Fonts && test -d "$WINDIR"/fonts
  8053. then
  8054. winefontsdir="$WINDIR"/fonts
  8055. else
  8056. winefontsdir="$WINDIR"/Fonts
  8057. fi
  8058. # Mac folks tend to not have sha1sum, but we can make do with openssl
  8059. if [ -x "`which sha1sum 2>/dev/null`" ]
  8060. then
  8061. SHA1SUM="sha1sum"
  8062. elif [ -x "`which openssl 2>/dev/null`" ]
  8063. then
  8064. SHA1SUM="openssl dgst -sha1"
  8065. else
  8066. die "No sha1sum utility available."
  8067. fi
  8068. if [ ! -x "`which unzip 2>/dev/null`" ]
  8069. then
  8070. die "Cannot find unzip. Please install it (e.g. 'sudo apt-get install unzip' or 'sudo yum install unzip')."
  8071. fi
  8072. while test "$1" != ""
  8073. do
  8074. PACKAGE=$1
  8075. # Kludge: shorthand synonyms. Find some more elegant way of doing this.
  8076. case $PACKAGE in
  8077. dao) PACKAGE=dragonage ;;
  8078. sc2) PACKAGE=starcraft2 ;;
  8079. esac
  8080. case $PACKAGE in
  8081. -q) WISOTOOL_QUIET="/q"
  8082. WINEDEBUG=${WINEDEBUG:-"fixme-all"}
  8083. export WINEDEBUG
  8084. ;;
  8085. -v) set -x;;
  8086. ls) list_available_verbs;;
  8087. load) load_iso dd;;
  8088. load_harder) load_iso ddrescue;;
  8089. load=*) key="`echo $PACKAGE | sed 's/load=//'`"; load_iso dd "$key";;
  8090. refile|migrate) migrate_files;;
  8091. version) print_version;;
  8092. *.verb)
  8093. case $1 in
  8094. */*) . $1 ;;
  8095. *) . ./$1 ;;
  8096. esac
  8097. PACKAGE=`echo $1 | sed 's,.*/,,;s,.verb,,'`
  8098. load_$PACKAGE
  8099. ;;
  8100. *) if verblist_is_legal_verb $PACKAGE
  8101. then
  8102. load_$PACKAGE
  8103. else
  8104. echo Unknown arg $PACKAGE; usage ; exit 1;
  8105. fi
  8106. ;;
  8107. esac
  8108. # Provide a bit of feedback
  8109. test "$WISOTOOL_QUIET" = "" && case $PACKAGE in
  8110. -q) echo Setting quiet mode;;
  8111. -v) echo Setting verbose mode;;
  8112. *) #echo "$PACKAGE done" ;;
  8113. esac
  8114. shift
  8115. # if verbs doesn't preserve the working directory, restore it
  8116. cd "$olddir"
  8117. # User-specific postinstall hook.
  8118. # Source it so the script can call download() if needed.
  8119. if [ -f "$WISOTOOL_POST"/$PACKAGE/$PACKAGE-postinstall.sh ]
  8120. then
  8121. chmod +x "$WISOTOOL_POST/$PACKAGE/$PACKAGE-postinstall.sh"
  8122. ( . "$WISOTOOL_POST"/$PACKAGE/$PACKAGE-postinstall.sh )
  8123. fi
  8124. done
  8125. test "$WISOTOOL_CACHE_SYMLINK" && rm -f "$WISOTOOL_CACHE_SYMLINK"
  8126. # remove the temp directory
  8127. chmod -R 700 "$WISOTOOL_TMP"
  8128. while ! rm -rf "$WISOTOOL_TMP"
  8129. do
  8130. # Sometimes apps take a while to exit on Vista
  8131. sleep 1
  8132. done