Jump to content

[How To] INF Uninstall Template


Recommended Posts

Thanks Rick. Thanks DM. Just retest all possible syntax in VM after I re-arrange sysoc.inf entry first and

then I test all the uninstall.


all tested ok.

%17%\sysoc.inf,Components,EZSystems = *

doesn't work. Entry not removed. Same kind of Error message if click 'Add/rem Windows Components'.

Thanks for all the help. :thumbsup_anim:

Link to comment
Share on other sites

  • 1 year later...

and how to remove registry like this,with define new delete.AddDelReg in a uninstal section


[install section]

AddReg =REGEntries.AddReg

[uninstal section]

AddReg =REGEntries.AddReg,delete.AddDelReg

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
"{AC67E92C-D916-4058-A7B8-0913746592F4}"="HiddenFilesToggle Extension"

also how to delete this

Windows Registry Editor Version 5.00

when convert to inf and use delete every thing

HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved"

but i want just delete this value {AC67E92C-D916-4058-A7B8-0913746592F4}

Edited by mona
Link to comment
Share on other sites

In your uninstall section you have to change AddReg to DelReg

An to delete onl that guid you can try one of the Append or DelVal numbers

REG_SZ = 0x00000000 (or 0)
REG_BINARY = 0x00000001 (or 1)
Reg_SZ_NOCLOBBER = 0x00000002 (or 2)
REG_BINARY_NOCLOBBER = 0x00000003 (or 3)
REG_MULTI_SZ = 0x00010000
REG_DWORD = 0x00010001
REG_MULTI_SZ_DELVAL = 0x00010006
REG_ADDREG_APPEND = 0x00010008
REG_EXPAND_SZ = 0x00020000

Link to comment
Share on other sites

Mona, I would use something like this for the uninstall

Signature=$Windows NT$

[Optional Components]

DelReg =REGEntries.DelReg

OptionDesc =Registry Entries
Tip =Registry Entries removal
Modes =0,1,2,3
DelReg =REGEntries.DelReg

HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved,{AC67E92C-D916-4058-A7B8-0913746592F4}

Link to comment
Share on other sites


how can use there value?

seems to hard,if add some example its good,and add it to frist post


thanks working,but see this correct or no.some time work some time not work

i install this registry then via inf try to delete it.first time not working but second time working

Windows Registry Editor Version 5.00

for delreg,this correct or no?


Link to comment
Share on other sites

for delreg,this correct or no?



Can also written as


as they are basically the same thing.

Usually, just export the .reg key, then convert it to inf using reg2inf. This will ensure the syntax stay correct before you tried to cut down some syntax for uninstalling purpose. Usually I don't manual code the reg inf syntax. I just use the conversion tool to do it for me.

Edited by Geej
Link to comment
Share on other sites

Hi, inf experts!

I have made an attempt to add uninstall to my QTAdressBar addon, but it fails at deleting files and folders, maybe because they are in use when uninstalling.

Original post and addon is here:

Can you take a look ?

Thanks !!

Link to comment
Share on other sites

In the Delete/CopyFiles section you put the filename followed by ,,,1 this will tell windows to delete the file on reboot if it is in use




destination-file1-name(, source-file1-name)(, temporary-file1-name)(,flag)

destination-file2-name(, source-file2-name)(, temporary-file2-name)(,flag)

A list of the names of files to be copied from a source disk to a destination directory. The source disk

and destination directory associated with each file are specified in other sections of the INF file. The

file-list-section name must appear in the CopyFiles item of an Install section.

Note that you can specify the copying of a single file in the CopyFiles item of the Install section itself,

without building a CopyFiles section. To do this, use the special character "@" to force a single file

copy. An example of using the "@" character in a CopyFiles-type item is in the Install section reference

topic. Copying a single file in this way is somewhat limited because the source and destination filenames

must be the same in this case and you cannot use a temporary file.


Name of the destination file. If no source filename is given, this is also the name of the source file.


Name of the source file. If the source and destination filenames for the file copy operation are the same,

this is not required.


Name of a temporary file for the file copy operation. The installer copies the source file but gives it the

temporary file name. The next time the operating system starts, it renames the temporary file to the

destination file name. This is useful for copying files to a destination which is currently open or in use

by Windows.

If the file is not in use by Windows, use flag 8 to force it to use the temporary name. This will only

work if the file already exists in in the target folder. To get around this, first copy the file into the folder,

then use flag 8 to copy it again.


Optional parameter used to perform special actions during the installation process. Multiple flags can be

used by adding the values to create the combined flag. The following valid flags can be used:

Value Meaning
1 On CopyFiles: Warn if user tries to skip file.
1 On DelFiles: If file is in use, queue up delayed delete in wininit.ini. Otherwise an in-use file
will not be deleted.
2 Setup Critical: don't allow user to skip file.
4 Ignore version check and always copy file. This will overwrite a newer file.
8 Force Rename (trick engine into thinking that file is in use). Note: Only happens if file
already exists on target.
16 If file already exists on target, don't copy.
32 Suppress version conflict dialog and don't overwrite newer files.

This example copies three files:

file11 ; copies file11
file22,, file23,8 ; copies file22, temporarily naming it file23
file31, file32 ; copies file32 to file31

Link to comment
Share on other sites

thanks for the tip

I also use these commands to delete folders

"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\GAC_MSIL\QTAddressBar""",8
"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\GAC_MSIL\Interop.SHDocVw""",8
"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\QTAddr3_v2.0.50727_32""",8

