12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510 |
- !verbose 2
- !define TEMP1 $R0
- !define SNIFFER_SERVER_SPECIFIER "3.0"
-
-
-
-
-
-
-
- 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:
- 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 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 UnableToFindContentFileXML
- FileOpen $IceWarpContentFileHandle "$IceWarpInstallFolder\config\scan.dat" r
- iferrors 0 ReadForProperyHeaderedFilterFile
- MessageBox MB_OK "Unable to read IceWarps scan.dat file from: $IceWarpInstallFolder\config\scan.dat"
- 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
-
|