*Reaper* Posted March 14, 2008 Posted March 14, 2008 Ok....I'm working on a addon that saves its settings and such inC:\Documents and Settings\Reapers\Application Data\Program Name\Question I have is when creating a uninstallable addon, how would Imake the addon uninstall that particular part.....Because not everyone has C:\ as their main drive, and of course there usernamewould be different also.......Any help would be appreciated... Quote
ricktendo Posted March 15, 2008 Posted March 15, 2008 OK pretty easy, in your [uninstall] section in the DelFiles directive you add a new section name (anything) example[Uninstall]DelFiles=Example.Other.Sections,New.Section;<-Add it hereNow create it and under the [New.Section] you add a list of those files you want deleted (the one that the program creates)[New.Section]Filename1.iniFilename2.baketc...Now you have to add the New.Section=LDID(,SubDir) to [DestinationDirs] so the INF will know where the files are, so go so look for the LDID of the %UserProfile%\Application DataHere is the LDID (number) for that folder16410 %userprofile%\Application DataSo it will go like this[DestinationDirs]Example.Section=16422,"Program Name"New.Section =16410,"Program Name";<-This is the DelFiles destination dirThe folder where all the old filenames exist must be defined in a DestinationDirs section as shown in the above example.Post your INF when you think you are done maybe we can have a look at it Quote
*Reaper* Posted March 16, 2008 Author Posted March 16, 2008 Ok.....This brings up another question....The program creates the config file in the directory like I said before.....BUT..... The file is named like this....Reapers.cfgSo it names the config file after the username that is being used.....So how would you allow for this....? Quote
ricktendo Posted March 16, 2008 Posted March 16, 2008 OK in your uninstall section try something like this (this will delete all the files not matter what they are in a directory)[Uninstall]RunPostSetupCommands=RunPostSetup.SectionName ;<- You can name this whatever you want[RunPostSetup.SectionName]RUNDLL32 advpack.dll,DelNodeRunDLL32 %16410%\%Program Name%,8You can change the flag (8) to do different things1 // delete the directory only if it's empty2 // don't delete any sub-dirs; delete only the files4 // don't delete the dir itself8 // delete UNC [network] paths ;This deletes both the files, sub dirs and the folder itself 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.