Jump to content

INF Help please


Recommended Posts

My problem is the shortcuts do not delete after uninstalling.

[Version]
Signature=$Windows NT$

[DefaultInstall]
RegisterDLLs=Start.Register

[Install]
OptionDesc =%AppName%
Tip =%INFOTIP%
Modes =0,1,2,3
ProfileItems =TrayCD.Shortcut1,TrayCDReadMe.Shortcut2
CopyFiles =Program.Files, @TrayCD.inf
AddReg =AddRegSection

[Optional Components]
TrayCD

[TrayCD]
OptionDesc =%AppName%
Tip =%INFOTIP%
Modes =0,1,2,3
ProfileItems =TrayCD.Shortcut1,TrayCDReadMe.Shortcut2
CopyFiles =Program.Files
AddReg =AddRegSection

[UninstallTrayCD]
BeginPrompt =BeginUnInsPrompt
EndPrompt =EndUnInsPrompt
RunPreSetupCommands =CloseProgram:1
DelFiles =Program.Files, PNF.File
DelDirs =DelDirsSection
DelReg =DelRegSection
ProfileItems =TrayCD.DelShortcut1,TrayCDReadMe.DelShortcut2

[BeginUnInsPrompt]
Title = %TitleUnInsPrompt%
Prompt = %BeginUnInsPrompt%
ButtonType =YESNO

[EndUnInsPrompt]
Prompt = %EndUnInsPrompt%

[SourceDisksNames]
1="TrayCD Files","TrayCD.cab",,"i386"

[DestinationDirs]
Program.Files =16422,"%TrayCD%"
PNF.File =17
DefaultDestDir =17

[PNF.File]
TrayCD.PNF
TrayCD.inf

[SourceDisksFiles]
Tray_CD.exe =1
Readme.htm =1

[Program.Files]
;Program files to delete, will not work without a DestinationDir
;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.
Readme.htm
Tray_CD.exe

[Create.EmptyDirectorys]

[AddRegSection]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","TrayCD",0x0,"""%16422%\Utilities\Tray CD\Tray_CD.exe"""
HKLM,"%Uninstall%\%AppName%","DisplayName",0,"%AppName%"
HKLM,"%Uninstall%\%AppName%","DisplayVersion",0,"%Version%"
HKLM,"%Uninstall%\%AppName%","UninstallString",0,"rundll32.exe advpack.dll,LaunchINFSection TrayCD.inf,UninstallTrayCD"
HKLM,"%Uninstall%\%AppName%","Comments",0x0,"Opens or closes CD's from the tray"
HKLM,"%Uninstall%\%AppName%","DisplayIcon",0x0,"%16422%\Utilities\TrayCD\Tray_CD.exe"
HKLM,"%Uninstall%\%AppName%","NoModify",0x10001,01,00,00,00
HKLM,"%Uninstall%\%AppName%","NoRepair",0x10001,01,00,00,00
HKLM,"%Uninstall%\%AppName%","Publisher",0x0,"RJL Software"
HKLM,"%Uninstall%\%AppName%","URLInfoAbout",0x0,"http://www.rjlsoftware.com/"

[TrayCD.Shortcut1]
Name =TrayCD,0x00000008,23
SubDir ="%TrayCD%"
IconPath =16422,"%TrayCD%","Tray_CD.exe"
CmdLine =16422,"%TrayCD%","Tray_CD.exe"
WorkingDir =16422,"%TrayCD%"
InfoTip ="%INFOTIP%"

[TrayCDReadMe.Shortcut2]
Name =TrayCD ReadMe,0x00000008,23
SubDir ="%TrayCD%"
IconPath = 16422,"Internet Explorer",iexplore.exe,002
IconIndex = 2
CmdLine =16422,"%TrayCD%","TrayCD.htm"
WorkingDir =16422,"%TrayCD%"
InfoTip ="TrayCD ReadMe"

[Start.Register]
11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\TrayCD.inf,Install"

[DelDirsSection]
%16422%\%TrayCD%

[DelRegSection]
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","TrayCD",0x0,"""%16422%\Utilities\Tray CD\Tray_CD.exe"""
HKLM,"%Uninstall%\%AppName%"

[TrayCD.DelShortcut1]
Name =Tray CD,0x0000000A,23
SubDir ="%TrayCD%"

[TrayCDReadMe.DelShortcut2]
Name =Tray CD ReadMe,0x0000000A,23
SubDir ="%TrayCD%"

[CloseProgram]
TASKKILL /F /IM Tray_CD.exe
TSKILL Tray_CD.exe

[Strings]
AppName = "TrayCD"
INFOTIP = "Opens or closes CD's from the tray"
Version = "1.0.6.0"
TitleUnInsPrompt = "TrayCD Uninstaller"
BeginUnInsPrompt = "Are you sure, that you want TrayCD and all components deleted?"
EndUnInsPrompt = "TrayCD has been successfully deleted."
TrayCD = "Utilities\TrayCD"
Uninstall = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"

Link to comment
Share on other sites


Thanks for the tips guys but nothing has worked so far.

I have tried

0x0000000A,9

0xA,23

0x00000002,23 < Microsoft says this should work

I have also tried

[DelDirsSection]

%16407%\%TrayCD% < Microsoft says this should work also

Link to comment
Share on other sites

Workaround method

(add this section into your inf)


[UninstallTrayCD]
;ProfileItems =TrayCD.DelShortcut1,TrayCDReadMe.DelShortcut2
RunPostSetupCommands =Delete.shortcut:1

[Delete.shortcut]
cmd.exe /c rd /s /q """%allusersprofile%\Start Menu\Programs\Utilities"""

[CloseProgram]
TASKKILL /F /IM """Tray_CD.exe"""
TSKILL """Tray_CD"""

-----Edit------

Found your problem. Your original shortcut name contains space, Tray CD, Remove the space and should work now.


[TrayCD.DelShortcut1]
Name ="TrayCD",0x0000000A,23 ;<- your original shortcut name contains space, Tray CD
SubDir ="%TrayCD%"

[TrayCDReadMe.DelShortcut2]
Name ="TrayCD ReadMe",0x0000000A,23 ;<- your original shortcut name contains space, Tray CD

Edited by Geej
Link to comment
Share on other sites

Workaround method

(add this section into your inf)


[UninstallTrayCD]
;ProfileItems =TrayCD.DelShortcut1,TrayCDReadMe.DelShortcut2
RunPostSetupCommands =Delete.shortcut:1

[Delete.shortcut]
cmd.exe /c rd /s /q """%allusersprofile%\Start Menu\Programs\Utilities"""

[CloseProgram]
TASKKILL /F /IM """Tray_CD.exe"""
TSKILL """Tray_CD"""

-----Edit------

Found your problem. Your original shortcut name contains space, Tray CD, Remove the space and should work now.


[TrayCD.DelShortcut1]
Name ="TrayCD",0x0000000A,23 ;<- your original shortcut name contains space, Tray CD
SubDir ="%TrayCD%"

[TrayCDReadMe.DelShortcut2]
Name ="TrayCD ReadMe",0x0000000A,23 ;<- your original shortcut name contains space, Tray CD

Thank You very much Geej

The space was the problem, I knew you could have spaces in the shortcut names without quotes but after you said remove it I checked for the 50th time and saw the add and delete did not match.

Problem solved, I will keep in mind your post setup command for future problems as well :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...