Jump to content

Reboot using a inf file?


*Reaper*

Recommended Posts

Ok.... Ive got a addon that im working on...

During the uninstall I need the inf to set a folder for deletion after reboot.

So 1st question is How do you set a folder for deletion after a reboot,

and 2nd is how do you get the inf to ask if you if you would like to reboot?

The folder is in Program Files....

Reason I have to do it this was is because i have a dll file that is locked

by explorer.exe until after reboot, so you cant delete the folder until then...

And Ive tried everything... Unregistering.dll etc.... You can use unlocker

to unlock it and then delete the folder but thats not a great alternative...

Any help would be appreciated...

Edited by *Reaper*
Link to comment
Share on other sites

well you can make the inf reboot using

SmartReboot=

N Never reboot

AS Always reboot without asking

IS Reboot without prompting if needed

A Always ask user to reboot

I Ask user to reboot if needed

but i didn't try it a lot

and about setting the inf to remove folder

you can use Runonce commands in the registry to call the inf to delete the files

Edited by DaRk MaDnEsS
Link to comment
Share on other sites

To delete the folder you add a RunOnce/Ex entry to the registry to deal with the folder, in your DelFiles section of the INF add ,,,1 flag to force delete

[Uninstall]
DelFiles=SectionName
AddReg=RunOnce
SmartReboot=A

[SectionName]
Example.exe
Example.dll,,,1 ; queue up delayed delete

[RunOnce]
HKLM,Software\Microsoft\Windows\CurrentVersion\RunOnce,"PostUninstall",,"rundll32 advpack.dll,DelNodeRunDLL32 ""%16422%\%SubDir%"",1"

DelNodeRunDLL32

1 // delete the directory only if it's empty

2 // don't delete any sub-dirs; delete only the files

4 // don't delete the dir itself

8 // delete UNC [network] paths

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.

Guest
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...