How do you pass or set the settings when creating a sfx

May 31, 2012 at 9:59 PM
Edited May 31, 2012 at 10:04 PM

Does anyone know how you pass or set the settings when creating a sfx using the SevenZipSfx class. I had the following file content as an example:

 

;!@Install@!UTF-8!
Title="Media Player Classic installation"
BeginPrompt="There are three Media Player Classic installation scenarios in this archive.\nAfter the installation it becomes the default player\nfor the following file types:\n\n1. Launching with '-ai1' switch - for audio files only\n2. Launching with '-ai2' switch - for video files only\n3. Clicking \"Yes\" or launching with '-ai' switch - both for\n audio and video files.\n\nWould you like to begin the Media Player Classic installation scenario #3?"
InstallPath="%windir%\system32"
GUIMode="1"
GUIFlags="1+8+2048"
Shortcut="Du,{%%T\\mplayerc.exe},{},{},{Media Player Classic},{Media Player Classic}"
Shortcut="Pu,{%%T\\mplayerc.exe},{},{},{Media Player Classic},{Media Player Classic}"
RunProgram="mplayerc.exe /regaud /regvid"
AutoInstall="mplayerc.exe /regaud /regvid"
;Audio Only
AutoInstall1="mplayerc.exe /regaud"
;VideoOnly
AutoInstall2="mplayerc.exe /regvid"
;!@InstallEnd@!

 

and set it via the sfx.ModuleFileName property but its fails with null exception when I call the
sfx.MakeSfx(@"C:\\Dev\\a.7z", @"C:\Dev\test.exe"); inside the GetSettingsStream(...) as the settings.key is null

I don't think this is the correct way though does anyone know what needs to be done
or what file needs to be modified with my custom settings as I don't want to hardcode  the settings
in the SevenZipSfx.cs source?

Vince.