|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511 |
- !verbose 2
- !define TEMP1 $R0
- !define SNIFFER_SERVER_SPECIFIER "V3.2.1"
-
-
-
-
-
-
-
- Name "Message Sniffer Install/Restore Utility 1_0"
-
-
- OutFile "Restorer.exe"
-
-
-
-
- LicenseText "Approve License Agreement:"
- LicenseData "License.txt"
-
-
- VAR /GLOBAL SNFServerInstallDir
-
- Var /GLOBAL LicenseID
- Var /GLOBAL Authentication
-
- Var /GLOBAL InstallerCompletedRestore
-
-
- Var /GLOBAL OpenGBUIgnoreFileOnClose
- Var /GLOBAL HasStickyPots
- Var /GLOBAL UseDetectedRulebase
-
- Var /GLOBAL DownloadFailed
-
- Var /GLOBAL AUTO_UPDATE_ONOFF_FLAG
-
- Var /GLOBAL RetainExistingSettings
- Var /GLOBAL CommandLineParameters
-
- Var /Global shortInstallPath
-
-
- Var /GLOBAL localINSTDIR
- Var /GLOBAL localSERVDIR
- Var /GLOBAL registryTempData
-
-
-
-
- Var OUT1
- Var OUT2
- Var OUT3
- Var OUT4
- Var OUT5
- Var OUT6
- Var OUT7
-
-
-
- VAR testInputLength
- Var EDITLicense
- Var EDITAuthentication
- Var CHECKBOX
-
-
- VAR /GLOBAL AlphanumericalTestString
- VAR /GLOBAL AlphaNumericsSourceString
- VAR /GLOBAL AlphaNumericalTestChar
- VAR /GLOBAL AlphaNumericalResult
- VAR /GLOBAL AlphaNumericalSSLen
- VAR /GLOBAL SNF2Check
-
-
-
-
-
-
-
-
- VAR /GLOBAL healFromOldFile
- VAR /GLOBAL collectedArchiveData
- VAR /GLOBAL succededAtPlacingArchivedData
-
- VAR /GLOBAL archivedGLOBALcfgPath
- VAR /GLOBAL archivedGLOBALcfgFileHandle
-
- VAR /GLOBAL archivedMXGUARDiniPath
- VAR /GLOBAL archivedMXGUARDiniFileHandle
-
- VAR /GLOBAL archivedMDPluginsDatPath
- VAR /GLOBAL archivedMDPluginsDatFileHandle
-
-
- VAR /GLOBAL UnpackedCURLStuff
-
-
- !include "LogicLib.nsh"
- !include "FileFunc.nsh"
- !include "Sections.nsh"
-
- !include "WinMessages.nsh"
- !include "WordFunc.nsh"
-
- !include "nsDialogs.nsh"
-
-
- !insertmacro WordFind
- !insertmacro un.WordFind
- !insertmacro WordFind2X
- !insertmacro un.WordFind2X
- !insertmacro GetOptions
- !insertmacro GetTime
-
- !insertmacro un.DirState
- !insertmacro un.GetTime
- !insertmacro un.GetParent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AddBrandingImage left 140
-
- !macro BIMAGE IMAGE PARMS
- Push $0
- GetTempFileName $0
- File /oname=$0 "${IMAGE}"
- SetBrandingImage ${PARMS} $0
- Delete $0
- Pop $0
- !macroend
-
-
-
- RequestExecutionLevel admin
-
-
- XPStyle on
-
-
- Page license "nsSetupLicenseTitle" "" ""
-
- Page custom nsDialogsUserName nsDialogsUserName_leave "User name and Authentication:"
- Page custom nsDialogsGetRulebase nsDialogsGetRulebase_leave "Downloading Sniffer Rulebase File:"
- Page custom nsDialogsWaitingForRulebase "" "Downloading Sniffer Rulebase File:"
-
-
- Page components "nsSetupcomponentTitle" "" "nsinstfilesExitSub"
- Page instfiles "nsSetupInstallationTitle" "" ""
- Page custom finishedFilesDisplay finishedFilesQuit
-
- UninstallText "This will uninstall the previous version of Message Sniffer." "Location:"
- UninstPage uninstConfirm
-
- UninstPage instfiles
-
- Function nsSetupLicenseTitle
- !insertmacro BIMAGE "SnifferBanner.bmp" ""
-
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Approve License Before Continuing:"
- FunctionEnd
-
- Function nsSetupcomponentTitle
- !insertmacro BIMAGE "SnifferBanner.bmp" ""
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Adjust Component Selection:"
-
-
-
- Var /GLOBAL BackButton
- GetDlgItem $BackButton $HWNDPARENT 3
- EnableWindow $BackButton "0"
-
- FunctionEnd
-
- Function nsSetupInstallationTitle
- !insertmacro BIMAGE "SnifferBanner.bmp" ""
-
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Completing Server Installation:"
- FunctionEnd
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Function RelGotoPage
- IntCmp $R9 0 0 Move Move
- StrCmp $R9 "X" 0 Move
- StrCpy $R9 "120"
-
- Move:
- SendMessage $HWNDPARENT "0x408" "$R9" ""
- FunctionEnd
-
-
-
-
-
-
- Function AdvReplaceInFile
- Exch $0
- Exch
- Exch $1
- Exch
- Exch 2
- Exch $2
- Exch 2
- Exch 3
- Exch $3
- Exch 3
- Exch 4
- Exch $4
- Exch 4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R0
- Push $R1
- Push $R2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
-
- GetTempFileName $R6
- FileOpen $R1 $0 r
- FileOpen $R0 $R6 w
- StrLen $R3 $4
- StrCpy $R4 -1
- StrCpy $R5 -1
-
- loop_read:
- ClearErrors
- FileRead $R1 $R2
- IfErrors exit
-
- StrCpy $5 0
- StrCpy $7 $R2
-
- loop_filter:
- IntOp $5 $5 - 1
- StrCpy $6 $7 $R3 $5
- StrCmp $6 "" file_write2
- StrCmp $6 $4 0 loop_filter
-
- StrCpy $8 $7 $5
- IntOp $6 $5 + $R3
- IntCmp $6 0 is0 not0
- is0:
- StrCpy $9 ""
- Goto done
- not0:
- StrCpy $9 $7 "" $6
- done:
- StrCpy $7 $8$3$9
-
- IntOp $R4 $R4 + 1
- StrCmp $2 all file_write1
- StrCmp $R4 $2 0 file_write2
- IntOp $R4 $R4 - 1
-
- IntOp $R5 $R5 + 1
- StrCmp $1 all file_write1
- StrCmp $R5 $1 0 file_write1
- IntOp $R5 $R5 - 1
- Goto file_write2
-
- file_write1:
- FileWrite $R0 $7
- Goto loop_read
-
- file_write2:
- FileWrite $R0 $R2
- Goto loop_read
-
- exit:
- FileClose $R0
- FileClose $R1
-
- SetDetailsPrint none
- Delete $0
- Rename $R6 $0
- Delete $R6
- SetDetailsPrint BOTH
-
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $R0
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $0
- Pop $1
- Pop $2
- Pop $3
- Pop $4
- FunctionEnd
-
-
-
-
-
- !macro GetBetween This AndThis In Return
- Push "${This}"
- Push "${AndThis}"
- Push "${In}"
- Call GetBetween
- Pop "${Return}"
- !macroend
- !define GetBetween "!insertmacro GetBetween"
-
- !macro un.GetBetween This AndThis In Return
- Push "${This}"
- Push "${AndThis}"
- Push "${In}"
- Call un.GetBetween
- Pop "${Return}"
- !macroend
- !define un.GetBetween "!insertmacro un.GetBetween"
-
-
- Function GetBetween
- Exch $R0
- Exch
- Exch $R1
- Exch 2
- Exch $R2
- Exch 2
- Exch
- Exch 2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
- FileOpen $R6 $R0 r
-
- StrLen $R4 $R2
- StrLen $R3 $R1
-
- StrCpy $R0 ""
-
- Read1:
- ClearErrors
- FileRead $R6 $R7
- IfErrors Done
- StrCpy $R5 0
-
- FindMarker1:
- IntOp $R5 $R5 - 1
- StrCpy $R8 $R7 $R4 $R5
- StrCmp $R8 "" Read1
- StrCmp $R8 $R2 0 FindMarker1
- IntOp $R5 $R5 + $R4
- StrCpy $R7 $R7 "" $R5
-
- StrCpy $R5 -1
- Goto FindMarker2
-
- Read2:
- ClearErrors
- FileRead $R6 $R7
- IfErrors Done
- StrCpy $R5 -1
-
- FindMarker2:
- IntOp $R5 $R5 + 1
- StrCpy $R8 $R7 $R3 $R5
- StrCmp $R8 "" 0 +3
- StrCpy $R0 $R0$R7
- Goto Read2
- StrCmp $R8 $R1 0 FindMarker2
- StrCpy $R7 $R7 $R5
- StrCpy $R0 $R0$R7
-
- Done:
- FileClose $R6
-
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Exch $R0
- FunctionEnd
-
- Function un.GetBetween
- Exch $R0
- Exch
- Exch $R1
- Exch 2
- Exch $R2
- Exch 2
- Exch
- Exch 2
- Push $R3
- Push $R4
- Push $R5
- Push $R6
- Push $R7
- Push $R8
-
-
- FileOpen $R6 $R0 r
-
- StrLen $R4 $R2
- StrLen $R3 $R1
-
- StrCpy $R0 ""
-
- Read1:
- ClearErrors
- FileRead $R6 $R7
- IfErrors Done
- StrCpy $R5 0
-
- FindMarker1:
- IntOp $R5 $R5 - 1
- StrCpy $R8 $R7 $R4 $R5
- StrCmp $R8 "" Read1
- StrCmp $R8 $R2 0 FindMarker1
- IntOp $R5 $R5 + $R4
- StrCpy $R7 $R7 "" $R5
-
- StrCpy $R5 -1
- Goto FindMarker2
-
- Read2:
- ClearErrors
- FileRead $R6 $R7
- IfErrors Done
- StrCpy $R5 -1
-
- FindMarker2:
- IntOp $R5 $R5 + 1
- StrCpy $R8 $R7 $R3 $R5
- StrCmp $R8 "" 0 +3
- StrCpy $R0 $R0$R7
- Goto Read2
- StrCmp $R8 $R1 0 FindMarker2
- StrCpy $R7 $R7 $R5
- StrCpy $R0 $R0$R7
-
- Done:
- FileClose $R6
-
- Pop $R8
- Pop $R7
- Pop $R6
- Pop $R5
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Exch $R0
- FunctionEnd
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Function restoreMDaemonDAT
-
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedMDPluginsDatPath $0
- pop $0
-
- call editMDPluginsFile
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function un.restoreMDaemonDAT
-
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedMDPluginsDatPath $0
- pop $0
-
- call un.editMDPluginsFile
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function restoreMXGuardINI
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedMDPluginsDatPath $0
-
- pop $0
- call editMXGuardINI
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function un.restoreMXGuardINI
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedMXGUARDiniPath $0
-
- pop $0
- call un.editMXGuardINI
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function restoreGLOBALcfg
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedGLOBALcfgPath $0
- pop $0
- call editglobalCFG
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function un.restoreGLOBALcfg
-
-
- StrCpy $healFromOldFile "1"
- Exch $0
- StrCpy $archivedGLOBALcfgPath $0
- pop $0
- call un.editglobalCFG
- StrCpy $healFromOldFile "0"
- FunctionEnd
-
- Function restoreCONTENTxml
- call editContentXML
- FunctionEnd
- Function un.restoreCONTENTxml
- call un.editContentXML
- FunctionEnd
-
- Function restoreMINIMIini
-
- FunctionEnd
- Function un.restoreMINIMIini
-
- FunctionEnd
-
- Function restoreXYNTini
-
- FunctionEnd
- Function un.restoreXYNTini
-
- FunctionEnd
-
- Function restoreGETRULBASEcmd
-
-
- FunctionEnd
- Function un.restoreGETRULBASEcmd
-
-
- FunctionEnd
-
-
- Function ResolveFunction
-
-
-
-
- push $R0
- Exch
- pop $R0
- push $R1
- Exch 2
- pop $R1
-
-
-
-
-
-
-
-
-
-
-
-
- ${Switch} $R0
- ${Case} "restoreMXGuardINI"
- push $R1
- call restoreMXGuardINI
- goto doneResolving
- ${Case} "restoreGLOBALcfg"
- push $R1
- call restoreGLOBALcfg
- goto doneResolving
- ${Case} "restoreMINIMIini"
- call restoreMINIMIini
- goto doneResolving
- ${Case} "restoreXYNTini"
- call restoreXYNTini
- goto doneResolving
- ${Case} "restoreGETRULBASEcmd"
- call restoreGETRULBASEcmd
- goto doneResolving
- ${Case} "restoreCONTENTxml"
- call restoreCONTENTxml
- goto doneResolving
- ${Case} "restoreMDaemonDAT"
- push $R1
- call restoreMDaemonDAT
- goto doneResolving
- ${EndSwitch}
- doneResolving:
- pop $R0
- pop $R1
- FunctionEnd
-
-
-
-
- Function un.ResolveFunction
-
-
- push $R0
- Exch
- pop $R0
- push $R1
- Exch 2
- pop $R1
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${Switch} $R0
- ${Case} "restoreMXGuardINI"
- push $R1
- call un.restoreMXGuardINI
- goto doneResolving
- ${Case} "restoreGLOBALcfg"
- push $R1
- call un.restoreGLOBALcfg
- goto doneResolving
- ${Case} "restoreMINIMIini"
- call un.restoreMINIMIini
- goto doneResolving
- ${Case} "restoreXYNTini"
- call un.restoreXYNTini
- goto doneResolving
- ${Case} "restoreGETRULBASEcmd"
- call un.restoreGETRULBASEcmd
- goto doneResolving
- ${Case} "restoreCONTENTxml"
- call un.restoreCONTENTxml
- goto doneResolving
- ${Case} "restoreMDaemonDAT"
- push $R1
- call un.restoreMDaemonDAT
- goto doneResolving
- ${EndSwitch}
- doneResolving:
- pop $R0
- pop $R1
- FunctionEnd
-
-
-
-
-
-
-
- !include "rollback.nsh"
-
-
-
-
-
-
- Var STR_REPLACE_VAR_0
- Var STR_REPLACE_VAR_1
- Var STR_REPLACE_VAR_2
- Var STR_REPLACE_VAR_3
- Var STR_REPLACE_VAR_4
- Var STR_REPLACE_VAR_5
- Var STR_REPLACE_VAR_6
- Var STR_REPLACE_VAR_7
- Var STR_REPLACE_VAR_8
-
- Function StrReplace
- Exch $STR_REPLACE_VAR_2
- Exch 1
- Exch $STR_REPLACE_VAR_1
- Exch 2
- Exch $STR_REPLACE_VAR_0
- StrCpy $STR_REPLACE_VAR_3 -1
- StrLen $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_1
- StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0
- loop:
- IntOp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_3 + 1
- StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_3
- StrCmp $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_1 found
- StrCmp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_6 done
- Goto loop
- found:
- StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_3
- IntOp $STR_REPLACE_VAR_8 $STR_REPLACE_VAR_3 + $STR_REPLACE_VAR_4
- StrCpy $STR_REPLACE_VAR_7 $STR_REPLACE_VAR_0 "" $STR_REPLACE_VAR_8
- StrCpy $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_5$STR_REPLACE_VAR_2$STR_REPLACE_VAR_7
- StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0
- Goto loop
- done:
- Pop $STR_REPLACE_VAR_1
- Pop $STR_REPLACE_VAR_1
- Exch $STR_REPLACE_VAR_0
- FunctionEnd
-
- Function un.StrReplace
- Exch $STR_REPLACE_VAR_2
- Exch 1
- Exch $STR_REPLACE_VAR_1
- Exch 2
- Exch $STR_REPLACE_VAR_0
- StrCpy $STR_REPLACE_VAR_3 -1
- StrLen $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_1
- StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0
- loop:
- IntOp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_3 + 1
- StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_4 $STR_REPLACE_VAR_3
- StrCmp $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_1 found
- StrCmp $STR_REPLACE_VAR_3 $STR_REPLACE_VAR_6 done
- Goto loop
- found:
- StrCpy $STR_REPLACE_VAR_5 $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_3
- IntOp $STR_REPLACE_VAR_8 $STR_REPLACE_VAR_3 + $STR_REPLACE_VAR_4
- StrCpy $STR_REPLACE_VAR_7 $STR_REPLACE_VAR_0 "" $STR_REPLACE_VAR_8
- StrCpy $STR_REPLACE_VAR_0 $STR_REPLACE_VAR_5$STR_REPLACE_VAR_2$STR_REPLACE_VAR_7
- StrLen $STR_REPLACE_VAR_6 $STR_REPLACE_VAR_0
- Goto loop
- done:
- Pop $STR_REPLACE_VAR_1
- Pop $STR_REPLACE_VAR_1
- Exch $STR_REPLACE_VAR_0
- FunctionEnd
-
- !macro _strReplaceConstructor OUT NEEDLE NEEDLE2 HAYSTACK
- Push "${HAYSTACK}"
- Push "${NEEDLE}"
- Push "${NEEDLE2}"
- Call StrReplace
- Pop "${OUT}"
- !macroend
-
- !macro un._strReplaceConstructor OUT NEEDLE NEEDLE2 HAYSTACK
- Push "${HAYSTACK}"
- Push "${NEEDLE}"
- Push "${NEEDLE2}"
- Call un.StrReplace
- Pop "${OUT}"
- !macroend
-
- !define StrReplace '!insertmacro "_strReplaceConstructor"'
- !define un.StrReplace '!insertmacro "un._strReplaceConstructor"'
-
- !macro ReplaceInFile SOURCE_FILE SEARCH_TEXT REPLACEMENT
- Push "${SOURCE_FILE}"
- Push "${SEARCH_TEXT}"
- Push "${REPLACEMENT}"
- Call RIF
- !macroend
-
- !macro un.ReplaceInFile SOURCE_FILE SEARCH_TEXT REPLACEMENT
- Push "${SOURCE_FILE}"
- Push "${SEARCH_TEXT}"
- Push "${REPLACEMENT}"
- Call un.RIF
- !macroend
-
- Function RIF
-
- ClearErrors
-
- Exch $0
- Exch
- Exch $1
- Exch 2
- Exch $2
-
- Push $R0
- Push $R1
- Push $R2
- Push $R3
- Push $R4
-
- IfFileExists $2 +1 RIF_error
- FileOpen $R0 $2 "r"
-
- GetTempFileName $R2
- FileOpen $R1 $R2 "w"
-
- RIF_loop:
- FileRead $R0 $R3
- IfErrors RIF_leaveloop
- RIF_sar:
- Push "$R3"
- Push "$1"
- Push "$0"
- Call StrReplace
- StrCpy $R4 "$R3"
- Pop $R3
- StrCmp "$R3" "$R4" +1 RIF_sar
- FileWrite $R1 "$R3"
- Goto RIF_loop
-
- RIF_leaveloop:
- FileClose $R1
- FileClose $R0
-
- Delete "$2.old"
-
- Rename "$2" "$2.old"
-
- Rename "$R2" "$2"
-
- Delete "$2.old"
- ClearErrors
- Goto RIF_out
-
- RIF_error:
- SetErrors
-
- RIF_out:
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $R0
- Pop $2
- Pop $0
- Pop $1
-
- FunctionEnd
-
- Function un.RIF
-
- ClearErrors
-
- Exch $0
- Exch
- Exch $1
- Exch 2
- Exch $2
-
- Push $R0
- Push $R1
- Push $R2
- Push $R3
- Push $R4
-
- IfFileExists $2 +1 RIF_error
- FileOpen $R0 $2 "r"
-
- GetTempFileName $R2
- FileOpen $R1 $R2 "w"
-
- RIF_loop:
- FileRead $R0 $R3
- IfErrors RIF_leaveloop
- RIF_sar:
- Push "$R3"
- Push "$1"
- Push "$0"
- Call un.StrReplace
- StrCpy $R4 "$R3"
- Pop $R3
- StrCmp "$R3" "$R4" +1 RIF_sar
- FileWrite $R1 "$R3"
- Goto RIF_loop
-
- RIF_leaveloop:
- FileClose $R1
- FileClose $R0
-
- Delete "$2.old"
-
- Rename "$2" "$2.old"
-
- Rename "$R2" "$2"
-
- Delete "$2.old"
- ClearErrors
- Goto RIF_out
-
- RIF_error:
- SetErrors
-
- RIF_out:
- Pop $R4
- Pop $R3
- Pop $R2
- Pop $R1
- Pop $R0
- Pop $2
- Pop $0
- Pop $1
-
- FunctionEnd
-
- Function nsinstfilesExitSub
-
- FunctionEnd
-
-
-
-
- Function TestAlphaNumerics
-
-
- StrCpy $AlphanumericalTestString "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz"
-
-
- StrCpy $AlphaNumericalTestChar $AlphaNumericsSourceString 1 0
-
-
- TestAlphaNumerics_getchar: ${WordFind} $AlphanumericalTestString $AlphaNumericalTestChar "E+1{" $AlphaNumericalResult
- IfErrors AlphaNumerics_notfound AlphaNumerics_found
- AlphaNumerics_found:
- StrLen $AlphaNumericalSSLen $AlphaNumericsSourceString
- ${IF} $AlphaNumericalSSLen > 1
- StrCpy $AlphaNumericsSourceString $AlphaNumericsSourceString "" 1
-
- StrCpy $AlphaNumericalTestChar $AlphaNumericsSourceString 1 0
- Goto TestAlphaNumerics_getchar
- ${ELSE}
-
- StrCpy $AlphaNumericalResult "1"
- return
- ${ENDIF}
-
- AlphaNumerics_notfound:
-
- StrCpy $AlphaNumericalResult "0"
- return
- FunctionEnd
-
-
-
-
- Function nsDialogsUserName
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Enter License and Authentication:"
- !insertmacro BIMAGE "SnifferBannerIdentity.bmp" ""
-
- nsDialogs::Create /NOUNLOAD 1018
- Pop $0
-
- ${NSD_CreateLabel} 0 20 60% 8u "Enter License (8 Chars)"
- Pop $0
-
- ${NSD_CreateText} 0 40 40% 12u $LicenseID
- Pop $EDITLicense
- GetFunctionAddress $0 OnChangeLicense
- nsDialogs::OnChange /NOUNLOAD $EDITLicense $0
-
- ${NSD_CreateLabel} 50% 20 60% 8u "Enter Authentication (16 Chars)"
- Pop $0
-
- ${NSD_CreateText} 50% 40 40% 12u $Authentication
- Pop $EDITAuthentication
- GetFunctionAddress $0 OnChangeAuthentication
- nsDialogs::OnChange /NOUNLOAD $EDITAuthentication $0
-
- ${NSD_CreateCheckbox} 0 50u 100% 16u " Select this if you have email accounts that intentionally receive spam.$\n ( Will automatically open file for editing email accounts after install. )"
- Pop $CHECKBOX
- GetFunctionAddress $0 OnCheckStickyPot
- nsDialogs::OnClick /NOUNLOAD $CHECKBOX $0
-
- ${NSD_CreateCheckbox} 0 80u 100% 16u " Select if you have gateways that need to be entered into the Ignore List.$\n ( Will automatically open file for editing Gateway IP's after install. )"
- Pop $CHECKBOX
- GetFunctionAddress $0 OnCheckboxGateway
- nsDialogs::OnClick /NOUNLOAD $CHECKBOX $0
-
- Var /GLOBAL HelpMeButton
- ${NSD_CreateButton} 0 110u 100% 16u "Help! I don't have a license key. Do you have a webpage to help me?"
- Pop $HelpMeButton
- ${NSD_OnClick} $HelpMeButton OpenHelpMePage
-
-
- nsDialogs::Show
- FunctionEnd
-
- Function OpenHelpMePage
- ExecShell "open" "http://www.armresearch.com/products/trial.jsp"
- FunctionEnd
-
- Function nsDialogsUserName_leave
-
- StrLen $testInputLength $LicenseID
-
- ${If} $testInputLength != "9"
- MessageBox MB_OK "License Keys are eight characters in length. Please double check your License Key."
- abort
- ${EndIf}
-
- StrLen $testInputLength $Authentication
-
- ${If} $testInputLength != "17"
- MessageBox MB_OK "Authentication Keys are sixteen characters in length. Please double check your Authentication String."
- abort
- ${EndIf}
-
-
-
-
-
-
- StrCpy $AlphaNumericsSourceString $LicenseID 8 0
-
- Call TestAlphaNumerics
- StrCmp $AlphaNumericalResult "1" nextTest nextLine
- nextline:
- MessageBox MB_OK "License and Authentication strings must be alphanumerical. A-Z,a-Z,0-9"
- abort
-
- nextTest: StrCpy $AlphaNumericsSourceString $Authentication 16 0
- Call TestAlphaNumerics
- StrCmp $AlphaNumericalResult "1" done nextAbort
- nextAbort:
- MessageBox MB_OK "License and Authentication strings must be alphanumerical. A-Z,a-Z,0-9"
- abort
-
-
- done:
-
- StrCpy $UseDetectedRulebase "0"
- FunctionEnd
-
- Function nsDialogsGetRulebase
- !insertmacro BIMAGE "SnifferBannerFindingRulebase.bmp" ""
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Finding Rulebase:"
-
- nsDialogs::Create /NOUNLOAD 1018
- Pop $0
-
-
- StrCpy $SNF2Check "1"
-
-
- StrCpy $UseDetectedRulebase "0"
-
-
- SetOutPath $INSTDIR
-
-
-
- StrCmp $UnpackedCURLStuff "1" SkipUnpacking 0
-
-
-
- ${Install_with_RollbackControl} "getRulebase.cmd" "" ""
-
-
-
-
- ${Install_with_RollbackControl} "curl.exe" "" ""
-
-
-
-
-
- ${Install_with_RollbackControl} "snf2Check.exe" "" ""
- StrCpy $UnpackedCURLStuff "1"
- SkipUnpacking:
-
- Call editGetRulebase
-
-
- Var /GLOBAL DownloadText
- Var /GLOBAL NextButton
-
-
-
-
-
- ifFileExists "$INSTDIR\$LicenseID.snf" 0 NothingDetected
-
- StrCpy $UseDetectedRulebase "1"
- ${NSD_CreateLabel} 0 0 25% 30 "Rulebase detected."
- Pop $0
- ${NSD_CreateCheckbox} 100 00 15 20 ""
- Pop $CHECKBOX
- ${NSD_CreateLabel} 120 0 65% 40 "Check if you want to download the newest rulebase.$\nLeave unchecked to use the existing rulebase."
- Pop $0
-
- GetFunctionAddress $8 OnUseDetected
- nsDialogs::OnClick /NOUNLOAD $CHECKBOX $8
- Goto EndDetectionLabel
-
- NothingDetected:
- ${NSD_CreateLabel} 0 0 100% 15 "No Rulebase detected. { Download is required. }"
- Pop $0
- EndDetectionLabel:
-
- ${NSD_CreateLabel} 0 35 100% 60 "Please be patient as this may take a few minutes depending upon your bandwidth.$\n$\nIf the installer cannot download a rulebase, your LicenseID or Authentication may$\nbe entered incorrectly."
- Pop $0
- ${NSD_CreateLabel} 0 100 100% 90 "Note: You may be so eager to use Message Sniffer that you have attempted to install it before our server could compile your first rulebase. $\n$\nIf this happens just wait a few minutes or check your email for the update notification to inform you that your first rulebase has been created. Thank you."
- Pop $0
-
- nsDialogs::Show
-
- FunctionEnd
-
- Function OnUseDetected
- Pop $0
- ${IF} $UseDetectedRulebase == 1
- StrCpy $UseDetectedRulebase "0"
- ${ELSE}
- StrCpy $UseDetectedRulebase "1"
- ${ENDIF}
- FunctionEnd
-
- Function nsDialogsGetRulebase_leave
- !insertmacro BIMAGE "SnifferBannerFindingRulebase.bmp" ""
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Downloading Rulebase:"
-
-
-
-
-
- StrCmp $UseDetectedRulebase "1" 0 GetTheRulebaseNow
-
-
-
- nsExec::ExecToLog '"$INSTDIR\snf2check.exe" "$LicenseID.snf" "$Authentication"'
- pop $0
-
-
- StrCpy $SNF2Check $0
- Return
-
-
- GetTheRulebaseNow:
-
-
-
-
- ${NSD_CreateLabel} 0 180 100% 30 "Starting download attempt... Approximate Size of Rulebase: 20Mb"
- Pop $DownloadText
- StrCpy $DownloadFailed "0"
-
- GetDlgItem $NextButton $HWNDPARENT 1
- EnableWindow $NextButton "0"
-
- Var /GLOBAL TempBatchFileHandle
- Var /GLOBAL ThreadHandleExitCode
-
- ifFileExists "$INSTDIR\$LicenseID.new" 0 +2
- Delete "$INSTDIR\$LicenseID.new"
- ifFileExists "$INSTDIR\curlresult.txt" 0 +2
- Delete "$INSTDIR\curlresult.txt"
-
-
- FileOpen $TempBatchFileHandle "$INSTDIR\TempGetCall.cmd" w
-
- FileWrite $TempBatchFileHandle 'curl -v "http://www.sortmonster.net/Sniffer/Updates/$LicenseID.snf" -o $LicenseID.new -S -R -H "Accept-Encoding:gzip" --compressed -u sniffer:ki11sp8m 2>> "$INSTDIR\curlresult.txt"'
- FileClose $TempBatchFileHandle
-
-
-
- ExecDos::Exec /NOUNLOAD /ASYNC "$INSTDIR\TempGetCall.cmd"
- Pop $ThreadHandleExitCode
-
-
-
-
- Var /GLOBAL progressTextFile
- Var /GLOBAL progressTextLine
- Var /GLOBAL progressLastLine
- ifFileExists "$INSTDIR\TEMPcurlresult.txt" 0 +2
- Delete "$INSTDIR\TEMPcurlresult.txt"
-
- LoopAgain:
- Sleep 2000
-
- ifFileExists "$INSTDIR\curlresult.txt" 0 CheckForExit
- CopyFiles /SILENT "$INSTDIR\curlresult.txt" "$INSTDIR\TEMPcurlresult.txt"
- FileOpen $progressTextFile "$INSTDIR\TEMPcurlresult.txt" r
-
- findEndOfFile:
- FileSeek $progressTextFile -63 "END"
- FileRead $progressTextFile $progressTextLine
- StrCpy $progressLastLine $progressTextLine 6 0
-
-
-
-
-
- SendMessage $DownloadText ${WM_SETTEXT} 0 "STR:File Progress: $progressLastLine byte"
- ShowWindow $DownloadText ${SW_SHOW}
- FileClose $progressTextFile
- Delete "$INSTDIR\TEMPcurlresult.txt"
-
- CheckForExit:
- ExecDos::isdone /NOUNLOAD $ThreadHandleExitCode
- Pop $R9
- StrCmp $R9 1 0 LoopAgain
-
-
- Delete "$INSTDIR\curlresult.txt"
-
-
-
-
-
-
-
-
-
- nsExec::Exec '"$INSTDIR\snf2check.exe" $LicenseID.new "$Authentication"'
- pop $0
-
- VAR /GLOBAL snf2CheckERROR
-
- ${Switch} $0
- ${Case} "0"
- StrCpy $snf2CheckERROR " SNFClient successfuly connected with SNFServer."
- Goto EndSNF2CheckTest
- ${Case} "65"
- StrCpy $snf2CheckERROR " {65} ERROR_CMDLINE. SNF was called improperly."
- Goto EndSNF2CheckTest
- ${Case} "66"
- StrCpy $snf2CheckERROR " {66}ERROR_LOGFILE Cannot open logfile."
- Goto EndSNF2CheckTest
- ${Case} "67"
- StrCpy $snf2CheckERROR " {67} ERROR RULE FILE. Cannot open rules file."
- Goto EndSNF2CheckTest
- ${Case} "68"
- StrCpy $snf2CheckERROR " {68} ERROR_RULE_DATA Cannot create pattern matrix."
- Goto EndSNF2CheckTest
- ${Case} "69"
- StrCpy $snf2CheckERROR " {69} ERROR_MSG_FILE Cannot open message file."
- Goto EndSNF2CheckTest
- ${Case} "70"
- StrCpy $snf2CheckERROR " {70} ERROR_ALLOCATION Allocation error during processing."
- Goto EndSNF2CheckTest
- ${Case} "71"
- StrCpy $snf2CheckERROR " {71} ERROR_BAD_MATRIX Pattern trace went out of range."
- Goto EndSNF2CheckTest
- ${Case} "72"
- StrCpy $snf2CheckERROR " {72} ERROR_MAX_EVALS The maximum number of evaluation paths was exceeded."
- Goto EndSNF2CheckTest
- ${Case} "73"
- StrCpy $snf2CheckERROR " {73} ERROR_RULE_AUTH The rulebase file did not authenticate properly."
- Goto EndSNF2CheckTest
- ${Case} "99"
- StrCpy $snf2CheckERROR " {99} ERROR_UNKNOWN"
- Goto EndSNF2CheckTest
- ${EndSwitch}
- EndSNF2CheckTest:
-
- StrCpy $SNF2Check $0
-
- StrCmp $SNF2Check "0" 0 CleanupMess
-
-
- ifFileExists "$INSTDIR\$LicenseID.old" 0 +2
- Delete "$INSTDIR\$LicenseID.old"
- ifFileExists "$INSTDIR\$LicenseID.snf" 0 +2
- rename "$INSTDIR\$LicenseID.snf" "$INSTDIR\$LicenseID.old"
- ifFileExists "$INSTDIR\$LicenseID.new" 0 +2
- rename "$INSTDIR\$LicenseID.new" "$INSTDIR\$LicenseID.snf"
-
- ifFileExists "$INSTDIR\UpdateReady.txt" 0 +2
- delete "$INSTDIR\UpdateReady.txt"
- ifFileExists "$INSTDIR\UpdateReady.lck" 0 +2
- delete "$INSTDIR\UpdateReady.lck"
-
-
- VAR /GLOBAL UpdateRulebaseHandle
- FileOpen $UpdateRulebaseHandle "$INSTDIR\UpdateReady.txt" w
- FileWrite $UpdateRulebaseHandle " "
- FileClose $UpdateRulebaseHandle
-
- StrCpy $DownloadFailed "0"
-
- Delete "$INSTDIR\TempGetCall.cmd"
- Return
-
- CleanupMess:
-
- ifFileExists "$INSTDIR\TempGetCall.cmd" 0 +2
- Delete "$INSTDIR\TempGetCall.cmd"
- ifFileExists "$INSTDIR\UpdateReady.txt" 0 +2
- delete "$INSTDIR\UpdateReady.txt"
- ifFileExists "$INSTDIR\TempGetCall.cmd" 0 +2
- delete "$INSTDIR\TempGetCall.cmd"
- ifFileExists "$INSTDIR\$LicenseID.new" 0 +2
- delete "$INSTDIR\$LicenseID.new"
- ifFileExists "$INSTDIR\UpdateReady.lck" 0 +2
- delete "$INSTDIR\UpdateReady.lck"
- ifFileExists "$INSTDIR\$LicenseID.new.gz" 0 +2
- delete "$INSTDIR\$LicenseID.new.gz"
-
- StrCpy $DownloadFailed "1"
- Return
-
- FunctionEnd
-
-
-
-
-
-
- Function nsDialogsWaitingForRulebase
-
- !insertmacro BIMAGE "SnifferBannerFindingRulebase.bmp" ""
-
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Downloading Rulebase:"
- nsDialogs::Create /NOUNLOAD 1018
- Pop $0
-
-
- StrCmp $UseDetectedRulebase "1" 0 NotifyAll
- StrCmp $SNF2Check "0" 0 NofityAuthFailure
-
- Return
-
- NotifyAll:
-
-
-
-
- StrCmp $DownloadFailed "1" 0 AllowNext
-
- Var /GLOBAL ErrorMessage
- StrCpy $ErrorMessage "Your rulebase file could not be authenticated:$\n$\n $snf2CheckERROR$\n$\n"
- StrCpy $ErrorMessage "$ErrorMessage If the installer cannot download / update your rulebase then:$\n$\n"
- StrCpy $ErrorMessage "$ErrorMessage * Your License ID and/or Authentication may be entered incorrectly.$\n Check your entries on the previous screen.$\n$\n"
- StrCpy $ErrorMessage "$ErrorMessage * If you are new to Message Sniffer your rulebase might not be ready yet.$\n Check your email for your first update notification email.$\n"
-
- StrCmp $SNF2Check "0" 0 NofityAuthFailure
-
-
-
-
-
-
-
- NofityAuthFailure:
- GetDlgItem $NextButton $HWNDPARENT 1
- EnableWindow $NextButton "0"
-
- ${NSD_CreateLabel} 0 30 100% 130 $ErrorMessage
- Pop $DownloadText
- nsDialogs::Show
- Return
-
-
- AllowNext:
- ${NSD_CreateLabel} 0 70 100% 30 "The download of your Message Sniffer Rulebase completed successfully. You may proceed with the rest of the installation."
- Pop $DownloadText
- nsDialogs::Show
- return
- FunctionEnd
-
- Function OnChangeLicense
-
- Pop $0
-
- System::Call user32::GetWindowText(i$EDITLicense,t.r0,i${NSIS_MAX_STRLEN})
- StrCpy $LicenseID $0
-
- FunctionEnd
-
- Function OnChangeAuthentication
-
- Pop $0
-
- System::Call user32::GetWindowText(i$EDITAuthentication,t.r0,i${NSIS_MAX_STRLEN})
-
- StrCpy $Authentication $0
-
- FunctionEnd
-
- Function OnCheckStickyPot
- Pop $0
- ${IF} $HasStickyPots == 1
- StrCpy $HasStickyPots "0"
- ${ELSE}
- StrCpy $HasStickyPots "1"
- ${ENDIF}
- FunctionEnd
-
- Function OnCheckboxGateway
- Pop $0
- ${IF} $OpenGBUIgnoreFileOnClose == "1"
- StrCpy $OpenGBUIgnoreFileOnClose "0"
- ${ELSE}
- StrCpy $OpenGBUIgnoreFileOnClose "1"
- ${ENDIF}
- FunctionEnd
-
-
- Function editLicenseFile
-
-
-
- IfFileExists "$INSTDIR\identity.xml" filedoesexist repairfile
- repairfile:
-
- ClearErrors
- FileOpen $0 "$INSTDIR\identity.xml" w
- IfErrors FailedIdentityRepair
- FileWrite $0 "<snf><identity licenseid='$LicenseID' authentication='$Authentication'/></snf>"
- FileClose $0
-
- Goto done
-
- filedoesexist:
-
- Delete "$INSTDIR\identity.xml"
-
-
-
-
- ClearErrors
- FileOpen $0 "$INSTDIR\identity.xml" w
- IfErrors FailedIdentityArchive
- FileWrite $0 "<snf><identity licenseid='$LicenseID' authentication='$Authentication'/></snf>"
- FileClose $0
- Goto done
- FailedIdentityRepair:
- MessageBox MB_OK "Installer seemed unable to repair identity.xml file. Perhaps the file is locked. Please attempt to create this file manually with the xml contents: <snf><identity licenseid='$LicenseID' authentication='$Authentication'/></snf>"
- Goto done
- FailedIdentityArchive:
- MessageBox MB_OK "Installer seemed unable to archive identity.xml file. Perhaps the file is locked. Please attempt to re/create this file manually with the xml contents: <snf><identity licenseid='$LicenseID' authentication='$Authentication'/></snf>"
- done:
- FunctionEnd
-
- Function finishedFilesDisplay
- FunctionEND
-
- Function finishedFilesQuit
- Quit
- FunctionEND
-
- Function finishedRestoreDisplay
- Var /GLOBAL CancelButton
- GetDlgItem $CancelButton $HWNDPARENT 2
- EnableWindow $CancelButton "0"
-
- StrCmp $InstallerCompletedRestore "1" 0 doneSplashScreen
- nsDialogs::Create /NOUNLOAD 1018
- Pop $0
-
- Var /GLOBAL IMAGECTL
- Var /GLOBAL IMAGE
- nsDialogs::CreateItem /NOUNLOAD STATIC "" ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 25 60 0 64 64
- Pop $IMAGECTL
- SetOutPath $INSTDIR
- File "SuccessInstall.bmp"
- StrCpy $0 "$INSTDIR\SuccessInstall.bmp"
- System::Call 'user32::LoadImage(i 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE}) i.s'
- Pop $IMAGE
- SendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE
-
- nsDialogs::Show
- doneSplashScreen:
- return
- FunctionEND
-
- Function finishedRestoreQuit
- StrCmp $InstallerCompletedRestore "1" 0 +2
- Quit
- Return
- FunctionEND
-
-
- !macro handleShortPath Result_Path Source_Path
- Push "${Source_Path}"
- Push "${Result_Path}"
- Call handleShortFilePath
- Pop "${Result_Path}"
- !macroend
- !define handleShortPath "!insertmacro handleShortPath"
-
- Function handleShortFilePath
- Var /Global local_sourcePath
- Var /Global local_resultPath
- Var /Global local_searchResults
-
- pop $local_resultPath
- pop $local_sourcePath
- ${WordFind} $local_sourcePath " " "E+1}" $local_searchResults
- ifErrors 0 FoundSpaceInString
- push $local_sourcePath
- return
- FoundSpaceInString:
- GetFullPathName /SHORT $local_resultPath $local_sourcePath
- push $local_resultPath
- return
- FunctionEnd
-
-
- !macro un.handleShortPath unResult_Path unSource_Path
- Push "${unSource_Path}"
- Push "${unResult_Path}"
- Call un.handleShortFilePath
- Pop "${unResult_Path}"
- !macroend
- !define un.handleShortPath "!insertmacro un.handleShortPath"
-
- Function un.handleShortFilePath
- Var /Global unlocal_sourcePath
- Var /Global unlocal_resultPath
- Var /Global unlocal_searchResults
-
- pop $unlocal_resultPath
- pop $unlocal_sourcePath
- ${un.WordFind} $unlocal_sourcePath " " "E+1}" $unlocal_searchResults
- ifErrors 0 unFoundSpaceInString
- push $unlocal_sourcePath
- return
- unFoundSpaceInString:
- GetFullPathName /SHORT $unlocal_resultPath $unlocal_sourcePath
- push $unlocal_resultPath
- return
- FunctionEnd
-
-
-
-
- Function editXYNTServiceINI
-
-
- Var /GLOBAL iniHandle
-
- FileOpen $iniHandle "$INSTDIR\XYNTService.ini" w
- FileWrite $iniHandle "[Settings]$\r$\n"
- FileWrite $iniHandle "ProcCount=1$\r$\n"
- FileWrite $iniHandle "ServiceName=SNFService$\r$\n"
- FileWrite $iniHandle "CheckProcessSeconds = 30$\r$\n"
- FileWrite $iniHandle "[Process0]$\r$\n"
-
- Var /GLOBAL ShortPathTempVar
-
- ${handleShortPath} $ShortPathTempVar $INSTDIR
-
-
-
-
- FileWrite $iniHandle "CommandLine = '$\"$ShortPathTempVar\SNFServer.exe$\" $\"$ShortPathTempVar\snf_engine.xml$\"'$\r$\n"
- FileWrite $iniHandle "WorkingDir= $\"$ShortPathTempVar$\"$\r$\n"
- FileWrite $iniHandle "PauseStart= 100$\r$\n"
- FileWrite $iniHandle "PauseEnd= 100$\r$\n"
- FileWrite $iniHandle "UserInterface = No$\r$\n"
- FileWrite $iniHandle "Restart = Yes$\r$\n"
-
-
-
-
- FileClose $iniHandle
- FunctionEnd
-
-
-
-
-
-
- Function restartMDaemon
- nsExec::Exec "NET STOP MDaemon" "" SH_HIDE
- nsExec::Exec "NET START MDaemon" "" SH_HIDE
- FunctionEND
-
- Function un.restartMDaemon
- nsExec::Exec "NET STOP MDaemon" "" SH_HIDE
- nsExec::Exec "NET START MDaemon" "" SH_HIDE
- FunctionEND
-
- Function stopMDaemon
- nsExec::Exec "NET STOP MDaemon" "" SH_HIDE
- FunctionEnd
- Function un.stopMDaemon
- nsExec::Exec "NET STOP MDaemon" "" SH_HIDE
- FunctionEnd
-
- Function un.stopSNFServer
- nsExec::Exec "NET STOP SNFService" "" SH_HIDE
- FunctionEnd
-
- Function stopSNFServer
- nsExec::Exec "NET STOP SNFService" "" SH_HIDE
- FunctionEnd
-
- Function startSNFServer
-
-
- nsExec::Exec "NET START SNFService" "" SH_HIDE
- pop $0
- StrCmp $0 "0" 0 +2
- return
-
- FunctionEnd
-
-
- Function startXYNTService
-
- nsExec::Exec "XYNTService -r" "" SH_HIDE
-
- FunctionEnd
-
- Function stopXYNTService
-
- nsExec::Exec "XYNTService -k" "" SH_HIDE
- FunctionEnd
-
- Function un.UninstallXYNTService
-
- nsExec::Exec "NET STOP SNFService" "" SH_HIDE
- nsExec::Exec "XYNTService -u" "" SH_HIDE
- FunctionEnd
-
- Function installXYNTService
-
- Call stopSNFServer
- Call stopXYNTService
-
- SetOutPath $INSTDIR
- File "XYNTService.exe"
- File "XYNTService.ini"
-
- call editXYNTServiceINI
- nsExec::Exec "XYNTService -u" "" SH_HIDE
-
- nsExec::Exec "XYNTService -i" "" SH_HIDE
- nsExec::Exec "XYNTService -r" "" SH_HIDE
-
- call startSNFServer
- Return
-
- FunctionEnd
-
-
- Function removeShortcuts
-
-
-
- SetShellVarContext all
-
- Delete "$SMPROGRAMS\MessageSniffer\*.*"
- RMDir "$SMPROGRAMS\MessageSniffer"
- Delete "$INSTDIR\shortcuts.xml"
-
- FunctionEnd
-
- Function un.removeShortcuts
-
-
-
- SetShellVarContext all
-
- Delete "$SMPROGRAMS\MessageSniffer\*.*"
- RMDir "$SMPROGRAMS\MessageSniffer"
- Delete "$INSTDIR\shortcuts.xml"
-
- FunctionEnd
-
- Function editGetRulebase
- IfFileExists "$INSTDIR\getRulebase.cmd" 0 DoneWithErrors
-
-
-
-
-
-
-
-
-
-
-
- ${handleShortPath} $ShortPathTempVar $INSTDIR
-
- ${GetBetween} "SET SNIFFER_PATH=" "$\r$\n" "$INSTDIR\getRulebase.cmd" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\getRulebase.cmd" "SET SNIFFER_PATH=$R0$\r$\n" "SET SNIFFER_PATH=$ShortPathTempVar$\r$\n"
- ClearErrors
- ${GetBetween} "SET AUTHENTICATION=" "$\r$\n" "$INSTDIR\getRulebase.cmd" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\getRulebase.cmd" "SET AUTHENTICATION=$R0$\r$\n" "SET AUTHENTICATION=$Authentication$\r$\n"
- ClearErrors
- ${GetBetween} "SET LICENSE_ID=" "$\r$\n" "$INSTDIR\getRulebase.cmd" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\getRulebase.cmd" "SET LICENSE_ID=$R0$\r$\n" "SET LICENSE_ID=$LicenseID$\r$\n"
- ClearErrors
- return
-
- DoneWithErrors:
- MessageBox MB_OK "Unable to edit getRulebase.cmd. Unexpected Installer Environment. Please notify Message Sniffer Support Personel Immediately. Thank you."
- Quit
-
- FunctionEnd
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Function editMDPluginsFile
-
-
- ${handleShortPath} $localINSTDIR $INSTDIR
- ${handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
-
- Clearerrors
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_INSTDIR"
- iferrors 0 handleReset
- goto doneCheckingRollbackVars
- handleReset:
-
-
-
- StrCpy $localINSTDIR $registryTempData
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_SERVDIR"
- StrCpy $localSERVDIR $registryTempData
-
- ${handleShortPath} $localSERVDIR $localSERVDIR
- ${handleShortPath} $localINSTDIR $localINSTDIR
- doneCheckingRollbackVars:
-
-
-
-
-
- Var /GLOBAL lineDataHandle
- Var /GLOBAL tempVariableReadLine
- Var /GLOBAL SourcePluginsFileHandle
- Var /GLOBAL TargetPluginsFileHandle
- Var /GLOBAL insideSNFSectionFlag
- StrCpy $insideSNFSectionFlag ""
- Var /GLOBAL PresetPluginsFileData
- StrCpy $PresetPluginsFileData ""
- StrCpy $collectedArchiveData ""
-
-
-
-
- StrCmp $healFromOldFile "1" GetSourceFromRollbackFile 0
-
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\n[SNF]"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nMenuText=Configure SNF Plug-in"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nEnable=Yes"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nDllPath=$localINSTDIR\snfmdplugin.dll"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nStartupFuncName=Startup@4"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nConfigFuncName=ConfigFunc@4"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nPostMessageFuncName=MessageFunc@8"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nSMTPMessageFuncName=MessageIPFunc@8"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nShutdownFuncName=Shutdown@4"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nPluginDoesAllLogging=No"
- StrCpy $PresetPluginsFileData "$PresetPluginsFileData$\r$\nNonAuthOnly=Yes$\r$\n"
- Goto DataIsReady
-
- GetSourceFromRollbackFile:
-
-
- StrCmp $healFromOldFile "1" 0 NoDataMining
-
-
- IfFileExists $archivedMDPluginsDatPath 0 DoneReadingArchiveFile
- FileOpen $archivedMDPluginsDatFileHandle $archivedMDPluginsDatPath r
- iferrors 0 +3
- MessageBox MB_OK "Unable to restructure MDaemons Plugins.dat file from the rollback."
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedMDPluginsDatFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
-
-
- ${WordFind2X} $lineDataHandle "[" "]" "E+1" $9
- IfErrors 0 +2
- Goto ReadArchiveLine
-
- StrCmp $9 "SNF" FoundLiveArchiveSnifferLine TestTagForOldSniffer
- TestTagForOldSniffer: StrCmp $9 "SNIFFER" FoundLiveArchiveSnifferLine ReadArchiveLine
-
-
- FoundLiveArchiveSnifferLine:
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
-
- GetanInsideLine:
- FileRead $archivedMDPluginsDatFileHandle $lineDataHandle
- IfErrors DoneReadingArchiveFile
- ${WordFind2X} $lineDataHandle "[" "]" "E+1" $9
- IfErrors 0 FoundNewBracketMarker
-
-
- ClearErrors
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
- Goto GetanInsideLine
- FoundNewBracketMarker:
-
-
-
- DoneReadingArchiveFile:
- FileClose $archivedGLOBALcfgFileHandle
- StrCpy $lineDataHandle ""
-
- NoDataMining:
-
- StrCpy $PresetPluginsFileData $collectedArchiveData
- DataIsReady:
-
-
-
- IfFileExists "$localSERVDIR\App\Plugins.dat" filedoesexist 0
-
-
-
-
- ClearErrors
-
- FileOpen $TargetPluginsFileHandle "$localSERVDIR\App\Plugins.dat" w
- FileWrite $TargetPluginsFileHandle $PresetPluginsFileData
- FileClose $TargetPluginsFileHandle
-
- IfErrors FailedRepair
-
- Goto done
-
- filedoesexist:
-
- ClearErrors
-
- FileOpen $TargetPluginsFileHandle $localINSTDIR\WorkingPlugins.dat w
- IfErrors FailedWorking
-
-
- FileOpen $SourcePluginsFileHandle $localSERVDIR\App\Plugins.dat r
-
- IfErrors FailedEdit
-
-
-
-
-
-
-
-
-
-
-
-
-
- GetaLineHere:
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
-
-
- IfErrors HandleEnding
-
-
-
-
-
-
- StrCmp $insideSNFSectionFlag "1" 0 Not_In_SNF_Tagged_Section
-
- ${WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors 0 noerrors
-
-
- FindNextTag:
- ClearErrors
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
- IfErrors HandleEnding
- ${WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors FindNextTag noerrors
-
-
- noerrors:
-
- ClearErrors
- copyRestOfFile: FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
- IfErrors HandleEnding copyRestOfFile
-
-
- Not_In_SNF_Tagged_Section:
-
-
-
-
-
-
-
-
- ${WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors 0 +3
- FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- Goto GetaLineHere
-
- StrCmp $9 "SNF" TagOK TestTagForOld
- TestTagForOld: StrCmp $9 "SNIFFER" TagOK TagNotSniffer
- TagOK:
- StrCpy $insideSNFSectionFlag "1"
- Goto GetaLineHere
- TagNotSniffer:
- FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- Goto GetaLinehere
-
-
-
- HandleEnding:
-
-
-
- FileClose $SourcePluginsFileHandle
-
- ClearErrors
- FileWrite $TargetPluginsFileHandle "$\r$\n"
-
-
-
-
-
- FileWrite $TargetPluginsFileHandle $PresetPluginsFileData
-
- FileClose $TargetPluginsFileHandle
-
- ifFileExists "$localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat" 0 +2
- Delete $localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat
- Rename $localSERVDIR\App\Plugins.dat $localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat
- Rename $localINSTDIR\WorkingPlugins.dat $localSERVDIR\App\Plugins.dat
- Goto done
-
-
- FailedRepair:
- MessageBox MB_OK "Installer seemed unable to create a new Plugins.dat file. Perhaps the file is locked. Please attempt to create/move this file manually into the MDaemon\App folder using the Plugins.dat file in the MDaemon\SNF directory according to the manual instructions: "
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- ExecShell open notepad.exe $localINSTDIR\InstallInstructions_MDaemon.txt SW_SHOWNORMAL
- Goto done
- FailedWorking:
- MessageBox MB_OK "Installer seemed unable to create a working file. Perhaps the folders permissions are not enabling file creation. "
-
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- ExecShell open notepad.exe $localINSTDIR\InstallInstructions_MDaemon.txt SW_SHOWNORMAL
- Goto done
- FailedEdit:
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- MessageBox MB_OK "Installer seemed unable to edit the $localSERVDIR\App\Plugins.dat file. Perhaps the file is locked. This installation is incomplete. "
- done:
-
- FunctionEnd
-
-
-
- Function un.editMDPluginsFile
-
-
- ${un.handleShortPath} $localINSTDIR $INSTDIR
- ${un.handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
-
- Clearerrors
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_INSTDIR"
- iferrors 0 handleReset
- goto doneCheckingRollbackVars
- handleReset:
-
-
-
- StrCpy $localINSTDIR $registryTempData
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_SERVDIR"
- StrCpy $localSERVDIR $registryTempData
-
- ${un.handleShortPath} $localSERVDIR $localSERVDIR
- ${un.handleShortPath} $localINSTDIR $localINSTDIR
- doneCheckingRollbackVars:
-
-
-
-
-
-
-
-
-
-
- StrCpy $insideSNFSectionFlag ""
-
- StrCpy $PresetPluginsFileData ""
- StrCpy $collectedArchiveData ""
-
-
-
-
- StrCmp $healFromOldFile "1" GetSourceFromRollbackFile 0
-
- StrCpy $PresetPluginsFileData ""
- Goto DataIsReady
-
- GetSourceFromRollbackFile:
-
-
- StrCmp $healFromOldFile "1" 0 NoDataMining
-
-
- IfFileExists $archivedMDPluginsDatPath 0 DoneReadingArchiveFile
- FileOpen $archivedMDPluginsDatFileHandle $archivedMDPluginsDatPath r
- iferrors 0 +3
- MessageBox MB_OK "Unable to restructure MDaemons Plugins.dat file from the rollback."
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedMDPluginsDatFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
-
-
- ${un.WordFind2X} $lineDataHandle "[" "]" "E+1" $9
- IfErrors 0 +2
- Goto ReadArchiveLine
-
- StrCmp $9 "SNF" FoundLiveArchiveSnifferLine TestTagForOldSniffer
- TestTagForOldSniffer: StrCmp $9 "SNIFFER" FoundLiveArchiveSnifferLine ReadArchiveLine
-
-
- FoundLiveArchiveSnifferLine:
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
-
- GetanInsideLine:
- FileRead $archivedMDPluginsDatFileHandle $lineDataHandle
- IfErrors DoneReadingArchiveFile
- ${un.WordFind2X} $lineDataHandle "[" "]" "E+1" $9
- IfErrors 0 FoundNewBracketMarker
-
-
- ClearErrors
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
- Goto GetanInsideLine
- FoundNewBracketMarker:
-
-
-
- DoneReadingArchiveFile:
- FileClose $archivedGLOBALcfgFileHandle
- StrCpy $lineDataHandle ""
-
- NoDataMining:
-
- StrCpy $PresetPluginsFileData $collectedArchiveData
- DataIsReady:
-
-
-
-
- IfFileExists "$localSERVDIR\App\Plugins.dat" filedoesexist 0
-
-
-
-
- ClearErrors
-
- FileOpen $TargetPluginsFileHandle "$localSERVDIR\App\Plugins.dat" w
- FileWrite $TargetPluginsFileHandle $PresetPluginsFileData
- FileClose $TargetPluginsFileHandle
-
- IfErrors FailedRepair
-
- Goto done
-
- filedoesexist:
-
- ClearErrors
-
- FileOpen $TargetPluginsFileHandle $localINSTDIR\WorkingPlugins.dat w
- IfErrors FailedWorking
-
-
- FileOpen $SourcePluginsFileHandle $localSERVDIR\App\Plugins.dat r
-
- IfErrors FailedEdit
-
-
-
-
-
-
-
-
-
-
-
-
-
- GetaLineHere:
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
-
-
- IfErrors HandleEnding
-
-
-
-
-
-
- StrCmp $insideSNFSectionFlag "1" 0 Not_In_SNF_Tagged_Section
-
- ${un.WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors 0 noerrors
-
-
- FindNextTag:
- ClearErrors
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
- IfErrors HandleEnding
- ${un.WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors FindNextTag noerrors
-
-
- noerrors:
-
- ClearErrors
- copyRestOfFile: FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- FileRead $SourcePluginsFileHandle $tempVariableReadLine
- IfErrors HandleEnding copyRestOfFile
-
-
- Not_In_SNF_Tagged_Section:
-
-
-
-
-
-
-
-
- ${un.WordFind2X} $tempVariableReadLine "[" "]" "E+1" $9
- IfErrors 0 +3
- FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- Goto GetaLineHere
-
- StrCmp $9 "SNF" TagOK TestTagForOld
- TestTagForOld: StrCmp $9 "SNIFFER" TagOK TagNotSniffer
- TagOK:
- StrCpy $insideSNFSectionFlag "1"
- Goto GetaLineHere
- TagNotSniffer:
- FileWrite $TargetPluginsFileHandle $tempVariableReadLine
- Goto GetaLinehere
-
-
-
- HandleEnding:
-
-
-
- FileClose $SourcePluginsFileHandle
-
- ClearErrors
- FileWrite $TargetPluginsFileHandle "$\r$\n"
-
-
-
-
-
- FileWrite $TargetPluginsFileHandle $PresetPluginsFileData
-
- FileClose $TargetPluginsFileHandle
-
- ifFileExists "$localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat" 0 +2
- Delete $localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat
- Rename $localSERVDIR\App\Plugins.dat $localSERVDIR\App\OLDPluginsDAT_PreSNFInstall.dat
- Rename $localINSTDIR\WorkingPlugins.dat $localSERVDIR\App\Plugins.dat
- Goto done
-
-
- FailedRepair:
- MessageBox MB_OK "Uninstaller seemed unable to create a new Plugins.dat file. Perhaps the file is locked. Please attempt to create/move this file manually into the MDaemon\App folder using the Plugins.dat file in the MDaemon\SNF directory according to the manual instructions: "
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- ExecShell open notepad.exe $localINSTDIR\InstallInstructions_MDaemon.txt SW_SHOWNORMAL
- Goto done
- FailedWorking:
- MessageBox MB_OK "Uninstaller seemed unable to create a working file. Perhaps the folders permissions are not enabling file creation. "
-
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- ExecShell open notepad.exe $localINSTDIR\InstallInstructions_MDaemon.txt SW_SHOWNORMAL
- Goto done
- FailedEdit:
- FileClose $TargetPluginsFileHandle
- FileClose $SourcePluginsFileHandle
- MessageBox MB_OK "Uninstaller seemed unable to edit the $localSERVDIR\App\Plugins.dat file. Perhaps the file is locked. This installation is incomplete. "
- done:
-
- FunctionEnd
-
-
-
-
- Function un.cleanGlobalCFG
-
- Var /GLOBAL sourceFileHandle
- Var /GLOBAL targetFileHandle
- Var /GLOBAL str_line
- Var /GLOBAL results
-
- FileOpen $sourceFileHandle "$SNFServerInstallDir\global.cfg" r
- FileOpen $targetFileHandle "$SNFServerInstallDir\phase1global.cfg" w
- NextLine:
- FileRead $sourceFileHandle $str_line
- iferrors cleanupFiles 0
- StrCmp $LicenseID "" LookForBaseEXE 0
- ${un.WordFind} $str_line "$LicenseID.exe" "E+1}" $results
- ifErrors LookForBaseEXE FoundLiveSnifferLine
- LookForBaseEXE:
- ${un.WordFind} $str_line "SNFClient.exe" "E+1}" $results
- ifErrors 0 FoundLiveSnifferLine
- FileWrite $targetFileHandle $str_line
- Goto NextLine
- FoundLiveSnifferLine:
- FileWrite $targetFileHandle "#$str_line"
- Goto NextLine
- cleanupFiles:
- FileClose $sourceFileHandle
- FileClose $targetFileHandle
-
-
- ifFileExists "$SNFServerInstallDir\pre_snifferUNINSTALL_global.cfg.log" 0 +2
- Delete "$SNFServerInstallDir\pre_snifferUNINSTALL_global.cfg.log"
- Rename "$SNFServerInstallDir\global.cfg" "$SNFServerInstallDir\pre_snifferUNINSTALL_global.cfg.log"
- Rename "$SNFServerInstallDir\phase1global.cfg" "$SNFServerInstallDir\global.cfg"
- ifFileExists "$SNFServerInstallDir\phase1global.cfg" 0 +2
- Delete "$SNFServerInstallDir\phase1global.cfg"
-
- Return
- FunctionEND
-
-
- Function editglobalCFG
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
-
- Clearerrors
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_INSTDIR"
- iferrors 0 handleReset
- goto doneCheckingRollbackVars
- handleReset:
-
-
-
- StrCpy $localINSTDIR $registryTempData
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_SERVDIR"
- StrCpy $localSERVDIR $registryTempData
-
- ${handleShortPath} $localSERVDIR $localSERVDIR
- ${handleShortPath} $localINSTDIR $localINSTDIR
- doneCheckingRollbackVars:
-
-
- StrCpy $collectedArchiveData ""
- StrCpy $succededAtPlacingArchivedData "0"
-
- VAR /GLOBAL decludeConfigFileHandle
-
- VAR /GLOBAL phase_FileHandle
- VAR /GLOBAL phase
- VAR /GLOBAL TargetSnifferString
- StrCpy $phase "1"
-
-
- Var /GLOBAL foundAtLeastOneLiveSnifferLine
- StrCpy $foundAtLeastOneLiveSnifferLine "0"
-
-
-
- Var /GLOBAL WordFindResults
- Var /GLOBAL FirstCharTestVar
- Var /GLOBAL tempLineHandle
- Var /GLOBAL secondHalfOfLine
- Var /GLOBAL firstHalfOfLine
- Var /GLOBAL encapsulator
-
-
- ${IF} $healFromOldFile = "1"
-
- IfFileExists $archivedGLOBALcfgPath 0 DoneReadingArchiveFile
- FileOpen $archivedGLOBALcfgFileHandle $archivedGLOBALcfgPath r
- iferrors 0 +3
- MessageBox MB_OK "Unable to restructure Decludes global.cfg file from the rollback."
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedGLOBALcfgFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
-
- ${WordFind} $lineDataHandle "SNFClient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveArchiveSnifferLine
- ${WordFind} $lineDataHandle "$LicenseID.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveArchiveSnifferLine
- Goto ReadArchiveLine
- FoundLiveArchiveSnifferLine:
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
- Goto ReadArchiveLine
- ${ENDIF}
- DoneReadingArchiveFile:
- FileClose $archivedGLOBALcfgFileHandle
- StrCpy $lineDataHandle ""
-
-
-
-
-
- clearerrors
- FileOpen $decludeConfigFileHandle "$localSERVDIR\global.cfg" r
- iferrors 0 OpenOK
- clearerrors
- MessageBox MB_OK "Error opening $localSERVDIR\global.cfg file. Do you have the file open?"
- FileClose $decludeConfigFileHandle
- FileOpen $decludeConfigFileHandle "$localSERVDIR\global.cfg" r
- OpenOK:
- FileOpen $phase_FileHandle "$localSERVDIR\phase1global.cfg" w
-
- KeepReading:
- FileRead $decludeConfigFileHandle $lineDataHandle
- ifErrors DoneReadingFile 0
-
- ${WordFind} $lineDataHandle "SNFClient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveSnifferLine
- clearerrors
- ${WordFind} $lineDataHandle "$LicenseID.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveOLDSnifferLine
- clearerrors
- ${WordFind} $lineDataHandle "EXTERNAL TEST" "E+1}" $WordFindResults
- ifErrors 0 FoundExternalTestMarker
- clearerrors
- FileWrite $phase_FileHandle $lineDataHandle
- Goto KeepReading
-
- FoundLiveSnifferLine:
- StrCpy $TargetSnifferString "SNFClient.exe"
- Goto TestForWhitespace
- FoundLiveOLDSnifferLine:
- StrCpy $TargetSnifferString "$LicenseID.exe"
- TestForWhitespace:
-
- StrCpy $tempLineHandle $lineDataHandle
- testNextChar:
- StrCpy $FirstCharTestVar $tempLineHandle 1 0
- StrCmp $FirstCharTestVar " " 0 CheckForCommentMarker
- StrCpy $tempLineHandle $tempLineHandle "" 1
- goto testNextChar
- CheckForCommentMarker:
-
- StrCmp $FirstCharTestVar "#" 0 HandleValidLine
-
-
-
- Goto KeepReading
-
- HandleValidLine:
- StrCpy $foundAtLeastOneLiveSnifferLine "1"
-
-
- StrCmp $succededAtPlacingArchivedData "1" KeepReading 0
- StrCmp $healFromOldFile "1" 0 DealWithNormalConditions
-
- FileWrite $phase_FileHandle $collectedArchiveData
-
-
- StrCpy $succededAtPlacingArchivedData "1"
- Goto KeepReading
-
- DealWithNormalConditions:
-
-
- ${WordFind} $lineDataHandle $TargetSnifferString "+1}" $secondHalfOfLine
-
-
-
-
-
-
-
-
-
- Var /GLOBAL toTheFarRight
- ${WordFind} $secondHalfOfLine $Authentication "+1}" $toTheFarRight
- ifErrors 0 usefartherEncapsulator
-
- StrCpy $encapsulator $secondHalfOfLine 1 0
- Goto GrabLeft
- usefartherEncapsulator:
- StrCpy $encapsulator $toTheFarRight 1 0
- GrabLeft:
-
-
-
-
- ${WordFind} $lineDataHandle $TargetSnifferString "+1{" $tempLineHandle
-
- ${WordFind} $tempLineHandle $encapsulator "+1{" $firstHalfOfLine
-
-
- StrCpy $tempLineHandle "$firstHalfOfLine$encapsulator$localINSTDIR\SNFClient.exe$secondHalfOfLine"
-
- FileWrite $phase_FileHandle $tempLineHandle
-
-
-
-
- StrCpy $foundAtLeastOneLiveSnifferLine "1"
- Goto KeepReading
-
- FoundExternalTestMarker:
-
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" 0 Well_SplitPhasesThen
- FileWrite $phase_FileHandle $lineDataHandle
-
- Goto KeepReading
-
-
- Well_SplitPhasesThen:
-
- FileWrite $phase_FileHandle $lineDataHandle
-
- StrCpy $phase "2"
- FileClose $phase_FileHandle
- FileOpen $phase_FileHandle "$localSERVDIR\phase2global.cfg" w
- Goto KeepReading
-
-
- DoneReadingFile:
- FileClose $decludeConfigFileHandle
- FileClose $phase_FileHandle
-
- StrCmp $phase "1" 0 handleRejoinPhases
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" 0 AddLineAtStart
- Rename "$localSERVDIR\phase1global.cfg" "$localSERVDIR\NEWglobal.cfg"
- goto RenamePhase
- AddLineAtStart:
- Var /GLOBAL prependFileHandle
- FileOpen $prependFileHandle "$localSERVDIR\NEWglobal.cfg" w
- ${IF} $healFromOldFile = "1"
- FileWrite $prependFileHandle "############################### SNIFFER TEST SECTION #################################$\r$\n"
- FileWrite $prependFileHandle $collectedArchiveData
- ${ELSE}
- FileWrite $prependFileHandle "############################### SNIFFER TEST SECTION #################################$\r$\n"
- FileWrite $prependFileHandle 'SNIFFER external nonzero "$localINSTDIR\SNFClient.exe"$\t12$\t0$\r$\n'
- ${ENDIF}
-
-
- FileOpen $decludeConfigFileHandle "$localSERVDIR\global.cfg" r
- ReadForPrePendNewLine:
- FileRead $decludeConfigFileHandle $lineDataHandle
- iferrors closeUpThePrepend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForPrePendNewLine
- closeUpThePrepend:
- FileClose $decludeConfigFileHandle
- FileClose $prependFileHandle
- Goto RenamePhase
-
-
- handleRejoinPhases:
- FileOpen $prependFileHandle "$localSERVDIR\NEWglobal.cfg" w
- FileOpen $phase_FileHandle "$localSERVDIR\phase1global.cfg" r
- ReadForAppendPhaseOneLines:
- FileRead $phase_FileHandle $lineDataHandle
- iferrors closeUpPhaseOneAppend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForAppendPhaseOneLines
- closeUpPhaseOneAppend:
- FileClose $phase_FileHandle
-
-
-
-
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" FuseThePhaseBreak 0
-
- ${IF} $healFromOldFile = "1"
- FileWrite $prependFileHandle $collectedArchiveData
- ${ELSE}
- FileWrite $prependFileHandle 'SNIFFER external nonzero "$localINSTDIR\SNFClient.exe"$\t12$\t0$\r$\n'
- ${ENDIF}
-
-
- FuseThePhaseBreak:
- FileOpen $phase_FileHandle "$localSERVDIR\phase2global.cfg" r
- ReadForAppendPhaseTwoLines:
- FileRead $phase_FileHandle $lineDataHandle
- iferrors closeUpPhaseTwoAppend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForAppendPhaseTwoLines
- closeUpPhaseTwoAppend:
- FileClose $phase_FileHandle
-
- FileClose $prependFileHandle
- goto RenamePhase
-
- RenamePhase:
- StrCpy $healFromOldFile "0"
-
- ifFileExists "$localSERVDIR\pre_snifferinstall_global.cfg.log" 0 +2
- Delete "$localSERVDIR\pre_snifferinstall_global.cfg.log"
- Rename "$localSERVDIR\global.cfg" "$localSERVDIR\pre_snifferinstall_global.cfg.log"
- Rename "$localSERVDIR\NEWglobal.cfg" "$localSERVDIR\global.cfg"
- ifFileExists "$localSERVDIR\phase1global.cfg" 0 +2
- Delete "$localSERVDIR\phase1global.cfg"
- ifFileExists "$localSERVDIR\phase2global.cfg" 0 +2
- Delete "$localSERVDIR\phase2global.cfg"
- ifFileExists "$localSERVDIR\NEWglobal.cfg" 0 +2
- Delete "$localSERVDIR\NEWglobal.cfg"
-
- Return
-
- FunctionEnd
-
-
-
-
- Function un.editglobalCFG
- StrCpy $collectedArchiveData ""
- StrCpy $succededAtPlacingArchivedData "0"
-
-
-
-
-
-
- StrCpy $phase "1"
-
-
-
- StrCpy $foundAtLeastOneLiveSnifferLine "0"
-
-
-
- ${un.handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${un.handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
-
-
- ${IF} $healFromOldFile = "1"
-
- IfFileExists $archivedGLOBALcfgPath 0 DoneReadingArchiveFile
- FileOpen $archivedGLOBALcfgFileHandle $archivedGLOBALcfgPath r
- iferrors 0 +3
- MessageBox MB_OK "Unable to restructure Decludes global.cfg file from the rollback archive."
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedGLOBALcfgFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
-
- ${un.WordFind} $lineDataHandle "SNFClient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveArchiveSnifferLine
- ${un.WordFind} $lineDataHandle "$LicenseID.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveArchiveSnifferLine
- Goto ReadArchiveLine
- FoundLiveArchiveSnifferLine:
- StrCpy $collectedArchiveData "$collectedArchiveData$lineDataHandle"
- Goto ReadArchiveLine
- ${ENDIF}
- DoneReadingArchiveFile:
- FileClose $archivedGLOBALcfgFileHandle
- StrCpy $lineDataHandle ""
-
-
-
-
-
- FileOpen $decludeConfigFileHandle "$SNFServerInstallDir\global.cfg" r
- iferrors 0 OpenOK
- clearerrors
- MessageBox MB_OK "Error opening $SNFServerInstallDir\global.cfg file. Do you have the file open?"
- FileClose $decludeConfigFileHandle
- FileOpen $decludeConfigFileHandle "$SNFServerInstallDir\global.cfg" r
- OpenOK:
- FileOpen $phase_FileHandle "$SNFServerInstallDir\phase1global.cfg" w
-
- KeepReading:
- FileRead $decludeConfigFileHandle $lineDataHandle
- ifErrors DoneReadingFile 0
-
- ${un.WordFind} $lineDataHandle "SNFClient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveSnifferLine
- clearerrors
- ${un.WordFind} $lineDataHandle "$LicenseID.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundLiveOLDSnifferLine
- clearerrors
- ${un.WordFind} $lineDataHandle "EXTERNAL TEST" "E+1}" $WordFindResults
- ifErrors 0 FoundExternalTestMarker
- clearerrors
- FileWrite $phase_FileHandle $lineDataHandle
- Goto KeepReading
-
- FoundLiveSnifferLine:
- StrCpy $TargetSnifferString "SNFClient.exe"
- Goto TestForWhitespace
- FoundLiveOLDSnifferLine:
- StrCpy $TargetSnifferString "$LicenseID.exe"
- TestForWhitespace:
-
- StrCpy $tempLineHandle $lineDataHandle
- testNextChar:
- StrCpy $FirstCharTestVar $tempLineHandle 1 0
- StrCmp $FirstCharTestVar " " 0 CheckForCommentMarker
- StrCpy $tempLineHandle $tempLineHandle "" 1
- goto testNextChar
- CheckForCommentMarker:
-
- StrCmp $FirstCharTestVar "#" 0 HandleValidLine
-
-
-
- Goto KeepReading
-
- HandleValidLine:
- StrCpy $foundAtLeastOneLiveSnifferLine "1"
-
-
- StrCmp $succededAtPlacingArchivedData "1" KeepReading 0
- StrCmp $healFromOldFile "1" 0 DealWithNormalConditions
-
- FileWrite $phase_FileHandle $collectedArchiveData
-
-
- StrCpy $succededAtPlacingArchivedData "1"
- Goto KeepReading
-
- DealWithNormalConditions:
-
-
- ${un.WordFind} $lineDataHandle $TargetSnifferString "+1}" $secondHalfOfLine
-
-
-
-
-
-
-
-
-
-
- ${un.WordFind} $secondHalfOfLine $Authentication "+1}" $toTheFarRight
- ifErrors 0 usefartherEncapsulator
-
- StrCpy $encapsulator $secondHalfOfLine 1 0
- Goto GrabLeft
- usefartherEncapsulator:
- StrCpy $encapsulator $toTheFarRight 1 0
- GrabLeft:
-
-
-
-
- ${un.WordFind} $lineDataHandle $TargetSnifferString "+1{" $tempLineHandle
-
- ${un.WordFind} $tempLineHandle $encapsulator "+1{" $firstHalfOfLine
-
-
- StrCpy $tempLineHandle "$firstHalfOfLine$encapsulator$localINSTDIR\SNFClient.exe$secondHalfOfLine"
-
- FileWrite $phase_FileHandle $tempLineHandle
-
-
-
-
- StrCpy $foundAtLeastOneLiveSnifferLine "1"
- Goto KeepReading
-
- FoundExternalTestMarker:
-
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" 0 Well_SplitPhasesThen
- FileWrite $phase_FileHandle $lineDataHandle
-
- Goto KeepReading
-
-
- Well_SplitPhasesThen:
-
- FileWrite $phase_FileHandle $lineDataHandle
-
- StrCpy $phase "2"
- FileClose $phase_FileHandle
- FileOpen $phase_FileHandle "$SNFServerInstallDir\phase2global.cfg" w
- Goto KeepReading
-
-
- DoneReadingFile:
- FileClose $decludeConfigFileHandle
- FileClose $phase_FileHandle
-
- StrCmp $phase "1" 0 handleRejoinPhases
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" 0 AddLineAtStart
- Rename "$SNFServerInstallDir\phase1global.cfg" "$SNFServerInstallDir\NEWglobal.cfg"
- goto RenamePhase
- AddLineAtStart:
-
- FileOpen $prependFileHandle "$SNFServerInstallDir\NEWglobal.cfg" w
- ${IF} $healFromOldFile = "1"
- FileWrite $prependFileHandle "############################### SNIFFER TEST SECTION #################################$\r$\n"
- FileWrite $prependFileHandle $collectedArchiveData
- ${ELSE}
- FileWrite $prependFileHandle "############################### SNIFFER TEST SECTION #################################$\r$\n"
- FileWrite $prependFileHandle 'SNIFFER external nonzero "$INSTDIR\SNFClient.exe"$\t12$\t0$\r$\n'
- ${ENDIF}
-
-
- FileOpen $decludeConfigFileHandle "$SNFServerInstallDir\global.cfg" r
- ReadForPrePendNewLine:
- FileRead $decludeConfigFileHandle $lineDataHandle
- iferrors closeUpThePrepend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForPrePendNewLine
- closeUpThePrepend:
- FileClose $decludeConfigFileHandle
- FileClose $prependFileHandle
- Goto RenamePhase
-
-
- handleRejoinPhases:
- FileOpen $prependFileHandle "$SNFServerInstallDir\NEWglobal.cfg" w
- FileOpen $phase_FileHandle "$SNFServerInstallDir\phase1global.cfg" r
- ReadForAppendPhaseOneLines:
- FileRead $phase_FileHandle $lineDataHandle
- iferrors closeUpPhaseOneAppend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForAppendPhaseOneLines
- closeUpPhaseOneAppend:
- FileClose $phase_FileHandle
-
-
-
-
-
- StrCmp $foundAtLeastOneLiveSnifferLine "1" FuseThePhaseBreak 0
-
- ${IF} $healFromOldFile = "1"
- FileWrite $prependFileHandle $collectedArchiveData
- ${ELSE}
- FileWrite $prependFileHandle 'SNIFFER external nonzero "$localINSTDIR\SNFClient.exe"$\t12$\t0$\r$\n'
- ${ENDIF}
-
-
- FuseThePhaseBreak:
- FileOpen $phase_FileHandle "$SNFServerInstallDir\phase2global.cfg" r
- ReadForAppendPhaseTwoLines:
- FileRead $phase_FileHandle $lineDataHandle
- iferrors closeUpPhaseTwoAppend 0
- FileWrite $prependFileHandle $lineDataHandle
- Goto ReadForAppendPhaseTwoLines
- closeUpPhaseTwoAppend:
- FileClose $phase_FileHandle
-
- FileClose $prependFileHandle
- goto RenamePhase
-
- RenamePhase:
- StrCpy $healFromOldFile "0"
-
- ifFileExists "$SNFServerInstallDir\pre_snifferinstall_global.cfg.log" 0 +2
- Delete "$SNFServerInstallDir\pre_snifferinstall_global.cfg.log"
- Rename "$SNFServerInstallDir\global.cfg" "$SNFServerInstallDir\pre_snifferinstall_global.cfg.log"
- Rename "$SNFServerInstallDir\NEWglobal.cfg" "$SNFServerInstallDir\global.cfg"
- ifFileExists "$SNFServerInstallDir\phase1global.cfg" 0 +2
- Delete "$SNFServerInstallDir\phase1global.cfg"
- ifFileExists "$SNFServerInstallDir\phase2global.cfg" 0 +2
- Delete "$SNFServerInstallDir\phase2global.cfg"
- ifFileExists "$SNFServerInstallDir\NEWglobal.cfg" 0 +2
- Delete "$SNFServerInstallDir\NEWglobal.cfg"
-
- Return
-
- FunctionEnd
-
-
-
-
-
- Function editMXGuardINI
-
-
- VAR /GLOBAL newMXGuardINIFileHandle
- VAR /GLOBAL MXGuardINIFileHandle
- VAR /GLOBAL InsertAuthenticationString
- VAR /GLOBAL InsertPathString
-
-
-
-
-
-
-
-
-
-
-
-
- ${handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
- Clearerrors
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_INSTDIR"
- iferrors 0 handleReset
- goto doneCheckingRollbackVars
- handleReset:
-
-
-
- StrCpy $localINSTDIR $registryTempData
- ReadRegStr $registryTempData HKLM "Software\MessageSniffer" "SRS_SERVDIR"
- StrCpy $localSERVDIR $registryTempData
-
- ${handleShortPath} $localINSTDIR $localINSTDIR
- ${handleShortPath} $localSERVDIR $localSERVDIR
- doneCheckingRollbackVars:
-
-
-
- StrCpy $InsertAuthenticationString "$Authentication$\r$\n"
- StrCpy $InsertPathString "$localINSTDIR\SNFClient.exe$\r$\n"
-
-
-
-
-
-
-
- ${IF} $healFromOldFile = "1"
-
- clearerrors
- IfFileExists $archivedMXGUARDiniPath 0 DoneReadingArchiveFile
- FileOpen $archivedMXGUARDiniFileHandle $archivedMXGUARDiniPath r
- iferrors 0 ReadArchiveLine
- MessageBox MB_OK "Unable to read MXGuard's MXGuard.ini file from the rollback archive: $archivedMXGUARDiniPath"
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
- ${WordFind} $lineDataHandle "[Sniffer]" "E+1}" $WordFindResults
- ifErrors 0 FoundArchivedTestMarker
- Goto ReadArchiveLine
- FoundArchivedTestMarker:
-
- LookForAuth:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ${WordFind} $lineDataHandle "AuthCode=" "E+1}" $WordFindResults
- ifErrors LookForAuth 0
- StrCpy $InsertAuthenticationString $WordFindResults
- LookForPath:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ${WordFind} $lineDataHandle "PathToEXE=" "E+1}" $WordFindResults
- ifErrors LookForPath 0
- StrCpy $InsertPathString $WordFindResults
- ${ENDIF}
- DoneReadingArchiveFile:
- FileClose $archivedMXGUARDiniFileHandle
- StrCpy $lineDataHandle ""
-
-
-
- FileOpen $MXGuardINIFileHandle "$localSERVDIR\mxGuard.ini" r
-
-
- FileOpen $newMXGuardINIFileHandle "$localSERVDIR\NEWmxGuard.ini" w
-
- clearerrors
- KeepReading:
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
- ifErrors DoneReadingFile 0
- ${WordFind} $lineDataHandle "[Sniffer]" "E+1}" $WordFindResults
- ifErrors 0 FoundExternalTestMarker
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
- Goto KeepReading
- FoundExternalTestMarker:
-
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
-
-
- FileWrite $newMXGuardINIFileHandle "AuthCode=$InsertAuthenticationString"
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
-
- FileWrite $newMXGuardINIFileHandle "PathToEXE=$InsertPathString"
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
-
-
-
- KeepDumping:
- FileRead $MXGuardINIFileHandle $lineDataHandle
- ifErrors DoneDumping 0
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
- Goto KeepDumping
-
- DoneDumping:
-
- FileClose $MXGuardINIFileHandle
- FileClose $newMXGuardINIFileHandle
- ifFileExists "$localSERVDIR\old_mxGuard.ini" 0 +2
- Delete "$localSERVDIR\old_mxGuard.ini"
- Rename "$localSERVDIR\mxGuard.ini" "$localSERVDIR\old_mxGuard.ini"
- Rename "$localSERVDIR\NEWmxGuard.ini" "$localSERVDIR\mxGuard.ini"
- Delete "$localSERVDIR\old_mxGuard.ini"
- StrCpy $healFromOldFile "0"
- Return
-
- DoneReadingFile:
-
- MessageBox MB_OK "MXGuards INI file seems to be missing the [SNIFFER] section. Adding [SNIFFER] section. "
- FileWrite $newMXGuardINIFileHandle "$\r$\n[SNIFFER]$\r$\n"
-
- FileWrite $newMXGuardINIFileHandle "AuthCode=$InsertAuthenticationString\r$\n"
-
- FileWrite $newMXGuardINIFileHandle "PathToEXE=$InsertPathString$\r$\n"
- FileClose $newMXGuardINIFileHandle
- FileClose $MXGuardINIFileHandle
-
- ifFileExists "$localSERVDIR\old_mxGuard.ini" 0 +2
- Delete "$localSERVDIR\old_mxGuard.ini"
-
- Rename "$localSERVDIR\mxGuard.ini" "$localSERVDIR\old_mxGuard.ini"
- Rename "$localSERVDIR\NEWmxGuard.ini" "$localSERVDIR\mxGuard.ini"
-
- Delete "$localSERVDIR\old_mxGuard.ini"
- StrCpy $healFromOldFile "0"
- Return
-
- FunctionEnd
-
-
- Function un.editMXGuardINI
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${un.handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${un.handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
- StrCpy $InsertAuthenticationString "$Authentication$\r$\n"
- StrCpy $InsertPathString "$localINSTDIR\SNFClient.exe$\r$\n"
-
-
-
-
-
-
-
- ${IF} $healFromOldFile = "1"
-
- clearerrors
- IfFileExists $archivedMXGUARDiniPath 0 DoneReadingArchiveFile
- FileOpen $archivedMXGUARDiniFileHandle $archivedMXGUARDiniPath r
- iferrors 0 ReadArchiveLine
- MessageBox MB_OK "Unable to read MXGuard's MXGuard.ini file from the rollback archive: $archivedMXGUARDiniPath"
- Goto DoneReadingArchiveFile
- ReadArchiveLine:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ifErrors DoneReadingArchiveFile 0
- ${un.WordFind} $lineDataHandle "[Sniffer]" "E+1}" $WordFindResults
- ifErrors 0 FoundArchivedTestMarker
- Goto ReadArchiveLine
- FoundArchivedTestMarker:
-
- LookForAuth:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ${un.WordFind} $lineDataHandle "AuthCode=" "E+1}" $WordFindResults
- ifErrors LookForAuth 0
- StrCpy $InsertAuthenticationString $WordFindResults
- LookForPath:
- FileRead $archivedMXGUARDiniFileHandle $lineDataHandle
- ${un.WordFind} $lineDataHandle "PathToEXE=" "E+1}" $WordFindResults
- ifErrors LookForPath 0
- StrCpy $InsertPathString $WordFindResults
- ${ENDIF}
- DoneReadingArchiveFile:
- FileClose $archivedMXGUARDiniFileHandle
- StrCpy $lineDataHandle ""
-
-
-
- FileOpen $MXGuardINIFileHandle "$SNFServerInstallDir\mxGuard.ini" r
-
-
- FileOpen $newMXGuardINIFileHandle "$SNFServerInstallDir\NEWmxGuard.ini" w
-
- clearerrors
- KeepReading:
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
- ifErrors DoneReadingFile 0
- ${un.WordFind} $lineDataHandle "[Sniffer]" "E+1}" $WordFindResults
- ifErrors 0 FoundExternalTestMarker
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
- Goto KeepReading
- FoundExternalTestMarker:
-
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
-
-
- FileWrite $newMXGuardINIFileHandle "AuthCode=$InsertAuthenticationString"
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
-
- FileWrite $newMXGuardINIFileHandle "PathToEXE=$InsertPathString"
-
- FileRead $MXGuardINIFileHandle $lineDataHandle
-
-
-
- KeepDumping:
- FileRead $MXGuardINIFileHandle $lineDataHandle
- ifErrors DoneDumping 0
- FileWrite $newMXGuardINIFileHandle $lineDataHandle
- Goto KeepDumping
-
- DoneDumping:
-
- FileClose $MXGuardINIFileHandle
- FileClose $newMXGuardINIFileHandle
- ifFileExists "$SNFServerInstallDir\old_mxGuard.ini" 0 +2
- Delete "$SNFServerInstallDir\old_mxGuard.ini"
- Rename "$SNFServerInstallDir\mxGuard.ini" "$SNFServerInstallDir\old_mxGuard.ini"
- Rename "$SNFServerInstallDir\NEWmxGuard.ini" "$SNFServerInstallDir\mxGuard.ini"
- Delete "$SNFServerInstallDir\old_mxGuard.ini"
- StrCpy $healFromOldFile "0"
- Return
-
- DoneReadingFile:
-
- MessageBox MB_OK "MXGuards INI file seems to be missing the [SNIFFER] section. Adding [SNIFFER] section. "
- FileWrite $newMXGuardINIFileHandle "$\r$\n[SNIFFER]$\r$\n"
-
- FileWrite $newMXGuardINIFileHandle "AuthCode=$InsertAuthenticationString\r$\n"
-
- FileWrite $newMXGuardINIFileHandle "PathToEXE=$InsertPathString$\r$\n"
- FileClose $newMXGuardINIFileHandle
- FileClose $MXGuardINIFileHandle
-
- ifFileExists "$SNFServerInstallDir\old_mxGuard.ini" 0 +2
- Delete "$SNFServerInstallDir\old_mxGuard.ini"
-
- Rename "$SNFServerInstallDir\mxGuard.ini" "$SNFServerInstallDir\old_mxGuard.ini"
- Rename "$SNFServerInstallDir\NEWmxGuard.ini" "$SNFServerInstallDir\mxGuard.ini"
-
- Delete "$SNFServerInstallDir\old_mxGuard.ini"
- StrCpy $healFromOldFile "0"
- Return
-
- FunctionEnd
-
-
- Function un.editContentXML
-
-
-
-
- Call un.stripScanXML
-
-
-
- Var /GLOBAL IceWarpContentFileHandle
- Var /GLOBAL IceWarpAdjustedFileHandle
- Var /GLOBAL IceWarpSnifferXMLExists
- Var /GLOBAL TempFilterXML
- Var /GLOBAL didWeOutput
- StrCpy $didWeOutput "0"
- StrCpy $IceWarpSnifferXMLExists "0"
-
- Var /GLOBAL IceWarpContentXMLlinedata
- FileOpen $IceWarpAdjustedFileHandle "$SNFServerInstallDir\config\contentNEW.xml" w
- clearerrors
- IfFileExists "$SNFServerInstallDir\config\content.xml" 0 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$SNFServerInstallDir\config\content.xml" r
- iferrors 0 ReadContentLine
- MessageBox MB_OK "Unable to read IceWarps Content.XML file from: $SNFServerInstallDir\config\content.xml"
- Goto DoneReadingContentFile
-
-
-
- ReadForProperyHeaderedFilterFile:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingEmptyFile 0
- ${un.WordFind} $IceWarpContentXMLlinedata "<CONTENTFILTER>" "E+1}" $WordFindResults
- ifErrors 0 ProperlyHeaderedFile
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadForProperyHeaderedFilterFile
- ProperlyHeaderedFile:
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
-
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${un.WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${un.WordFind} $IceWarpContentXMLlinedata "<TITLE>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${un.WordFind} $IceWarpContentXMLlinedata "SNIFFER" "E+1}" $WordFindResults
- ifErrors 0 FoundSnifferSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundSnifferSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${un.WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$SNFServerInstallDir\config\contentNEW.xml"
- Return
-
-
- DoneReadingContentFile:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
- Var /GLOBAL var1
- Var /GLOBAL var2
- Var /GLOBAL var3
- Var /GLOBAL var4
- Var /GLOBAL var5
- Var /GLOBAL var6
- Var /GLOBAL var7
- ${un.GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- Rename "$SNFServerInstallDir\config\content.xml" "$SNFServerInstallDir\config\content_UnInstallLOG_$var1-$var2-$var4.xml"
- Rename "$SNFServerInstallDir\config\contentNEW.xml" "$SNFServerInstallDir\config\content.xml"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$SNFServerInstallDir\config\contentNEW.xml"
- Return
-
- UnableToFindContentFileXML:
- Return
-
- FunctionEnd
-
-
- Function stripContentXML
-
-
-
-
-
-
-
-
-
-
-
- StrCpy $didWeOutput "0"
- StrCpy $IceWarpSnifferXMLExists "0"
-
-
- FileOpen $IceWarpAdjustedFileHandle "$SNFServerInstallDir\config\contentNEW.xml" w
- clearerrors
- IfFileExists "$SNFServerInstallDir\config\content.xml" 0 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$SNFServerInstallDir\config\content.xml" r
- iferrors 0 ReadContentLine
- MessageBox MB_OK "Unable to read IceWarps Content.XML file from: $SNFServerInstallDir\config\content.xml"
- Goto DoneReadingContentFile
-
-
-
- ReadForProperyHeaderedFilterFile:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingEmptyFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<CONTENTFILTER>" "E+1}" $WordFindResults
- ifErrors 0 ProperlyHeaderedFile
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadForProperyHeaderedFilterFile
- ProperlyHeaderedFile:
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
-
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<TITLE>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${WordFind} $IceWarpContentXMLlinedata "SNIFFER" "E+1}" $WordFindResults
- ifErrors 0 FoundSnifferSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundSnifferSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$SNFServerInstallDir\config\contentNEW.xml"
- Return
-
-
- DoneReadingContentFile:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
-
-
-
-
-
-
-
- ${GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- Rename "$SNFServerInstallDir\config\content.xml" "$SNFServerInstallDir\config\content_UnInstallLOG_$var1-$var2-$var4.xml"
- Rename "$SNFServerInstallDir\config\contentNEW.xml" "$SNFServerInstallDir\config\content.xml"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$SNFServerInstallDir\config\contentNEW.xml"
- Return
-
- UnableToFindContentFileXML:
- Return
-
- FunctionEnd
-
-
- Function editContentXML
-
-
-
- ${handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${handleShortPath} $localSERVDIR $SNFServerInstallDir
-
-
-
-
- Var /GLOBAL IceWarpType
- ReadRegStr $IceWarpType HKLM "SOFTWARE\MessageSniffer" "IceWarpType"
-
-
- StrCmp $IceWarpType "AV" 0 useContentFilters
- Call editScanXML
- return
-
-
- useContentFilters:
-
-
-
- Call stripScanXML
-
- Var /GLOBAL ContentXMLHeader
- Var /GLOBAL ContentXMLFooter
- Var /GLOBAL SnifferXMLContent
- Var /GLOBAL SnifferXMLContent2
- StrCpy $ContentXMLHeader '<?xml version="1.0" encoding="UTF-8"?>$\r$\n<CONTENTFILTER>$\r$\n'
- StrCpy $ContentXMLFooter "</CONTENTFILTER>"
-
- StrCmp $IceWarpType "CF" 0 SetForSS
- StrCpy $SnifferXMLContent ""
- StrCpy $SnifferXMLContent "$SnifferXMLContent<FILTER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <ACTIVE>1</ACTIVE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <TITLE>SNIFFER</TITLE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <READONLY>0</READONLY>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <AND>1</AND>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <LOGICALNOT>0</LOGICALNOT>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <EXPRESSION>6</EXPRESSION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAINTYPE>8</CONTAINTYPE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZESMALLER>0</MESSAGESIZESMALLER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZE>1</MESSAGESIZE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent </CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <AND>1</AND>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <LOGICALNOT>0</LOGICALNOT>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <EXPRESSION>4</EXPRESSION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAINTYPE>8</CONTAINTYPE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAIN>$localINSTDIR\SNFClient.exe</CONTAIN>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZESMALLER>0</MESSAGESIZESMALLER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZE>2</MESSAGESIZE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent </CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <ACCEPT>0</ACCEPT>$\r$\n"
- StrCpy $SnifferXMLContent2 " <REJECT>0</REJECT>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <DELETE>0</DELETE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <ENCRYPT>0</ENCRYPT>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <PRIORITY>0</PRIORITY>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <FLAGS>0</FLAGS>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <SCORE>500</SCORE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <MARKSPAM>1</MARKSPAM>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <STOP>0</STOP>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <EXECUTE>0</EXECUTE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <TARPITSENDER>0</TARPITSENDER>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <FIXRFC822>0</FIXRFC822>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <SMTPRESPONSE>0</SMTPRESPONSE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <STRIPALL>1</STRIPALL>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <HEADER>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <VAL>0X-SNIFFER-FLAG: Yes </VAL>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 </HEADER>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2</FILTER>$\r$\n"
- Goto FilterTextReady
- SetForSS:
-
- StrCpy $SnifferXMLContent "$SnifferXMLContent<FILTER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <ACTIVE>1</ACTIVE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <TITLE>SNIFFER</TITLE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <READONLY>0</READONLY>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <AND>1</AND>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <LOGICALNOT>0</LOGICALNOT>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <EXPRESSION>6</EXPRESSION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAINTYPE>8</CONTAINTYPE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZESMALLER>0</MESSAGESIZESMALLER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZE>1</MESSAGESIZE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent </CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <AND>1</AND>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <LOGICALNOT>0</LOGICALNOT>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <EXPRESSION>4</EXPRESSION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAINTYPE>8</CONTAINTYPE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <CONTAIN>$localINSTDIR\SNFClient.exe</CONTAIN>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZESMALLER>0</MESSAGESIZESMALLER>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <MESSAGESIZE>2</MESSAGESIZE>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent </CONDITION>$\r$\n"
- StrCpy $SnifferXMLContent "$SnifferXMLContent <ACCEPT>0</ACCEPT>$\r$\n"
- StrCpy $SnifferXMLContent2 " <REJECT>0</REJECT>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <DELETE>0</DELETE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <ENCRYPT>0</ENCRYPT>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <PRIORITY>0</PRIORITY>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <FLAGS>0</FLAGS>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <SCORE>500</SCORE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <MARKSPAM>0</MARKSPAM>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <STOP>0</STOP>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <EXECUTE>0</EXECUTE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <TARPITSENDER>0</TARPITSENDER>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <FIXRFC822>0</FIXRFC822>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2 <SMTPRESPONSE>0</SMTPRESPONSE>$\r$\n"
- StrCpy $SnifferXMLContent2 "$SnifferXMLContent2</FILTER>$\r$\n"
-
- FilterTextReady:
-
-
-
-
-
-
-
-
- StrCpy $didWeOutput "0"
- StrCpy $IceWarpSnifferXMLExists "0"
-
- FileOpen $IceWarpAdjustedFileHandle "$SNFServerInstallDir\config\contentNEW.xml" w
- clearerrors
- IfFileExists "$SNFServerInstallDir\config\content.xml" 0 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$SNFServerInstallDir\config\content.xml" r
- iferrors 0 ReadContentLine
- MessageBox MB_OK "Unable to read IceWarps Content.XML file from: $SNFServerInstallDir\config\content.xml"
- Goto DoneReadingContentFile
-
-
-
- ReadForProperyHeaderedFilterFile:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingEmptyFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<CONTENTFILTER>" "E+1}" $WordFindResults
- ifErrors 0 ProperlyHeaderedFile
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadForProperyHeaderedFilterFile
- ProperlyHeaderedFile:
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
-
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
-
- ${WordFind} $IceWarpContentXMLlinedata "</CONTENTFILTER>" "E+1}" $WordFindResults
- ifErrors NotEndingYet 0
-
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent2
- StrCpy $didWeOutput "1"
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto DoneReadingContentFile
- NotEndingYet:
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<TITLE>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${WordFind} $IceWarpContentXMLlinedata "SNIFFER" "E+1}" $WordFindResults
- ifErrors 0 FoundSnifferSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundSnifferSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent2
- StrCpy $didWeOutput "1"
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLHeader
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent2
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLFooter
- StrCpy $didWeOutput "1"
-
-
-
- DoneReadingContentFile:
-
- StrCmp $didWeOutput "0" 0 SkipOutputThisTime
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLHeader
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent
- FileWrite $IceWarpAdjustedFileHandle $SnifferXMLContent2
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLFooter
- SkipOutputThisTime:
-
-
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
-
-
-
-
-
-
-
-
- ${GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- ifFileExists "$SNFServerInstallDir\config\content_InstallLOG_$var1-$var2-$var4.xml" 0 +2
- Delete "$SNFServerInstallDir\config\content_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$SNFServerInstallDir\config\content.xml" "$SNFServerInstallDir\config\content_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$SNFServerInstallDir\config\contentNEW.xml" "$SNFServerInstallDir\config\content.xml"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$SNFServerInstallDir\config\contentNEW.xml"
- MessageBox MB_OK "Attempting to edit XML in: $SNFServerInstallDir\config\content.xml resulted in finding a corrupted construction. Please check the new file, content.xml, manually."
- Return
-
- UnableToFindContentFileXML:
- MessageBox MB_OK "Unable to find IceWarps Content.XML file from: $SNFServerInstallDir\config\content.xml You will have to tie-in manually with IceWarp."
- Return
-
- FunctionEND
-
-
- Function un.stripScanXML
-
-
-
-
-
-
-
-
-
-
-
-
-
- Var /GLOBAL IceWarpInstallFolder
- StrCpy $IceWarpInstallFolder $SNFServerInstallDir
-
- StrCpy $ContentXMLHeader '<FILTERS>$\r$\n'
- StrCpy $ContentXMLFooter "</FILTERS>$\r$\n"
-
-
-
-
-
-
-
-
- StrCpy $didWeOutput "0"
-
- FileOpen $IceWarpAdjustedFileHandle "$IceWarpInstallFolder\config\scanNEW.dat" w
- clearerrors
- IfFileExists "$IceWarpInstallFolder\config\scan.dat" 0 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$IceWarpInstallFolder\config\scan.dat" r
- iferrors 0 ReadContentLine
- MessageBox MB_OK "Unable to read IceWarps scan.dat file from: $IceWarpInstallFolder\config\scan.dat"
- Goto DoneReadingContentFile
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${un.WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
-
- ${un.WordFind} $IceWarpContentXMLlinedata "</FILTERS>" "E+1}" $WordFindResults
- ifErrors NotEndingYet 0
-
- StrCpy $didWeOutput "1"
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto DoneReadingContentFile
- NotEndingYet:
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${un.WordFind} $IceWarpContentXMLlinedata "<FILENAME>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${un.WordFind} $IceWarpContentXMLlinedata "SNFCLient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundClamSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundClamSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${un.WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
- StrCpy $didWeOutput "1"
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
-
- StrCpy $didWeOutput "1"
-
-
-
- DoneReadingContentFile:
-
- StrCmp $didWeOutput "0" 0 SkipOutputThisTime
-
- SkipOutputThisTime:
-
-
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
-
-
-
-
-
-
-
-
- ${un.GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- ifFileExists "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml" 0 +2
- Delete "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scan.dat" "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scanNEW.dat" "$IceWarpInstallFolder\config\scan.dat"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$IceWarpInstallFolder\config\scanNew.dat"
- MessageBox MB_OK "Attempting to edit XML in: $IceWarpInstallFolder\config\scan.dat resulted in finding a corrupted construction. Please check the new file, scan.dat, manually."
- Return
-
- UnableToFindContentFileXML:
- MessageBox MB_OK "Unable to find IceWarps scan.dat file from: $IceWarpInstallFolder\config\scan.dat You will have to tie-in manually with IceWarp."
- Return
-
- FunctionEnd
-
-
- Function stripScanXML
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- StrCpy $IceWarpInstallFolder $SNFServerInstallDir
-
- StrCpy $ContentXMLHeader '<FILTERS>$\r$\n'
- StrCpy $ContentXMLFooter "</FILTERS>$\r$\n"
-
-
-
-
-
-
-
-
- StrCpy $didWeOutput "0"
-
- FileOpen $IceWarpAdjustedFileHandle "$IceWarpInstallFolder\config\scanNEW.dat" w
- clearerrors
- IfFileExists "$IceWarpInstallFolder\config\scan.dat" 0 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$IceWarpInstallFolder\config\scan.dat" r
- iferrors 0 ReadContentLine
- MessageBox MB_OK "Unable to read IceWarps scan.dat file from: $IceWarpInstallFolder\config\scan.dat"
- Goto DoneReadingContentFile
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
-
- ${WordFind} $IceWarpContentXMLlinedata "</FILTERS>" "E+1}" $WordFindResults
- ifErrors NotEndingYet 0
-
- StrCpy $didWeOutput "1"
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto DoneReadingContentFile
- NotEndingYet:
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILENAME>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${WordFind} $IceWarpContentXMLlinedata "SNFCLient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundSnifferSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundSnifferSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
- StrCpy $didWeOutput "1"
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
-
- StrCpy $didWeOutput "1"
-
-
-
- DoneReadingContentFile:
-
- StrCmp $didWeOutput "0" 0 SkipOutputThisTime
-
- SkipOutputThisTime:
-
-
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
-
-
-
-
-
-
-
-
- ${GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- ifFileExists "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml" 0 +2
- Delete "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scan.dat" "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scanNEW.dat" "$IceWarpInstallFolder\config\scan.dat"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$IceWarpInstallFolder\config\scanNew.dat"
- MessageBox MB_OK "Attempting to edit XML in: $IceWarpInstallFolder\config\scan.dat resulted in finding a corrupted construction. Please check the new file, scan.dat, manually."
- Return
-
- UnableToFindContentFileXML:
-
- Return
-
- FunctionEnd
-
-
-
- Function editScanXML
-
-
-
-
- call stripContentXML
-
-
-
-
-
-
-
- Var /GLOBAL SnifferAVXMLContent
-
-
-
-
-
-
-
-
-
-
-
- StrCpy $IceWarpInstallFolder $SNFServerInstallDir
-
-
- ${handleShortPath} $localINSTDIR $INSTDIR
-
-
-
- ${handleShortPath} $IceWarpInstallFolder $SNFServerInstallDir
-
-
-
-
- StrCpy $ContentXMLHeader '<FILTERS>$\r$\n'
- StrCpy $ContentXMLFooter "</FILTERS>$\r$\n"
-
-
-
-
-
-
-
-
-
-
-
- StrCpy $SnifferAVXMLContent ""
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent<FILTER>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent <FILENAME>"$localINSTDIR\SNFClient.exe"</FILENAME>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent <PARAMETERS></PARAMETERS>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent <RETURNVALUES>20,21,22,23,2,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70</RETURNVALUES>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent <DELETECHECK>0</DELETECHECK>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent <EXECTYPE>0</EXECTYPE>$\r$\n"
- StrCpy $SnifferAVXMLContent "$SnifferAVXMLContent</FILTER>$\r$\n"
-
-
-
-
-
-
-
- StrCpy $didWeOutput "0"
-
- FileOpen $IceWarpAdjustedFileHandle "$IceWarpInstallFolder\config\scanNEW.dat" w
- clearerrors
- IfFileExists "$IceWarpInstallFolder\config\scan.dat" 0 DoneReadingContentFile
-
- FileOpen $IceWarpContentFileHandle "$IceWarpInstallFolder\config\scan.dat" r
- iferrors 0 ReadForProperyHeaderedFilterFile
-
- Goto DoneReadingContentFile
-
-
-
- ReadForProperyHeaderedFilterFile:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingEmptyFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILTERS>" "E+1}" $WordFindResults
- ifErrors 0 ProperlyHeaderedFile
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadForProperyHeaderedFilterFile
- ProperlyHeaderedFile:
-
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
-
- FileWrite $IceWarpAdjustedFileHandle $SnifferAVXMLContent
- StrCpy $didWeOutput "1"
-
-
-
- ReadContentLine:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundFilterMarker
-
-
- ${WordFind} $IceWarpContentXMLlinedata "</FILTERS>" "E+1}" $WordFindResults
- ifErrors NotEndingYet 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto DoneReadingContentFile
- NotEndingYet:
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ReadContentLine
- FoundFilterMarker:
-
-
-
-
- StrCpy $TempFilterXML $IceWarpContentXMLlinedata
- LookForTitle:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- ${WordFind} $IceWarpContentXMLlinedata "<FILENAME>" "E+1}" $WordFindResults
- ifErrors 0 FoundTitleMarker
- StrCpy $TempFilterXML "$TempFilterXML$IceWarpContentXMLlinedata"
- Goto LookForTitle
- FoundTitleMarker:
-
-
- ${WordFind} $IceWarpContentXMLlinedata "SNFClient.exe" "E+1}" $WordFindResults
- ifErrors 0 FoundSnifferSection
- FileWrite $IceWarpAdjustedFileHandle $TempFilterXML
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- StrCpy $TempFilterXML ""
- Goto ReadContentLine
-
- FoundSnifferSection:
-
- LookForCloseFilter:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFileWithErrors 0
- ${WordFind} $IceWarpContentXMLlinedata "</FILTER>" "E+1}" $WordFindResults
- ifErrors 0 FoundCloseFilterMarker
- Goto LookForCloseFilter
- FoundCloseFilterMarker:
-
-
-
-
- ContinueDumpingFileLines:
- FileRead $IceWarpContentFileHandle $IceWarpContentXMLlinedata
- ifErrors DoneReadingContentFile 0
- FileWrite $IceWarpAdjustedFileHandle $IceWarpContentXMLlinedata
- Goto ContinueDumpingFileLines
-
-
- DoneReadingEmptyFile:
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLHeader
- FileWrite $IceWarpAdjustedFileHandle $SnifferAVXMLContent
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLFooter
- StrCpy $didWeOutput "1"
-
-
-
- DoneReadingContentFile:
-
- StrCmp $didWeOutput "0" 0 SkipOutputThisTime
-
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLHeader
- FileWrite $IceWarpAdjustedFileHandle $SnifferAVXMLContent
- FileWrite $IceWarpAdjustedFileHandle $ContentXMLFooter
- SkipOutputThisTime:
-
-
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- StrCpy $IceWarpContentXMLlinedata ""
-
-
-
-
-
-
-
-
-
-
- ${GetTime} "" "L" $var1 $var2 $var3 $var4 $var5 $var6 $var7
- ifFileExists "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml" 0 +2
- Delete "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scan.dat" "$IceWarpInstallFolder\config\scandat_InstallLOG_$var1-$var2-$var4.xml"
- Rename "$IceWarpInstallFolder\config\scanNEW.dat" "$IceWarpInstallFolder\config\scan.dat"
- Return
-
- DoneReadingContentFileWithErrors:
- FileClose $IceWarpContentFileHandle
- FileClose $IceWarpAdjustedFileHandle
- Delete "$IceWarpInstallFolder\config\scanNew.dat"
- MessageBox MB_OK "Attempting to edit XML in: $IceWarpInstallFolder\config\scan.dat resulted in finding a corrupted construction. Please check the new file, scan.dat, manually."
- Return
-
- UnableToFindContentFileXML:
- MessageBox MB_OK "Unable to find IceWarps scan.dat file from: $IceWarpInstallFolder\config\scan.dat You will have to tie-in manually with IceWarp."
- Return
-
- FunctionEND
-
-
-
-
-
-
-
-
-
- Function editXMLConfig
-
-
-
- ${handleShortPath} $ShortPathTempVar $INSTDIR
-
-
-
- Var /GLOBAL ConfigFileName
-
- StrCpy $ConfigFileName "snf_engine.xml"
- ifFileExists "$INSTDIR\snfmdplugin.xml" 0 +2
- StrCpy $ConfigFileName "snfmdplugin.xml"
-
-
- ${GetBetween} "<node identity='" "'>" "$INSTDIR\$ConfigFileName" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\$ConfigFileName" "<node identity='$R0'>" "<node identity='$ShortPathTempVar\identity.xml'>"
- ClearErrors
-
- ${GetBetween} "<log path='" "'/>" "$INSTDIR\$ConfigFileName" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\$ConfigFileName" "<log path='$R0'/>" "<log path='$ShortPathTempVar\'/>"
- ClearErrors
- ${GetBetween} "<rulebase path='" "'/>" "$INSTDIR\$ConfigFileName" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\$ConfigFileName" "<rulebase path='$R0'/>" "<rulebase path='$ShortPathTempVar\'/>"
- ClearErrors
- ${GetBetween} "<workspace path='" "'/>" "$INSTDIR\$ConfigFileName" "$R0"
- !insertmacro ReplaceInFile "$INSTDIR\$ConfigFileName" "<workspace path='$R0'/>" "<workspace path='$ShortPathTempVar\'/>"
- ClearErrors
-
-
- ${GetBetween} "<network>" "</network>" "$INSTDIR\$ConfigFileName" "$R0"
- FileOpen $R1 "tempNetworkFile.txt" w
- FileWrite $R1 $R0
- FileClose $R1
-
- ${GetBetween} "<update-script on-off='" "'" "$INSTDIR\tempNetworkFile.txt" "$R4"
- StrCmp $R4 "" OutputEntireString 0
-
-
-
-
-
-
-
-
- ${GetBetween} "<update-script" "/>" "$INSTDIR\tempNetworkFile.txt" "$R0"
- StrCmp $R0 "" OutputEntireString 0
-
-
- StrCpy $R6 "<update-script on-off='$R4' call='$ShortPathTempVar\getRulebase.cmd' guard-time='180'/>"
-
-
-
- !insertmacro ReplaceInFile "$INSTDIR\$ConfigFileName" "<update-script$R0/>" "$R6"
- ClearErrors
- Delete "$INSTDIR\tempNetworkFile.txt"
- Return
- OutputEntireString:
-
- StrCpy $R6 "<update-script on-off='$AUTO_UPDATE_ONOFF_FLAG' call='$ShortPathTempVar\getRulebase.cmd' guard-time='180'/>"
-
-
-
-
- Push "</network>"
- Push "$R6$\r$\n</network>"
- Push 0
- Push 1
- Push "$INSTDIR\$ConfigFileName"
- Call AdvReplaceInFile
-
- Delete "$INSTDIR\tempNetworkFile.txt"
- Return
- FunctionEnd
-
-
-
-
-
- Function .onInit
-
-
-
- System::Call 'kernel32::CreateMutexA(i 0, i 0, t "Message Sniffer") i .r1 ?e'
- Pop $R0
- StrCmp $R0 0 +3
- MessageBox MB_OK|MB_ICONEXCLAMATION "The Message Sniffer installer is already running."
- Abort
-
-
-
-
-
-
- IfFileExists "$EXEDIR\LocalRoot.txt" 0 EndGracefully
- ${GetBetween} '<root>' '</root>' "$EXEDIR\LocalRoot.txt" $SNFServerInstallDir
- ${GetBetween} '<cd>' '</cd>' "$EXEDIR\LocalRoot.txt" $INSTDIR
- Goto ContinueInstall
-
- EndGracefully:
- MessageBox MB_OK "Unable to resolve the local root installation directory for the mail server. Ending Installer."
- Quit
-
- ContinueInstall:
-
-
-
-
-
-
-
-
-
- IfFileExists "$INSTDIR\identity.xml" 0 TryAgain2
- ${GetBetween} "licenseid='" "'" "$INSTDIR\identity.xml" $LicenseID
- ${GetBetween} "authentication='" "'" "$INSTDIR\identity.xml" $Authentication
- Goto MakeNew
- TryAgain2:
-
- IfFileExists "$SNFServerInstallDir\SNFRollback\identity.xml" 0 MakeNew
- ${GetBetween} "licenseid='" "'" "$SNFServerInstallDir\SNFRollback\identity.xml" $LicenseID
- ${GetBetween} "authentication='" "'" "$SNFServerInstallDir\SNFRollback\identity.xml" $Authentication
-
- MakeNew:
-
-
-
- StrCpy $UnpackedCURLStuff "0"
- StrCpy $InstallerCompletedRestore "0"
- StrCpy $DownloadFailed "0"
-
-
-
-
-
-
-
-
- ${GetOptions} $CommandLineParameters "-F" $R0
-
- IfErrors RetainExistingConfig IgnoreExistingConfig
- RetainExistingConfig:
- StrCpy $RetainExistingSettings "1"
-
- ifFileExists "$INSTDIR\snfmdplugin.xml" 0 +2
- CopyFiles /SILENT "$INSTDIR\snfmdplugin.xml" "$TEMP\snfmdplugin.xml"
-
- ifFileExists "$INSTDIR\snf_engine.xml" 0 Defaults
- CopyFiles /SILENT "$INSTDIR\snf_engine.xml" "$TEMP\snf_engine.xml"
-
- Goto Defaults
-
- IgnoreExistingConfig:
- StrCpy $RetainExistingSettings "0"
-
- Defaults:
-
-
-
-
-
-
-
-
-
-
-
- Var /GLOBAL localSRS_RollbackPath
- ReadRegStr $localSRS_RollbackPath HKLM "Software\MessageSniffer" "SRS_RollbackPath"
- ifErrors 0 SkipBlocking
- ifFileExists "$INSTDIR\snf2check.exe" 0 +2
- WriteRegStr HKLM "Software\MessageSniffer" "BlockFullUninstall" "1"
- ifFileExists "$INSTDIR\mingwm10.dll" 0 +2
- WriteRegStr HKLM "Software\MessageSniffer" "BlockFullUninstall" "1"
- ifFileExists "$INSTDIR\SNFClient.exe" 0 +2
- WriteRegStr HKLM "Software\MessageSniffer" "BlockFullUninstall" "1"
- SkipBlocking:
-
-
- ReadRegStr $1 HKLM "Software\MessageSniffer" "SRS_LogName"
-
- StrCmp $localSRS_RollbackPath "" NoPreRoll 0
- StrCmp $1 "" NoPreRoll 0
-
-
-
- Call stopSNFServer
- Call stopXYNTService
-
-
-
- Var /GLOBAL OLD_INSTALL_DIR
- ReadRegStr $OLD_INSTALL_DIR HKLM "Software\MessageSniffer" "Install_Dir"
-
-
-
- IfFileExists "$OLD_INSTALL_DIR\XYNTService.exe" 0 +2
- nsExec::Exec "$OLD_INSTALL_DIR\XYNTService -u" "" SH_HIDE
-
-
-
-
-
-
-
-
-
-
-
-
- Var /GLOBAL localSRS_INSTDIR
- Var /GLOBAL localSRS_SERVDIR
- ReadRegStr $localSRS_INSTDIR HKLM "Software\MessageSniffer" "SRS_INSTDIR"
- ReadRegStr $localSRS_SERVDIR HKLM "Software\MessageSniffer" "localSRS_SERVDIR"
-
- ${RollBackTo} $localSRS_RollbackPath $1
- RMDir /r $localSRS_RollbackPath
-
-
-
- ifFileExists "$localSRS_INSTDIR\SNFClient.exe" SkipNow 0
- ifFileExists "$localSRS_INSTDIR\Restorer.exe" 0 +2
- Delete "$localSRS_INSTDIR\Restorer.exe"
- ifFileExists "$localSRS_INSTDIR\oldsnifferversion.txt" 0 +2
- Delete "$localSRS_INSTDIR\oldsnifferversion.txt"
- ifFileExists "$localSRS_INSTDIR\getRulebase.cmd.old" 0 +2
- Delete "$localSRS_INSTDIR\getRulebase.cmd.old"
- ifFileExists "$localSRS_INSTDIR\shortcuts.xml" 0 +2
- Delete "$localSRS_INSTDIR\shortcuts.xml"
- ifFileExists "$localSRS_INSTDIR\cfgstring.xml" 0 +2
- Delete "$localSRS_INSTDIR\cfgstring.xml"
- ifFileExists "$localSRS_INSTDIR\XYNTService.ini" 0 +2
- Delete "$localSRS_INSTDIR\XYNTService.ini"
- ifFileExists "$localSRS_INSTDIR\LocalRoot.txt" 0 +2
- Delete "$localSRS_INSTDIR\LocalRoot.txt"
- ifFileExists "$localSRS_INSTDIR\SNFServer${SNIFFER_SERVER_SPECIFIER}.exe" 0 +2
- Delete "$localSRS_INSTDIR\SNFServer${SNIFFER_SERVER_SPECIFIER}.exe"
- ifFileExists "$localSRS_INSTDIR\UpdateReady.txt" 0 +2
- Delete "$localSRS_INSTDIR\UpdateReady.txt"
- ifFileExists "$localSRS_INSTDIR\mingwm10.dll" 0 +2
- Delete "$localSRS_INSTDIR\mingwm10.dll"
- Delete "$localSRS_INSTDIR\uninstall.exe"
-
-
-
- ifFileExists "$localSRS_SERVDIR\SNFIMailShimNEW.xml" 0 +2
- Delete "$localSRS_SERVDIR\SNFIMailShimNEW.xml"
- ifFileExists "$localSRS_SERVDIR\SNFIMailShim.xml" 0 +2
- Delete "$localSRS_SERVDIR\SNFIMailShim.xml"
- ifFileExists "$localSRS_SERVDIR\SNFIMailShim.exe" 0 +2
- Delete "$localSRS_SERVDIR\SNFIMailShim.exe"
- ifFileExists "$localSRS_SERVDIR\MIMIMIreadme.txt" 0 +2
- Delete "$localSRS_SERVDIR\MIMIMIreadme.txt"
- ifFileExists "$localSRS_SERVDIR\OLD_SNFIMailShim.exe" 0 +2
- Delete "$localSRS_SERVDIR\OLD_SNFIMailShim.exe"
- ifFileExists "$localSRS_SERVDIR\OLD_SNFIMailShim.xml" 0 +2
- Delete "$localSRS_SERVDIR\OLD_SNFIMailShim.xml"
-
- ifFileExists "$localSRS_SERVDIR\snfmdplugin.dll" 0 +2
- Delete "$localSRS_SERVDIR\snfmdplugin.dll"
- ifFileExists "$localSRS_SERVDIR\snfmdplugin.xml" 0 +2
- Delete "$localSRS_SERVDIR\snfmdplugin.xml"
-
-
-
-
-
-
-
-
-
- SkipNow:
-
-
- Goto NoPreRoll
-
- NoPreRoll:
-
-
-
-
-
- !insertmacro StartRollbackSession "$SNFServerInstallDir\SNFRollBack" "Archive_rllbck.log" "HKLM" "Software\MessageSniffer"
-
-
-
-
-
-
-
-
-
-
-
-
- SetOutPath $INSTDIR
-
-
-
- ${SetRegistry_with_RollbackControl} "HKLM" "Software\MessageSniffer" "Install_Dir" "$INSTDIR"
- ${SetRegistry_with_RollbackControl} "HKLM" "Software\MessageSniffer" "SNFMailServer_DIR" "$SNFServerInstallDir"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ifFileExists "$INSTDIR\shortcuts.xml" 0 SkipShortCutRollback
- ${Copy_with_RollbackControl} "shortcuts.xml" "$INSTDIR" "" ""
- SkipShortCutRollback:
-
- Call removeShortcuts
- Return
-
-
-
-
-
- PerformRollback:
-
- return
-
-
- Call stopSNFServer
- Call stopXYNTService
-
-
-
-
-
- ${RollBackTo} "$SNFServerInstallDir\SNFRollBack" "Archive_rllbck.log"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MessageBox MB_OK "Stubbed Code. This should never run."
-
-
- IfFileExists "$SNFServerInstallDir\SNFRollback\shortcuts.xml" 0 RemoveTheShortcuts
-
-
- SetShellVarContext all
-
- CreateDirectory "$SMPROGRAMS\MessageSniffer"
- CreateShortCut "$SMPROGRAMS\MessageSniffer\InstallInstructions.lnk" "$INSTDIR\InstallInstructions.txt"
- CreateShortCut "$SMPROGRAMS\MessageSniffer\MessageSniffer.lnk" "http://kb.armresearch.com/index.php?title=Message_Sniffer"
- CreateShortCut "$SMPROGRAMS\MessageSniffer\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
- CreateShortCut "$SMPROGRAMS\MessageSniffer\GBUdbIgnoreList.lnk" "$INSTDIR\GBUdbIgnoreList.txt"
- Goto SkipShortcuts
- RemoveTheShortcuts:
-
- Call removeShortCuts
- SkipShortcuts:
-
-
-
-
-
-
- MessageBox MB_OK "Stubbed Code. This should never run."
- call editXYNTServiceINI
-
-
- nsExec::Exec "XYNTService -u" "" SH_HIDE
-
- nsExec::Exec "XYNTService -i" "" SH_HIDE
- nsExec::Exec "XYNTService -r" "" SH_HIDE
-
- call startSNFServer
-
- call onRestoreSuccess
- Quit
-
- FunctionEnd
-
-
-
- Section "MessageSniffer (required)"
-
- SectionIN RO
-
- SetOutPath $INSTDIR
-
-
- Call stopSNFServer
- Call stopXYNTService
-
-
-
-
-
- Var /GLOBAL isMDaemonInstalled
- StrCpy $isMDaemonInstalled 0
- ifFileExists "$SNFServerInstallDir\App\MDaemon.exe" 0 NoDetectableMDaemon
- ifFileExists "$SNFServerInstallDir\SpamAssassin\rules\*.*" 0 NoDetectableMDaemon
- StrCpy $isMDaemonInstalled 1
-
-
-
-
-
- SetOutPath "$INSTDIR"
- ${Install_with_RollbackControl} "InstallInstructions_MDaemon.txt" "" ""
- ${Install_with_RollbackControl} "snfmdplugin.dll" "" ""
- SetOutPath "$SNFServerInstallDir\SpamAssassin\rules"
- ${Install_with_RollbackControl} "snf-groups.cf" "" ""
-
-
- SetOutPath "$SNFServerInstallDir\App"
- ifFileExists "$SNFServerInstallDir\App\Plugins.dat" 0 NewPluginsDatFile
-
- ${Copy_with_RollbackControl} "Plugins.dat" "$SNFServerInstallDir\App" "restoreMDaemonDAT" ""
- Goto DoneWithPluginsDatFile
- NewPluginsDatFile:
-
- ${Install_with_RollbackControl} "Plugins.dat" "restoreMDaemonDAT" ""
- DoneWithPluginsDatFile:
- SetOutPath "$INSTDIR"
-
- NoDetectableMDaemon:
- SetOutPath "$INSTDIR"
-
-
- ${Install_with_RollbackControl} "CURLREADME.rtf" "" ""
- ${Install_with_RollbackControl} "CURLMANUAL.rtf" "" ""
-
- ${Install_with_RollbackControl} "AuthenticationProtocol.swf" "" ""
-
- ${Install_with_RollbackControl} "ChangeLog.txt" "" ""
-
-
-
-
-
-
-
-
-
-
-
-
- ${Install_with_RollbackControl} "License.txt" "" ""
-
- ${Install_with_RollbackControl} "SNFClient.exe" "" ""
-
- ${Install_with_RollbackControl} "SNFClient_readme.txt" "" ""
-
- ${Install_with_RollbackControl} "mingwm10.dll" "" ""
-
-
-
- StrCmp $isMDaemonInstalled 0 0 SkipForMDaemon1
- SetOutPath "$INSTDIR"
-
- ${Install_with_RollbackControl} "exchndl.dll" "" ""
-
- ${Install_with_RollbackControl} "send_shutdown.cmd" "" ""
-
- ${Install_with_RollbackControl} "snf_xci.xml" "" ""
-
- ${Install_with_RollbackControl} "SNFServer_readme.txt" "" ""
-
- ${Install_with_RollbackControl} "SNFServer${SNIFFER_SERVER_SPECIFIER}.exe" "" ""
-
- ${Install_with_RollbackControl} "SNFServer.exe" "" ""
-
-
- ${Install_with_RollbackControl} "XYNTService.exe" "" ""
-
- ${Install_with_RollbackControl} "XYNTService.ini" "restoreXYNTini" ""
-
- ${Install_with_RollbackControl} "XYNTServiceReadMe.txt" "" ""
-
- ${Install_with_RollbackControl} "InstallInstructions.txt" "" ""
-
- SkipForMDaemon1:
- SetOutPath "$INSTDIR"
-
- ${Install_with_RollbackControl} "GBUdbIgnoreList.txt" "" ""
-
- ${Install_with_RollbackControl} "identity.xml" "" ""
-
-
-
-
-
- SetOutPath "$INSTDIR"
- StrCmp $RetainExistingSettings "0" FreshSNFEngine HandleRetainingSNFENGINEFILE
-
- FreshSNFEngine:
-
-
-
- StrCmp $isMDaemonInstalled 0 DoWinService DoMDaemonFreshInstead
- DoWinService:
- ${Install_with_RollbackControl} "snf_engine.xml" "" ""
- Goto DoneWithSNFHandling
-
- DoMDaemonFreshInstead:
- ${Install_with_RollbackControl} "snfmdplugin.xml" "" ""
- Goto DoneWithSNFHandling
-
- HandleRetainingSNFENGINEFILE:
-
-
-
-
-
-
-
-
-
- StrCmp $isMDaemonInstalled 0 DoWinServiceRetaining DoMDaemonRetainingInstead
- DoWinServiceRetaining:
-
- ifFileExists "$TEMP\snf_engine.xml" 0 NotInTempDir
-
- CopyFiles "$TEMP\snf_engine.xml" "$INSTDIR\snf_engine.xml"
- NotInTempDir:
- ifFileExists "$INSTDIR\snf_engine.xml" 0 FreshSNFEngine
-
- ${Copy_with_RollbackControl} "snf_engine.xml" $INSTDIR "" ""
- Delete "$TEMP\snf_engine.xml"
- Goto DoneWithSNFHandling
-
- DoMDaemonRetainingInstead:
- ifFileExists "$TEMP\snfmdplugin.xml" 0 NotInTempDir2
- CopyFiles "$TEMP\snfmdplugin.xml" "$INSTDIR\snfmdplugin.xml"
- NotInTempDir2:
- ifFileExists "$INSTDIR\snfmdplugin.xml" 0 FreshSNFEngine
- ${Copy_with_RollbackControl} "snfmdplugin.xml" $INSTDIR "" ""
-
- Delete "$TEMP\snf_engine.xml"
- Goto DoneWithSNFHandling
-
-
-
- DoneWithSNFHandling:
-
-
- StrCmp $RetainExistingSettings "1" 0 callEdits
- ifFileExists "$SNFServerInstallDir\SNFRollback\snfmdplugin.xml" 0 +2
- CopyFiles /SILENT "$SNFServerInstallDir\SNFRollback\snfmdplugin.xml" "$INSTDIR\snfmdplugin.xml"
-
- ifFileExists "$SNFServerInstallDir\SNFRollback\getRulebase.cmd" 0 +2
- CopyFiles /SILENT "$SNFServerInstallDir\SNFRollback\getRulebase.cmd" "$INSTDIR\getRulebase.cmd"
-
-
-
- ifFileExists "$SNFServerInstallDir\SNFRollback\GBUdbIgnoreList.txt" 0 +2
- CopyFiles /SILENT "$SNFServerInstallDir\SNFRollback\GBUdbIgnoreList.txt" "$INSTDIR\GBUdbIgnoreList.txt"
-
-
- ifFileExists "$SNFServerInstallDir\SNFRollback\identity.xml" 0 +2
- CopyFiles /SILENT "$SNFServerInstallDir\SNFRollback\identity.xml" "$INSTDIR\identity.xml"
-
-
- callEdits:
-
- Call editGetRulebase
- Call editLicenseFile
-
- ifFileExists "$SNFServerInstallDir\App\MDaemon.exe" 0 +2
- Call editMDPluginsFile
-
-
-
-
-
-
-
- ifFileExists "$SNFServerInstallDir\global.cfg" 0 SkipDeclude_Special
-
- ${Copy_with_RollbackControl} "global.cfg" $SNFServerInstallDir "restoreGLOBALcfg" ""
- call editglobalCFG
- SkipDeclude_Special:
-
-
- ifFileExists "$SNFServerInstallDir\mxGuard.ini" 0 SkipMXGuard_Special
-
- ${Copy_with_RollbackControl} "mxGuard.ini" $SNFServerInstallDir "restoreMXGUARDini" ""
- call editMXGuardINI
- SkipMXGuard_Special:
-
-
- ifFileExists "$SNFServerInstallDir\SNF4Alligate.exe" 0 SkipAlligate_Special
-
-
- SkipAlligate_Special:
-
-
- ifFileExists "$SNFServerInstallDir\config\content.xml" 0 SkipIceWarp_Special
-
-
- call editContentXML
- SkipIceWarp_Special:
-
-
-
-
-
-
-
-
- StrCmp $RetainExistingSettings "1" 0 JustUseAllNewFiles
-
-
-
-
-
- ifFileExists "$INSTDIR\snfmdplugin.xml" UseMDaemonXMLFIle UseStdSNFEngineFile
-
- UseMDaemonXMLFIle:
-
- ${GetBetween} "<update-script on-off='" "'" "$INSTDIR\snfmdplugin.xml" "$AUTO_UPDATE_ONOFF_FLAG"
-
- StrCmp $AUTO_UPDATE_ONOFF_FLAG "" 0 adjustFileNow
- StrCpy $AUTO_UPDATE_ONOFF_FLAG "off"
- goto adjustFileNow
- UseStdSNFEngineFile:
- ${GetBetween} "<update-script on-off='" "'" "$INSTDIR\snf_engine.xml" "$AUTO_UPDATE_ONOFF_FLAG"
- StrCmp $AUTO_UPDATE_ONOFF_FLAG "" 0 adjustFileNow
- StrCpy $AUTO_UPDATE_ONOFF_FLAG "off"
-
-
- adjustFileNow:
- Call editXMLConfig
- Goto DoneWithFiles
-
- JustUseAllNewFiles:
-
- StrCpy $AUTO_UPDATE_ONOFF_FLAG "on"
- Call editXMLConfig
-
-
- DoneWithFiles:
-
-
- ${IF} $OpenGBUIgnoreFileOnClose == 1
- ExecWait '"notepad.exe" "$INSTDIR\GBUdbIgnoreList.txt"'
- ${ENDIF}
-
-
-
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MessageSniffer" "DisplayName" "Message Sniffer"
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MessageSniffer" "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MessageSniffer" "NoModify" 1
- WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MessageSniffer" "NoRepair" 1
- SetOutPath $INSTDIR
- ifFileExists "$INSTDIR\uninstall.exe" 0 +2
- ${Copy_with_RollbackControl} "uninstall.exe" "$INSTDIR" "" ""
- WriteUninstaller "uninstall.exe"
-
-
-
-
- ifFileExists "$INSTDIR\snfmdplugin.xml" SkipAllServiceRelatedCalls RunServiceWrapperInstallMethods
-
- RunServiceWrapperInstallMethods:
- call editXYNTServiceINI
-
- nsExec::Exec "$INSTDIR\XYNTService -u" "" SH_HIDE
-
- nsExec::Exec "$INSTDIR\XYNTService -i" "" SH_HIDE
- nsExec::Exec "$INSTDIR\XYNTService -r" "" SH_HIDE
- call startSNFServer
-
- SkipAllServiceRelatedCalls:
-
-
-
- ${EndRollbackSession} "HKLM" "Software\MessageSniffer"
-
-
- SectionEnd
-
-
-
-
-
- Section "Start Menu Shortcuts"
- SetOutPath $INSTDIR
- VAR /GLOBAL FileHandle
-
-
- FileOpen $FileHandle "$INSTDIR\shortcuts.xml" w
- FileWrite $FileHandle "<snf><shortcuts>1</shortcuts></snf>"
- FileClose $FileHandle
-
- SetShellVarContext all
-
- CreateDirectory "$SMPROGRAMS\MessageSniffer"
- ifFileExists "$INSTDIR\snfmdplugin.dll" 0 InstallNormalInstructions
- CreateShortCut "$SMPROGRAMS\MessageSniffer\InstallInstructions.lnk" "$INSTDIR\InstallInstructions_MDaemon.txt"
- Goto AddSiteLink
- InstallNormalInstructions:
- CreateShortCut "$SMPROGRAMS\MessageSniffer\InstallInstructions.lnk" "$INSTDIR\InstallInstructions.txt"
- AddSiteLink:
- CreateShortCut "$SMPROGRAMS\MessageSniffer\MessageSniffer.lnk" "http://www.armresearch.com/"
- CreateShortCut "$SMPROGRAMS\MessageSniffer\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
- CreateShortCut "$SMPROGRAMS\MessageSniffer\GBUdbIgnoreList.lnk" "$INSTDIR\GBUdbIgnoreList.txt"
- SectionEnd
-
-
-
-
-
-
-
-
-
- Function un.Restore
- !insertmacro BIMAGE "SnifferStop.bmp" ""
-
- SendMessage $HWNDPARENT ${WM_SETTEXT} 0 "STR:Uninstall Message Sniffer Server 3.0:"
-
-
- nsDialogs::Create /NOUNLOAD 1018
- Pop $0
-
-
- VAR /GLOBAL DeleteArchives
- StrCpy $DeleteArchives "0"
-
- ${NSD_CreateLabel} 0 10% 100% 40u "You are now going to uninstall the current working version of Message Sniffer. You may use the Message Sniffer Install Utility to Restore from a previous archived version, if you choose to not remove all archived folders. If you choose to remove all archives, this operation cannot be undone."
- Pop $0
-
-
- ${NSD_CreateCheckbox} 0 50% 100% 20 "Check this if you want to remove all archived Message Sniffer folders."
- Pop $CHECKBOX
- GetFunctionAddress $0 un.ToggleRestore
- nsDialogs::OnClick /NOUNLOAD $CHECKBOX $0
- nsDialogs::Show
- FunctionEnd
-
- Function un.BeSure
- StrCpy $5 "This operation will remove the current restore/rollback of Message Sniffer from the Server 3.0 install."
- StrCmp $DeleteArchives "1" 0 +2
- StrCpy $5 "You have chosen to destroy your rollback files as well THE ROLLBACK ARCHIVE WILL BE DELETED. This operation cannot be undone."
- MessageBox MB_YESNO "Are you sure? $5" IDYES true IDNO false
- true:
- Return
- false:
- Abort
- FunctionEnd
-
- Function un.ToggleRestore
-
- Pop $0
- StrCmp $DeleteArchives "1" 0 ToggleStuff
- StrCpy $DeleteArchives "0"
-
- Push $0
- GetTempFileName $0
- File /oname=$0 "SnifferStop.bmp"
- SetBrandingImage "" $0
- Delete $0
- Pop $0
-
- Return
-
- ToggleStuff:
- StrCpy $DeleteArchives "1"
- Push $0
- GetTempFileName $0
- File /oname=$0 "SnifferStop2.bmp"
- SetBrandingImage "" $0
- Delete $0
- Pop $0
- FunctionEnd
-
- Function un.RemoveSNF4Alligate
-
-
-
- Var /GLOBAL uninstallAlligate
- ReadRegStr $uninstallAlligate HKLM "Software\MessageSniffer" "isSNF4AlligateInstalled"
- StrCmp $uninstallAlligate "1" 0 NoAlligateHere
-
-
-
- Var /GLOBAL UninstallAlligateFolder
- Var /GLOBAL AlligateDelivery_Setting
- Var /GLOBAL currentAlligateTarget
- ReadRegStr $currentAlligateTarget HKLM "Software\SolidOak\Aligate\Settings" "FilterEXE"
- StrCmp $currentAlligateTarget "SNF4Alligate.exe" 0 SkipFilterExeAdustment
-
-
-
- ReadRegStr $UninstallAlligateFolder HKLM "Software\MessageSniffer" "SNF4AlligateInstallFolder"
-
-
-
-
- ifFileExists "$UninstallAlligateFolder\SNF4Alligate.xml" 0 NoXMLFile
-
-
- ${un.GetBetween} "<delivery program='" "'/>$\r$\n" "$UninstallAlligateFolder\SNF4Alligate.xml" "$AlligateDelivery_Setting"
- ${Switch} $AlligateDelivery_Setting
- ${Case} ""
- ExecWait 'net stop AGFILTSVC'
- ExecWait '$UninstallAlligateFolder\AGFiltSvc.exe /uninstall'
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "DropDir" "\Spool"
- goto doneResolvingAlligateDeliverySetting
- ${Case} "none"
- ExecWait 'net stop AGFILTSVC'
- ExecWait '$UninstallAlligateFolder\AGFiltSvc.exe /uninstall'
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "DropDir" "\Spool"
- goto doneResolvingAlligateDeliverySetting
- ${Case} "NONE"
- ExecWait 'net stop AGFILTSVC'
- ExecWait '$UninstallAlligateFolder\AGFiltSvc.exe /uninstall'
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "DropDir" "\Spool"
- goto doneResolvingAlligateDeliverySetting
- ${Case} "None"
- ExecWait 'net stop AGFILTSVC'
- ExecWait '$UninstallAlligateFolder\AGFiltSvc.exe /uninstall'
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "DropDir" "\Spool"
- goto doneResolvingAlligateDeliverySetting
- ${Case} "SNF4Aligate"
- ExecWait 'net stop AGFILTSVC'
- ExecWait '$UninstallAlligateFolder\AGFiltSvc.exe /uninstall'
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "DropDir" "Spool\"
- goto doneResolvingAlligateDeliverySetting
- ${Default}
- ExecWait 'net stop AGFILTSVC'
- MessageBox MB_OK "SNF4Alligate was set to hand messages downstream to $AlligateDelivery_Setting. The Uninstaller will try to restore the FilterEXE registry value to maintain the rest of the filter-call chain. Please confirm and test this before you're done with your settings."
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" "$AlligateDelivery_Setting."
- ExecWait 'net start AGFILTSVC'
-
- goto doneResolvingAlligateDeliverySetting
- ${EndSwitch}
-
- NoXMLFile:
-
-
- WriteRegStr HKLM "SOFTWARE\SolidOak\Alligate\Settings" "FilterEXE" ""
- doneResolvingAlligateDeliverySetting:
- SkipFilterExeAdustment:
-
- DeleteRegKey HKLM SOFTWARE\SolidOak\Alligate\Settings\Addins\MsgSniffer\ProcessDirHint
- DeleteRegKey HKLM SOFTWARE\SolidOak\Alligate\Settings\Addins\MsgSniffer\ProcessDir
- DeleteRegKey HKLM SOFTWARE\SolidOak\Alligate\Settings\Addins\MsgSniffer\ProcessDirLabel
-
-
-
- DeleteRegKey HKLM HKEY_LOCAL_MACHINE\SOFTWARE\MessageSniffer\isSNF4AlligateInstalled
- DeleteRegKey HKLM HKEY_LOCAL_MACHINE\SOFTWARE\MessageSniffer\SNF4AlligateInstallFolder
- DeleteRegKey HKLM HKEY_LOCAL_MACHINE\SOFTWARE\MessageSniffer\SNFMailServer_DIR
-
- ifFileExists "$UninstallAlligateFolder\SNF4Alligate.xml" 0 +2
- Delete "$UninstallAlligateFolder\SNF4Alligate.xml"
- ifFileExists "$UninstallAlligateFolder\SNF4Alligate.exe" 0 +2
- Delete "$UninstallAlligateFolder\SNF4Alligate.exe"
-
- ExecWait "net stop AgSMTPSvc"
- ExecWait "net start AgSMTPSvc"
-
- NoAlligateHere:
-
- return
- FunctionEnd
-
- Section "Uninstall"
-
-
-
-
-
-
- Call un.stopSNFServer
- Call un.UninstallXYNTService
-
- Var /GLOBAL localFileDirectory
- Var /GLOBAL uninstallRollbackPath
- Var /GLOBAL uninstallRollbackLogName
- Call un.removeShortcuts
-
-
- ReadRegStr $localFileDirectory HKLM "Software\MessageSniffer" "Install_Dir"
- ReadRegStr $uninstallRollbackPath HKLM "Software\MessageSniffer" "SRS_RollbackPath"
- ReadRegStr $uninstallRollbackLogName HKLM "Software\MessageSniffer" "SRS_LogName"
- ReadRegStr $SNFServerInstallDir HKLM "Software\MessageSniffer" "SNFMailServer_DIR"
-
-
-
-
-
- ${un.GetParent} $localFileDirectory $SNFServerInstallDir
-
-
-
- StrCmp $uninstallRollbackPath "" NoPreRoll 0
- StrCmp $uninstallRollbackLogName "" NoPreRoll 0
- StrCmp $uninstallRollbackPath "$SNFServerInstallDir\SNFRollBack" 0 NoPreRoll
-
- ${un.RollBackTo} $uninstallRollbackPath $uninstallRollbackLogName
-
-
- NoPreRoll:
-
-
-
-
- Var /GLOBAL UninstallMINIMIFolder
- Var /GLOBAL Delivery_Setting
- Var /GLOBAL Current_Send_setting
- Var /GLOBAL Current_UninstallTopDir
- ReadRegStr $0 HKLM "Software\MessageSniffer" "isMINIMIInstalled"
- StrCmp $0 "1" 0 ContinueWithRollback
- ReadRegStr $UninstallMINIMIFolder HKLM "Software\MessageSniffer" "MINIMIInstallFolder"
-
-
-
-
-
-
- ifFileExists "$UninstallMINIMIFolder\SNFIMailShim.xml" 0 ContinueWithRollback
-
- ReadRegStr $Current_Send_setting HKLM "SOFTWARE\Ipswitch\IMail\Global" "SendName"
- ReadRegStr $Current_UninstallTopDir HKLM "SOFTWARE\Ipswitch\IMail\Global" "TopDir"
- StrCmp "$Current_UninstallTopDir\SNFIMailShim.exe" $Current_Send_setting 0 IgnoreSendNameRollback
-
-
-
- ifFileExists "$UninstallMINIMIFolder\OLD_SNFIMailShim.xml" 0 ResetImail_WithCurrentMINIMIVALUE
-
- ${un.GetBetween} "<delivery program='" "'/>$\r$\n" "$UninstallMINIMIFolder\OLD_SNFIMailShim.xml" "$Delivery_Setting"
- Goto ResetImail
-
- ResetImail_WithCurrentMINIMIVALUE:
-
- ${un.GetBetween} "<delivery program='" "'/>$\r$\n" "$UninstallMINIMIFolder\SNFIMailShim.xml" "$Delivery_Setting"
- Goto ResetImail
-
- ResetImail:
-
- ClearErrors
- WriteRegStr HKLM "SOFTWARE\Ipswitch\IMail\Global" "SendName" "$Delivery_Setting"
- iferrors 0 IgnoreSendNameRollback
- MessageBox MB_OK "MINIMI was set to hand cleared messages downstream. The Uninstaller tried to restore the SendName registry value for IMail to: '$Delivery_Setting' but the write was rejected. Please save this value and manually reset the SendName parameter."
-
- IgnoreSendNameRollback:
-
-
- ifFileExists "$UninstallMINIMIFolder\OLD_SNFIMailShim.xml" 0 ContinueWithRollback
- ifFileExists "$UninstallMINIMIFolder\SNFIMailShim.xml" 0 +2
- Delete "$UninstallMINIMIFolder\SNFIMailShim.xml"
- CopyFiles /SILENT "$UninstallMINIMIFolder\OLD_SNFIMailShim.xml" "$UninstallMINIMIFolder\SNFIMailShim.xml"
-
- ifFileExists "$UninstallMINIMIFolder\OLD_SNFIMailShim.exe" 0 ContinueWithRollback
- ifFileExists "$UninstallMINIMIFolder\SNFIMailShim.exe" 0 +2
- Delete "$UninstallMINIMIFolder\SNFIMailShim.exe"
- CopyFiles /SILENT "$UninstallMINIMIFolder\OLD_SNFIMailShim.exe" "$UninstallMINIMIFolder\SNFIMailShim.exe"
- ContinueWithRollback:
-
-
-
- Call un.RemoveSNF4Alligate
-
-
- ifFileExists "$SNFServerInstallDir\config\content.xml" 0 +2
- Call un.editContentXML
-
-
-
-
-
-
-
- ifFileExists "$localFileDirectory\SNFClient.exe" LeaveNow 0
- ifFileExists "$localFileDirectory\Restorer.exe" 0 +2
- Delete "$localFileDirectory\Restorer.exe"
- ifFileExists "$localFileDirectory\oldsnifferversion.txt" 0 +2
- Delete "$localFileDirectory\oldsnifferversion.txt"
- ifFileExists "$localFileDirectory\getRulebase.cmd.old" 0 +2
- Delete "$localFileDirectory\getRulebase.cmd.old"
- ifFileExists "$localFileDirectory\shortcuts.xml" 0 +2
- Delete "$localFileDirectory\shortcuts.xml"
- ifFileExists "$localFileDirectory\cfgstring.xml" 0 +2
- Delete "$localFileDirectory\cfgstring.xml"
- ifFileExists "$localFileDirectory\XYNTService.ini" 0 +2
- Delete "$localFileDirectory\XYNTService.ini"
- ifFileExists "$localFileDirectory\LocalRoot.txt" 0 +2
- Delete "$localFileDirectory\LocalRoot.txt"
- ifFileExists "$localFileDirectory\SNFServer${SNIFFER_SERVER_SPECIFIER}.exe" 0 +2
- Delete "$localFileDirectory\SNFServer${SNIFFER_SERVER_SPECIFIER}.exe"
- ifFileExists "$localFileDirectory\UpdateReady.txt" 0 +2
- Delete "$localFileDirectory\UpdateReady.txt"
- ifFileExists "$localFileDirectory\mingwm10.dll" 0 +2
- Delete "$localFileDirectory\mingwm10.dll"
- Delete "$localFileDirectory\uninstall.exe"
- ifFileExists "$localFileDirectory\snfmdplugin.xml" 0 +2
- Delete "$localFileDirectory\snfmdplugin.xml"
- ifFileExists "$localFileDirectory\snfmdplugin.dll" 0 +2
- Delete "$localFileDirectory\snfmdplugin.dll"
- ifFileExists "$localFileDirectory\Plugins.dat" 0 +2
- Delete "$localFileDirectory\Plugins.dat"
- ifFileExists "$SNFServerInstallDir\SpamAssassin\rules\snf-groups.cf" 0 +2
- Delete "$SNFServerInstallDir\SpamAssassin\rules\snf-groups.cf"
-
- LeaveNow:
-
-
- DeleteRegKey HKLM SOFTWARE\MessageSniffer
-
- ifFileExists "$SNFServerInstallDir\SNFRollBack\*.*" 0 +2
- RMDir /r "$SNFServerInstallDir\SNFRollBack"
-
- Delete "$uninstallRollbackPath\$uninstallRollbackLogName"
-
-
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MessageSniffer"
-
-
- Return
-
-
-
-
-
-
- SectionEnd
-
-
- Function .onInstSuccess
- InitPluginsDir
- SetOutPath "$PLUGINSDIR"
-
- File "SuccessInstall.bmp"
- newadvsplash::show 5000 100 500 0x04025C "$PLUGINSDIR\SuccessInstall.bmp"
- Delete "$PLUGINSDIR\SuccessInstall.bmp"
-
- FunctionEnd
-
-
- Function onRestoreSuccess
-
- InitPluginsDir
- SetOutPath "$PLUGINSDIR"
-
- File "SuccessRestore.bmp"
- newadvsplash::show 5000 100 500 0x04025C "$PLUGINSDIR\SuccessRestore.bmp"
- Delete "$PLUGINSDIR\SuccessRestore.bmp"
-
- FunctionEnd
-
- Function un.onUninstSuccess
- SetOutPath $SNFServerInstallDir
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- InitPluginsDir
- SetOutPath "$PLUGINSDIR"
-
- File "SuccessUnInstall.bmp"
- newadvsplash::show 5000 100 500 0x04025C /NOCANCEL "$PLUGINSDIR\SuccessUnInstall.bmp"
- Delete "$PLUGINSDIR\SuccessUnInstall.bmp"
-
- MessageBox MB_OK " Uninstall Complete!$\r$\nThe uninstaller has rolled back any changes made during the last installation.$\r$\nThe uninstaller does not delete files that it did not create (such as log files).$\r$\nIf you want to delete these files you will probably find them in your install$\r$\nfolder located here: $SNFServerInstallDir"
-
-
- FunctionEnd
-
|