.INF File Code
Creating Folders and Links in Folders
After Setup installs a component, it creates a folder in the Program Files folder or creates links in a folder. Setup looks in the Setup.ini file for a [progman.groups] section and then parses it to create the folders or the links in those folders.
[progman.groups]
folder_1=Folder_1_Name
folder_2=Folder_2_Name
:
folder_n=Folder_n_Name
[folder_1]
link-name, .exe-name, icon-file-name, icon-index, profile
Managing Long File Names
To support backwards compatibility, the setup engine in Windows 32-bit versions of the browser is a 16-bit dynamic-link library (.dll) file. Because of this 16-bit limitation, the setup engine can copy only files that have short (8.3) file names.
To manage files with long names, before the setup engine closes, it runs a Windows 32-bit program that renames these short file names to their long file names. During an uninstall, the same program can delete the long file names. This program gets its instructions from predefined paths in the registry. You can specify the registry settings for these rename and delete operations by including this information in the [AddReg] section of your .inf file.
Rename code
HKEY_LOCAL_MACHINE \Software \Microsoft \Windows \CurrentVersion \RenameFiles
Delete code
HKEY_LOCAL_MACHINE \Software \Microsoft \Windows \CurrentVersion \DeleteFiles
Copying Files to the Program Files Folder
Because copying Windows files is a 16-bit operation, you must use only short file names. Therefore, to access the Program Files folder, you must use the 8.3 equivalent, "24,PROGRA~1", in the [DestinationDirs] section of your .inf file. Similarly, you must use the short file name equivalent to access any folders with long file names in the Program Files folder.
[WordPadInstall]
CopyFiles = WordPadCopyFiles
UpdateInis = WordPadInis
[DestinationDirs]
WordPadCopyFiles = 24,%PROGRAMF%\%ACCESSOR%
[WordPadCopyFiles]
mswd6_32.wpc
wordpad.exe
write32.wpc
[WordPadInis]
setup.ini, progman.groups,, "group4=%APPS_DESC%"
;creates Accessories folder (if not already there)
setup.ini, group4,, """%WORDPAD_LINK%"",
""%24%\%PROGRAMF%\%ACCESSOR%\WORDPAD.EXE"""
;creates link in Accessories folder
[Strings]
APPS_DESC = "Accessories"
WORDPAD_LINK = "WordPad"
; Folder names - note that
the short versions must match the truncated
; 8-character names for the long versions, or there will be problems.
PROGRAMF = "Progra~1" ; first 6 chars of Program_Files, + "~1"
ACCESSOR = "Access~1" ; first 6 chars of Accessories, + "~1"
How to make autorun.inf
[autorun]
open=autorun.exe (you run setup)
icon=.\setup\setup.exe, 0 (or Setup.ico)
shell\readit\command=notepad (you txt file)
More Info https://technet.microsoft.com
(0_0)
0 comments:
Post a Comment