DeutschEspanolFrancaisItalianoPortuguesArabicJapaneseKoreanSimplified Chinese




Infgen

Home > Products > Components > Infgen

Infgen can build a inf file that can be used to create an install package to perform install/ uninstall/inifiles/registry/ shortcut and DLL registering function. .

How to use:

    
       1. Create an inf file
    infgen1.init;
    infgen1.info.productname := 'TEST';
    infgen1.info.inffilename := 'C:\temp\test\test.inf';
    infgen1.info.uninstall := true;
    infgen1.Add_File('c:\temp\test\test.exe','\Program files\Test\',_Root);
    infgen1.Add_File('c:\temp\test\test.hlp','\Program files\Test\',_Root);
    infgen1.Add_Link('TestGrp','Test','\Program files\Test\test.exe',_Root);
    infgen1.Add_Link('TestGrp','Help','\Program files\Test\test.hlp',_Root);
    infgen1.Add_PostRun('\Program files\Test\test.exe',_Root,'',_nil);
    infgen1.WriteINF;
    
    2. Add the inf file and other files(test.exe/test.hlp) in zip
    make sure no folder data is saved.
    *if you use cakdir to do this operation...*
    cakdir1.Archivename := 'c:\temp\test\test.zip';
    cakdir1.AddOptions.add_usepath := false;
    cakdir1.AddOptions.add_dosformat := true;
    cakdir1.AddOptions.add_files.Add(infgen1.info.inffilename); cakdir1.AddOptions.add_files.add('c:\temp\test\test.exe');
    cakdir1.AddOptions.add_files.add('c:\temp\test\test.hlp');
    cakdir1.add;
    
    3. Create sfx
    Set postrun the test.inf file, and set default extract to >< (temp dir)
    *if you use cakdir to do this operation...*
    cakdir1.Archivename := 'c:\temp\test\test.zip';
    cakdir1.sfxoptions.sfx_commandline := 'test.inf';
    cakdir1.sfxoptions.sfx_extractto := '><';
    cakdir1.sfxoptions.sfx_autorun := true;
    cakdir1.sfx;