ricktendo Posted October 14, 2007 Posted October 14, 2007 I wrote this template to create a INF Uninstaller for those small apps that come in zip files and don't have any install/uninstallers. (feel free to ask questions and improve on it any way you like);ricktendo64 2007[Version]Signature="$CHICAGO$";Add this to your [Optional Componenets][Add This]AddReg=Uninstall.AddReg;Tells the INF what directory & sub-folder the [Program.Files] are located[DestinationDirs]Program.Files=16422,%PROG_DIR%;Adds option to "Add or Remove Programs"[Uninstall.AddDelReg]HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","DisplayIcon",0,"%16422%\%PROG_DIR%\Program.exe"HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","DisplayName",0,"%PROG_NAME%"HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","DisplayVersion",0,"%VERS%"HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","NoModify",0x10001,01,00,00,00HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","NoRepair",0x10001,01,00,00,00HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%PROG_NAME%","UninstallString",0,"rundll32.exe advpack.dll,LaunchINFSection %MAIN_INF%,Uninstall";Uninstall section that will be launched[Uninstall]BeginPrompt =BeginUnInsPromptRunPreSetupCommands =Close.Program:1 ;<- The ":1" Flag Hides the taskkill.exe CMD window (does not need to be in section name)DelFiles =Program.Files,PNF.FileDelDirs =Program.DirsProfileItems =Program.DelShortcutDelReg =Uninstall.AddDelRegUpdateInis =sysoc.EditEndPrompt =EndUnInsPromptRunPostSetupCommands=Dir.Delete,Launch.WebsiteCleanup =1;Closes program executable if running before uninstall[Close.Program]TASKKILL /F /IM Program.exe;for XP Home compatibility useTSKILL Program ;<- tskill fails if you add the file extention (bad example: tskill program.exe);Program files to delete, will not work without a DestinationDir[Program.Files]Program.exeProgram.iniShellExt.dll,,,1 ;The ",1" flag is used if the file is in use, so entries will be added to the registry to delete it on next boot.;Obsolote PNF file created during Windows Setup (Requires a entry in DestinationDirs example PNF.File=17)[PNF.File]addon.PNF;Deletes Start Menu shortcut using profileitems the secret is the ",0x00000002" flag (also used is 3 and 4)[Program.DelShortcut]Name =%PROG_NAME%,0x00000002SubDir=%SUB_DIR%;Removes addon entry from sysoc.inf so Cleanup=1 does not break Add/Rem Windows Components[sysoc.Edit]%17%\sysoc.inf,Componets,Whatever Is Under [Optional Components]=*;Deletes Program Folder (will only delete empty folder)[Program.Dirs]%16422%/%PROG_DIR%;Deletes Folders and files in them[Dir.Delete]rundll32.exe advpack.dll,DelNodeRunDLL32 %16422%\%PROG_DIR%,<flag>[Launch.Website]rundll32.exe url.dll,FileProtocolHandler [url="http://www.ryanvm.net/msfn/"]http://www.ryanvm.net/msfn/[/url];Uninstall Prompt[BeginUnInsPrompt]Title =%PROG_NAME% UninstallerPrompt =Are you sure you want to remove %PROG_NAME% from your computer?ButtonType=YESNO ;<- YESNO or OKCANC;Optional End Prompt (not really nessesary just tells you the uninstall was a success.)[EndUnInsPrompt]Prompt=%PROG_NAME% was successfully removed from your computer.;Here you tell the INF what all the variables are (Example: lets say %VAR% so under strings you add VAR=VARIABLE)[Strings]MAIN_INF ="Program.inf"PROG_DIR ="Program Folder"PROG_NAME="Program Name"SUB_DIR ="Start Menu Sub" Quote
trodas Posted April 15, 2008 Posted April 15, 2008 Thanks for this nice example.However I'm still not entierly clear on how to insert a exactly specified directory there. For example working on the IE uninstall ini file, at the very end I would like something like that:; delete whole IE directory[files.del.ie]rundll32.exe advpack.dll,DelNodeRunDLL32 %16422%\%"Internet Explorer"%,<flag>But it does not work. Could be the commas not welcome there? Quote
ricktendo Posted April 15, 2008 Author Posted April 15, 2008 try this[files.del.ie]rundll32.exe advpack.dll,DelNodeRunDLL32 %16422%\Internet Explorer,8You had some rougue percentages and a unspecified flag%16422%\%"Internet Explorer"%,<flag> Quote
LUZR4LIFE Posted April 16, 2008 Posted April 16, 2008 Cool, Rick. Question though. Has anyone shown any interest in wanting to learn .inf's? Quote
ricktendo Posted April 16, 2008 Author Posted April 16, 2008 Cool, Rick. Question though. Has anyone shown any interest in wanting to learn .inf's?Nope Quote
LUZR4LIFE Posted April 16, 2008 Posted April 16, 2008 LOL. People just love to have things handed to them. Quote
trodas Posted April 17, 2008 Posted April 17, 2008 Well, it does not work. Included the file, can you tell me, what I doing wrong?So, something in the % mean that this is a variable, defined elsewhere. So when I define it just in the place, then it is not need, okay. That is why I had there the add %. The flag I copy directly from your example. And should not be the Internet Explorer path in commas? It does contain a space, so I thought...And what the 8 at the end does mean?In the file I include are deleting files made this way:[DefaultInstall]DelFiles = files.del.sys[DestinationDirs]files.del.sys = 11[files.del.sys]actxprxy.dll, 1asctrls.ocx,,,1cdfview.dll,,,1...etc...But that only delete already known files and files in the defined directory too. When I want to remove whole dir wih bunch of files, well, that is a problem. How can do it, I don't know.But I would love to be able automatize my cleaning up of windows 2000 SP4 uninstall_IE.zip Quote
trodas Posted April 17, 2008 Posted April 17, 2008 True. Fixed. No difference, tough. Not sure where and when I caused this bug, tough.Any chances the deleting directory will work? Quote
trodas Posted June 4, 2008 Posted June 4, 2008 (edited) So, a little bump/help? How I delete directory?Using[DestinationDirs]files.del.ie = 16422,Internet Explorer[files.del.ie]11,,iexplore.exe, 111,,hmmapi.dll, 1Is possible to delete the files inside of the Internet Explorer dir, however not dirs and not the WHOLE IE directory as I very much want to do so.When I add this:rundll32.exe advpack.dll,DelNodeRunDLL32 16422\Internet Explorer...it does not work as well. Help? PS: rundll32.exe advpack.dll,DelNodeRunDLL32 C:\Program files\Internet Explorerfrom commandline it does delete the Internet Explorer dir, even with files inside. Same doest NOT do the shorter version:rundll32.exe advpack.dll,DelNodeRunDLL32 16422\Internet Explorer...probably because there is a difference between commandline and commands inside of the inf file... Both versions also does not work at all inside of the inf file Not even using it like this:[Dir.Delete]rundll32.exe advpack.dll,DelNodeRunDLL32 C:\Program files\Internet Explorer Edited June 4, 2008 by trodas Quote
ricktendo Posted June 4, 2008 Author Posted June 4, 2008 [Dir.Delete]rundll32.exe advpack.dll,DelNodeRunDLL32 """%16422%\Internet Explorer""",8 Quote
Kal Posted August 6, 2008 Posted August 6, 2008 Thanks for this layout Rick What does mean "Cleanup =1"? Quote
ricktendo Posted August 6, 2008 Author Posted August 6, 2008 Cleanup = 1 is how you can self delete the INF (if you do this you have to use UpdateInis to delete the entry from SYSOC.INF otherwize you will get an error when you try to launch add/rem windows components) Quote
Guest Posted September 6, 2008 Posted September 6, 2008 hello some sofware after frist run create option file or dat file to the some directory i need to create unistallsection for this example in SumatraPDF after frist run create (sumatrapdfprefs.dat)filein a C:\Documents and Settings\user\Application Data\SumatraPDFho to create unistall section for add to inf file for delete thissum.inf.rar Quote
ricktendo Posted September 7, 2008 Author Posted September 7, 2008 Just create a new section with that file and add it to DelFiles and DestinationDirs example:[DestinationDirs]CopySumraP = 16422,"Utilities\SumatraPDF"NewSectionName = 16410,"SumatraPDF" ; %userprofile%\Application Data\SumatraPDFDelFiles = CopySumraP,NewSectionName[NewSectionName]sumatrapdfprefs.datAnotherFileExample.extDont forget to add it to DestinationDirs, if not DelFiles will not work Quote
Guest Posted September 7, 2008 Posted September 7, 2008 very thankyou also for delfolder must add this %16410%\SumatraPDF" to[sumP.DelDirs]%16422%\Utilities\SumatraPDF"%16410%\SumatraPDF" Quote
DaddySam Posted December 24, 2008 Posted December 24, 2008 Thanks for very informative post.I have installed an inf and I am unable to "uninstall".My inf file contains a part about "uninstall" but I feel unable to use it.I would be most grateful for some indications as to how to uninstall.The inf file is attached, but for your convenience, here is the full text of my inf file:[version] signature="$CHICAGO$" Class = MEDIA [DefaultInstall] CopyFiles = Util.Files.Sys AddReg = Util.Add.Reg.Sys UpdateInis= AddSysIniEntry [DefaultUnInstall] DelFiles = Util.Files.Sys DelReg = Util.Del.Reg.Sys UpdateInis= DelSysIniEntry [DestinationDirs] Util.Files.Sys = 11[sourceDisksNames] 1="PANA",,1 [sourceDisksFiles] pdvcodec.dll=1 [util.Files.Sys] pdvcodec.dll panadv.inf[util.Add.Reg.Sys] HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,Description,,%*PANA.DeviceDesc% HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,Driver,,pdvcodec.dll HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,FriendlyName,,%*PANA.DeviceDesc% [util.Del.Reg.Sys] HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,Description HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,Driver HKLM,SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvsd,FriendlyName [AddSysIniEntry] system.ini, drivers32,,"vidc.dvsd=pdvcodec.dll",0 [DelSysIniEntry] system.ini, drivers32,,"vidc.dvsd=pdvcodec.dll",0 [strings] *PANA.DeviceDesc="PANA"pdvcodec.zip Quote
ricktendo Posted December 24, 2008 Author Posted December 24, 2008 You can switch the names DefaultUninstall <-> DefaultInstall and right click the inf and choose Install and the opposite of what happened first will happen second Quote
Geej Posted November 18, 2009 Posted November 18, 2009 Thanks for the sample template. I'm trying my hand on a simple addon. So far, encounter problem. It can install and uninstall properly. After uninstalled, the only problem is I got an error message when I tried to launch 'Add/Rem windows components' despite that I have included my inf with the above [sysoc.Edit] portion and updateinis entry.I checked sysoc.inf entry after uninstall and the program still listed there:[Components]Rota=ocgen.dll,OcEntry,Rota.inf,HIDE,7Screenshothttp://www.kwikpiks.com/files/66/error.jpgCan you guy help to check what is wrong with my inf? Rota.inf as below :[Version]Signature=$Windows NT$[Optional Components]Rota[DefaultInstall]CopyFiles =Rota.Files,@Rota.INFProfileItems=Rota.AddShortcutAddReg =Rota.AddReg[Rota]OptionDesc ="Rota v0.70"Tip ="Lossless Jpg Batch Rotator via GUI"Modes =0,1,2,3CopyFiles =Rota.FilesProfileItems=Rota.AddShortcutAddReg =Rota.AddReg[SourceDisksNames.x86]1="Rota Files","Rotav07.cab",,"i386"[DestinationDirs]Rota.Files=16422,RotaDefaultDestDir =17PNF.File =17[SourceDisksFiles]droot.gif=1readme-e.html=1readme.html=1Rota.exe=1rotadisp.gif=1rotainf.gif=1rotainit.gif=1rotamod.gif=1rotamode.gif=1rotanorm.gif=1rotaopen1.gif=1rotaopen2.gif=1rotaro.gif=1rotarow.gif=1test1.jpg=1test1l.jpg=1test2.jpg=1test2l.jpg=1test3.jpg=1test3l.jpg=1test4.jpg=1test4l.jpg=1test5.jpg=1test5l.jpg=1Rota.ini=1[Rota.Files]droot.gifreadme-e.htmlreadme.htmlRota.exerotadisp.gifrotainf.gifrotainit.gifrotamod.gifrotamode.gifrotanorm.gifrotaopen1.gifrotaopen2.gifrotaro.gifrotarow.giftest1.jpgtest1l.jpgtest2.jpgtest2l.jpgtest3.jpgtest3l.jpgtest4.jpgtest4l.jpgtest5.jpgtest5l.jpgRota.ini[Rota.AddShortcut]Name =RotaCmdLine =16422,Rota,Rota.exeSubDir =RotaWorkingDir=16422,RotaIfoTip =Loss-less JPEG rotate utility.[Rota.AddReg]HKLM,%UNINSTALL%,"Comments",0x0,"Loss-less JPEG rotate utility"HKLM,%UNINSTALL%","DisplayIcon",0x0,"%16422%\Rota\Rota.exe"HKLM,%UNINSTALL%,"DisplayName",0x0,"Rota"HKLM,%UNINSTALL%,"DisplayVersion",0x0,"0.7"HKLM,%UNINSTALL%,"NoModify",0x10001,01,00,00,00HKLM,%UNINSTALL%,"NoRepair",0x10001,01,00,00,00HKLM,%UNINSTALL%,"Publisher",0x0,"TsuruZoh Tachibanaya"HKLM,%UNINSTALL%,"UninstallString",0x0,"rundll32.exe advpack.dll,LaunchINFSection Rota.inf,Uninstall"HKLM,%UNINSTALL%,"URLInfoAbout",0x0,"http://park2.wakwak.com/~tsuruzoh/index-e.html"[UnInstall]BeginPrompt =BeginUnInsPromptRunPreSetupCommands=Close.Rota:1DelFiles =Rota.Files,PNF.FileDelDirs =Rota.DirsDelReg =Obsolete.RegProfileItems =Rota.DelShortcutUpdateInis =sysoc.EditEndPrompt =EndUnInsPromptCleanup =1[Close.Rota]TSKILL Rota[PNF.File]Rota.PNF[sysoc.Edit]%17%\sysoc.inf,Components,Rota=*[Obsolete.Reg]HKLM,"%UNINSTALL%\"[Rota.DelShortcut]Name =Rota,0x00000002SubDir=Rota[Rota.Dirs]%16422%/Rota[BeginUnInsPrompt]Title =Rota 0.7 UninstallPrompt =Are you sure you want to completely remove Rota?ButtonType=YESNO[EndUnInsPrompt]Prompt=Rota was successfully removed from your computer.[Strings]UNINSTALL="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Rota"BTW, is this a typo error for the word 'Componets' in post #1? I think it should be Components but better to confirm with you guys.;ricktendo64 2007;Removes addon entry from sysoc.inf so Cleanup=1 does not break Add/Rem Windows Components[sysoc.Edit]%17%\sysoc.inf,Componets,Whatever Is Under [Optional Components]=* Quote
ricktendo Posted November 18, 2009 Author Posted November 18, 2009 Yes its a typo and your INF looks good, I dont see any issuesThe thing that fixes the error in add/rem windows components is the entry in sysoc.inf that you add to install it, if you delete your .inf file when you uninstall the program you will also have to delete the entry in sysoc.inf. Quote
Guest Posted November 18, 2009 Posted November 18, 2009 well i'm not sure but try to add a , after the line like %17%\sysoc.inf,Components,Rota=*, Quote
Geej Posted November 18, 2009 Posted November 18, 2009 (edited) Thanks Rick for the fast 'inspection' and reply. Thanks DaRk MaDnEsS for suggesting alternative. I will try that.(It is real hardwork to script inf by hand )Apparently something is wrong (not Rota.inf anymore) that I get this message.Another thing: If I live with this error and proceed to uninstall another TrueAddon, say BJFrog_UltraISO, this error message issue is gone. But when I compare before and after sysoc.inf entry, a large part of sysoc.inf is removed!. Very strange.The part that gone from sysoc.inf is: All the rest of [Components] are wipe clean like Winrar,uberpack,CabMak,etc I'm using HFSLIP. How many [Components] section are listed in your slipstreamed sysoc.inf?I have 3 [Components] sections and the portion that was wipe out belongs to 2nd & 3rd [Components] section/entry, leaving only the 1st part of [Components] intact. 1st part of [Components] happens to list most of original XP Components.See my screenshot (A picture says a thousands word, I guess)http://www.kwikpiks.com/files/66/B4AfterSysoc.png Edited November 18, 2009 by Geej Quote
Guest Posted November 18, 2009 Posted November 18, 2009 Thanks Rick for the fast 'inspection' and reply. Thanks DaRk MaDnEsS for suggesting alternative. I will try that.(It is real hardwork to script inf by hand )Apparently something is wrong (not Rota.inf anymore) that I get this message.Another thing: If I live with this error and proceed to uninstall another TrueAddon, say BJFrog_UltraISO, this error message issue is gone. But when I compare before and after sysoc.inf entry, a large part of sysoc.inf is removed!. Very strange.The part that gone from sysoc.inf is: All the rest of [Components] are wipe clean like Winrar,uberpack,CabMak,etc I'm using HFSLIP. How many [Components] section are listed in your slipstreamed sysoc.inf?I have 3 [Components] sections and the portion that was wipe out belongs to 2nd & 3rd [Components] section/entry, leaving only the 1st part of [Components] intact. 1st part of [Components] happens to list most of original XP Components.See my screenshot (A picture says a thousands word, I guess)http://www.kwikpiks.com/files/66/B4AfterSysoc.pngin the original there is 2 sections i got the windows tools and the second is empty i don't know about Hfslip but i think it should integrate to the original one and it seems that Ultra iso addon got a typo also %17%\sysoc.inf,Componets,UltraISO=* Quote
Geej Posted November 19, 2009 Posted November 19, 2009 I manually re-combined all entries in [Componments] section of sysoc.inf into 1 section only and the rota.inf entry was properly removed. So I guess it is HFslip's handling of new entry to sysoc.inf that is causing the problem. Thanks for spotting utlraiso problem too. I think it should be %17%\sysoc.inf,Components,EZSystems=* Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.