flag
如果安装过程中正在使用此文件,可选参数用于强制 Windows 删除此项目中命名的文件。要指示 Windows 将文件删除操作进行排队,直到计算机重新启动,请将 flag 参数的值设置为 1。 如果由于正在使用该文件而不能删除参数设置为 flag=1 的文件,那么设备安装完成后系统将重新启动。
如果不与 file-name 参数一起使用值为 1 的 flag 参数,在执行 DelFiles 节时如果正在使用该文件,则不能从计算机上删除此文件。
Thought this may help people out, I apologise if a similar method has been posted previously, but I couldn't find one in my searches.
Before the cleanup routine is called in runoncex.cmd, add the lines similar to the following:
CODE
REG ADD %KEY%\045 /VE /D "Adding user defined shortcuts" /f
REG ADD %KEY%\045 /V 1 /D "rundll32 setupapi,InstallHinfSection Shortcuts 128 %systemdrive%\Apps\Standalone\shortcuts.inf" /f
Now create a shortcuts.inf file similar to this:
CODE
[Version]
Signature=$CHICAGO$
[Shortcuts]
UpdateInis=AddLink
[AddLink]
;adds shortcut to ERUNT.exe within %ProgramFiles%\Standalone\ERUNT folder to %USERPROFILE%\Start Menu\Programs\Standalone\ERUNT
setup.ini, progman.groups,, "group1=""%16386%\Standalone\ERUNT\"""
setup.ini, group1,,"""ERUNT"",""""""%16422%\Standalone\ERUNT\ERUNT.EXE"""""""
;adds shortcut to README.TXT within %ProgramFiles%\Standalone\ERUNT folder to %USERPROFILE%\Start Menu\Programs\Standalone\ERUNT
setup.ini, progman.groups,, "group2=""%16386%\Standalone\ERUNT\"""
setup.ini, group2,,"""Readme"",""""""%16422%\Standalone\ERUNT\README.TXT"""""""
;adds shortcut to NTREGOPT.EXE within %ProgramFiles%\Standalone\ERUNT folder to %USERPROFILE%\Start Menu\Programs\Standalone\ERUNT
setup.ini, progman.groups,, "group3=""%16386%\Standalone\ERUNT\"""
setup.ini, group3,,"""NTREGOPT"",""""""%16422%\Standalone\ERUNT\NTREGOPT.EXE"""""""
;adds shortcut to Restoration.exe within %ProgramFiles%\Standalone\Restoration folder to %USERPROFILE%\Start Menu\Programs\Standalone\Restoration
setup.ini, progman.groups,, "group4=""%16386%\Standalone\Restoration\"""
setup.ini, group4,,"""Restoration"",""""""%16422%\Standalone\Restoration\Restoration.exe"""""""
;adds shortcut to SyncBack.exe within %ProgramFiles%\Standalone\SyncBack folder to %USERPROFILE%\Start Menu\Programs\Standalone\SyncBack
setup.ini, progman.groups,, "group5=""%16386%\Standalone\SyncBack\"""
setup.ini, group5,,"""SyncBack"",""""""%16422%\Standalone\SyncBack\SyncBack.exe"""""""
;adds shortcut to SYNCBACK.HLP within %ProgramFiles%\Standalone\SyncBack folder to %USERPROFILE%\Start Menu\Programs\Standalone\SyncBack
setup.ini, progman.groups,, "group6=""%16386%\Standalone\SyncBack\"""
setup.ini, group6,,"""SyncBack Help"",""""""%16422%\Standalone\SyncBack\SYNCBACK.HLP"""""""
;adds shortcut to popcorn.exe within %ProgramFiles%\Standalone\PopCorn folder to %USERPROFILE%\Start Menu\Programs\Standalone\PopCorn
setup.ini, progman.groups,, "group7=""%16386%\Standalone\PopCorn\"""
setup.ini, group7,,"""Ultrafunk Popcorn"",""""""%16422%\Standalone\PopCorn\popcorn.exe"""""""
;adds shortcut to popreadme.txt within %ProgramFiles%\Standalone\PopCorn folder to %USERPROFILE%\Start Menu\Programs\Standalone\PopCorn
setup.ini, progman.groups,, "group8=""%16386%\Standalone\PopCorn\"""
setup.ini, group8,,"""Readme"",""""""%16422%\Standalone\PopCorn\popreadme.txt"""""""
;for meanings of %16386% and %16422% see listings below
;
; Common DIRID Listing,
;
; Destination Directories
;
; 01 - SourceDrive:\pathname (the directory from which the INF file was installed)
; 10 - Windows directory (%SystemRoot%)
; 11 - System directory (%SystemRoot%\system32 -NT-, %SystemRoot%\system -Win9x/Me-)
; 12 - Drivers directory (%SystemRoot%\system32\drivers -NT-, %SystemRoot%\system\IoSubsys -Win9x/Me-)
; 17 - INF file directory (%SystemRoot%\inf)
; 18 - Help directory (%SystemRoot%\Help)
; 20 - Fonts directory (%SystemRoot%\Fonts)
; 24 - Root directory of system disk (%SystemDrive%)
; 25 - Shared directory (%ALLUSERSPROFILE%\Shared Documents)
; 53 - User profile directory (%USERPROFILE%)
;
; Shell Special Folders
;
; 16419 %ALLUSERSPROFILE%\Application Data
; 16409 %ALLUSERSPROFILE%\Desktop
; 16430 %ALLUSERSPROFILE%\Documents
; 16437 %ALLUSERSPROFILE%\Documents\My Music
; 16438 %ALLUSERSPROFILE%\Documents\My Pictures
; 16439 %ALLUSERSPROFILE%\Documents\My Videos
; 16415 %ALLUSERSPROFILE%\Favorites
; 16406 %ALLUSERSPROFILE%\Start Menu
; 16407 %ALLUSERSPROFILE%\Start Menu\Programs
; 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
; 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
; 16429 %ALLUSERSPROFILE%\Templates
; 16410 %USERPROFILE%\Application Data
; 16417 %USERPROFILE%\Cookies
; 16384 %USERPROFILE%\Desktop
; 16400 %USERPROFILE%\Desktop
; 16390 %USERPROFILE%\Favorites
; 16412 %USERPROFILE%\Local Settings\Application Data
; 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
; 16418 %USERPROFILE%\Local Settings\History
; 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
; 16389 %USERPROFILE%\My Documents
; 16397 %USERPROFILE%\My Documents\My Music
; 16423 %USERPROFILE%\My Documents\My Pictures
; 16398 %USERPROFILE%\My Documents\My Videos
; 16403 %USERPROFILE%\NetHood
; 16411 %USERPROFILE%\PrintHood
; 16392 %USERPROFILE%\Recent
; 16393 %USERPROFILE%\SendTo
; 16395 %USERPROFILE%\Start Menu
; 16386 %USERPROFILE%\Start Menu\Programs
; 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
; 16391 %USERPROFILE%\Start Menu\Programs\Startup
; 16405 %USERPROFILE%\Templates
; 16422 %ProgramFiles%
; 16427 %ProgramFiles%\Common Files
; 16440 %SystemRoot%\Resources
; 16441 %SystemRoot%\Resources\0409
;
; e.g.
; For shortcut in users Quick Launch toolbar,
; "%16410%\Microsoft\Internet Explorer\Quick Launch\"
You can remove all the commented lines to make it smaller
In my example the standalone programs,(all freeware), were each within their own folders within a folder called Standalone which in turn resided inside \$OEM$\$Progs and the shortcuts were all created within their own new folders within a new folder named Standalone which in turn resided in %USERPROFILE%\Start Menu\Programs.