Jump to content

Launch advpack.dll through Optional Components


Recommended Posts

Posted (edited)

Hi,

I've tried to launch advpack.dll through Optional Components, like this:

[Version]
Signature=$Windows NT$

[Optional Components]
Unix

[DefaultInstall]
CopyFiles = InfFile.Files
RegisterDLLs = LaunchAdvancedInstall

[Unix]
RegisterDLLs = LaunchAdvancedInstall

[LaunchAdvancedInstall]
11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\%MAIN_INF%,Install"

[Install]
OptionDesc = %UnixDisplayName%
Tip = "Gnu Unix Utilities AddOn By Kal"
Modes = 0,1,2,3
RunPostSetupCommands = Unix.Add.Path:1
CopyFiles = InfFile.Files
CopyFiles = Unix.Files,Wgetrc.Files
AddReg = Unix.AddReg

But it doesn't seem to work when it's installed with SYSOC. On a running windows, it works. Have I made a mistake ?

Cheers,

Kal

Edited by Kal
Posted (edited)

The default install should be the same as the install, also you have 2 CopyFiles in the install.

Try this.

[Version]
Signature=$Windows NT$

[Optional Components]
Unix

[DefaultInstall]
CopyFiles = Unix.Files,Wgetrc.Files
AddReg = Unix.AddReg
RegisterDLLs = LaunchAdvancedInstall

[Install]
OptionDesc = %UnixDisplayName%
Tip = "Gnu Unix Utilities AddOn By Kal"
Modes = 0,1,2,3
RunPostSetupCommands = Unix.Add.Path:1
CopyFiles = Unix.Files,Wgetrc.Files
AddReg = Unix.AddReg
RegisterDLLs = LaunchAdvancedInstall
[Unix]
RegisterDLLs = LaunchAdvancedInstall

[LaunchAdvancedInstall]
11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\%MAIN_INF%,Install"

It's been awhile for me but, give it a try.

Edited by LUZR4LIFE
Posted

[Optional Components]
OCSection

[OCSection]
OptionDesc=""
Tip=""
Run=Launch.PostInstall

[Launch.PostInstall]
CommandLine="rundll32.exe advpack.dll,LaunchINFSection INF_FILE.INF,NameOfSection"
TickCount=500

To fix yours just remove the %1%\ its not needed...only use that for manual installers not during setup, leave it with no path it will assume that INF is the default dir

BTW what do you want to launch a installer during windows setup for?

Posted

Thanks Rick, your help is still appreciated :D

I need to launch a program that I've just coded, to change path keeping %SystemDrive% value in it. It can also remove a directory from path.

; after installation
[Unix.Add.Path]
%11%\%UNIXPATH%\chgpath.exe add %%SystemRoot%%\System32\%UNIXPATH%

; before uninstallation
[Unix.Remove.Path]
%11%\%UNIXPATH%\chgpath.exe remove %%SystemRoot%%\System32\%UNIXPATH%

Thanks LUZR4LIFE for pointing my double CopyFiles ;)

Kal

Posted (edited)

I just realised some things keeping me from succesfully installing this inf with advpack.dll.

If I run CopyFiles in the section executed by advpack.dll, like this :

[Version]

Signature=$Windows NT$

[Optional Components]

Unix

[DefaultInstall]

CopyFiles = InfFile.Files

RegisterDLLs = AdvancedInstall

[unix]

OptionDesc = %UnixDisplayName%

Tip = "Gnu Unix Utilities AddOn By Kal"

Modes = 0,1,2,3

RegisterDLLs = AdvancedInstallOC

[AdvancedInstall]

11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\%MAIN_INF%,Install"

[AdvancedInstallOC]

11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %MAIN_INF%,Install"

[install]

RunPostSetupCommands = Run.Add.Path:1

CopyFiles = Unix.Files,Wgetrc.Files

AddReg = Unix.AddReg

[sourceDisksNames.x86]

1="Unix Files",%MAIN_CAB%,,"i386"

That won't work during Windows installation. Indeed, it will look for cab file in %SystemRoot\Inf\i386 (from where INF is launched).

So that's how it needs to be writted :

[Version]

Signature=$Windows NT$

[Optional Components]

Unix

[DefaultInstall]

CopyFiles = InfFile.Files

CopyFiles = Unix.Files,Wgetrc.Files

AddReg = Unix.AddReg

RegisterDLLs = AdvancedInstall

[unix]

OptionDesc = %UnixDisplayName%

Tip = "Gnu Unix Utilities AddOn By Kal"

Modes = 0,1,2,3

CopyFiles = Unix.Files,Wgetrc.Files

AddReg = Unix.AddReg

RegisterDLLs = AdvancedInstallOC

[AdvancedInstall]

11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %1%\%MAIN_INF%,Install"

[AdvancedInstallOC]

11,,rundll32.exe,,,"advpack.dll,LaunchINFSection %MAIN_INF%,Install"

[install]

RunPostSetupCommands = Run.Add.Path:1

[sourceDisksNames.x86]

1="Unix Files",%MAIN_CAB%,,"i386"

Moreover, I just discovered that OptionDesc, Tip and Modes directives are only used by Option Components. So no need to put them in DefaultInstall.

Edited by Kal

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