Do you know how to execute those on next reboot ?

Edited by mooms
Link to comment
Share on other sites

Add a RunOnce/Ex to LaunchINFSection (new/separate INF section)


BTW it should go like this

"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\GAC_MSIL\QTAddressBar"",8"
"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\GAC_MSIL\Interop.SHDocVw"",8"
"rundll32.exe advpack.dll,DelNodeRunDLL32 ""%16420%\Assembly\QTAddr3_v2.0.50727_32"",8"

Link to comment
Share on other sites

  • 3 weeks later...


i want run Uninstall.vbs with in inf file.how cam i do it?

i try with RunPostSetupCommands but dont know why not work


also any way Available to auto igonre installed file via inf?

that mean just install none installed file and updated file and auto igonre installed file with same version

Edited by mona
Link to comment
Share on other sites

cscript //B %16422%\Utility\someFolder\Uninstall.vbs

For the ignore thing try the copyfiles flag sum of 16+32=48

16 If file already exists on target, don't copy.

32 Suppress version conflict dialog and don't overwrite newer files.


Link to comment
Share on other sites

Signature=$Windows NT$
CopyFiles = secur
Addreg = secur.addreg
ProfileItems = secure,secure1
[Optional Components]
OptionDesc = "T-Clock xp"
Tip = "T-Clock"
Modes = 0,1,2,3
CopyFiles = secur
Addreg = secur.addreg
ProfileItems = secure,secure1
1="Notepad2 Install Files","ShowDe.cab",,"i386"
secur = 16422,"Utility\SecureFolder"

secu1.txt =1
secu2.txt =1
secu3.txt =1
secu4.txt =1
secu5.txt =1
secu6.txt =1
secu7.txt =1
secu8.url =1

Name = Secure Folder
CmdLine = 16422,"Utility\SecureFolder\SecureFolder.exe",
SubDir = Utility
WorkingDir = 16422,Utility,SecureFolder
InfoTip = "Lock/Unlock with Secure Folder"
Name = Secure Folder,0x00000008,9
CmdLine = 16422,"Utility\SecureFolder",SecureFolder.exe
SubDir = Tools
WorkingDir = 16422,Utility,SecureFolder
InfoTip = "Lock/Unlock with Secure Folder"
HKLM,"%RemoveM%\SecureF","Comments",0,"Lock, Hide and Encrypt folders with password."
HKLM,"%RemoveM%\SecureF","DisplayName",0,"Secure Folder V5.4.0.0"
HKLM,"%RemoveM%\SecureF","Publisher",0,"Subin Ninan ™"
HKLM,"%RemoveM%\SecureF","ParentDisplayName",0,"UltraPacK Software V3.2.1"
HKLM,"%RemoveM%\SecureF","ParentKeyName",0,"UltraPack Software"
HKLM,"%RemoveM%\SecureF","UninstallString",0,"rundll32.exe advpack.dll,LaunchINFSection UltrMona.inf,secureuninstall"
UninsQuestsecure = "Do You Want Uninstall SecureFolder?"
UninsFinalsecure = "SecureFolder was successfully uninstalled!"
RemoveM ="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

BeginPrompt = BeginUnInsPromptsecure
EndPrompt = EndUnInsPromptsecure
RunPreSetupCommands = Kill.sd:1
DelReg = secur.addreg,0secur.addreg
ProfileItems = SecureFol.DelShortcut,SecureFol.DelShortcut2,secyre.DelShortcut1,Tool.DelShortcut13
RunPostSetupCommands = securdel:1
TASKKILL /F /IM SecureFolder.exe
tskill SecureFolder
TASKKILL /F /IM Update.exe
tskill Update

cscript //B %16422%\Utility\SecureFolder\Uninstall.vbs

Name = Secure Folder,0x00000002
SubDir = Utility
Name = Secure Folder,0x00000003
SubDir = Utility
Name = Secure Folder,0x0000000A,9
SubDir = Tools
Name = Secure Folder,0x00000003
SubDir = Tools
Prompt = %UninsQuestsecure%
Title = %UninsTitle%
ButtonType = OKCANC
Prompt = %UninsFinalsecure%

Also about below i try and report

For the ignore thing try the copyfiles flag sum of 16+32=48

Edited by mona
Link to comment
Share on other sites

Two commas after secu4.txt, because you also count the comma before secu4.txt

Try these different RunPost commands

"cscript //B ""%16422%\Utility\SecureFolder\Uninstall.vbs"""
"cmd /c cscript //B ""%16422%\Utility\SecureFolder\Uninstall.vbs"""

Also try RegisterDLLs

11,,cscript.exe,,,"//B ""%16422%\Utility\SecureFolder\Uninstall.vbs"""
11,,cmd.exe,,,"/c cscript //B ""%16422%\Utility\SecureFolder\Uninstall.vbs"""

Link to comment
Share on other sites

i test Four way but not work.also i copy cscript.exe to this folder and drag&drop Uninstall.vbs on it

but not work.just open cmd in Utility\SecureFolder and type Uninstall.vbs and enter work.

also about 16+32=48 i test and work,but i not sure,seems if file Extension has the number it copyied.


also with 48 if the source file newer than destination it not copy new file to destination.

so i searched and found this link so for do this must use 64 ,so 64+48=112 i try but dont work?


can you tellme how it work?

Edited by mona
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...