Thanks,
Dave Saetrum
Posted 30 October 2001 - 16:11
Thanks,
Dave Saetrum
Posted 20 November 2001 - 09:02
I have the same problem as you. I want to install a network protocoll and the correspondent service.
I only have a oemsetup.in and a binding.inf
I tryed three different ways for the moment wiht no success.
1. Writing a costum action calling the the folowing command: setup.exe /f /i %systemroot%\system32 cpashel.inf /t NTN_InstallMode = Install /t NTN_Origination = NCPA /t NTN_Infname = %ICA_ROOT_PATH%\BACstac\oemsetup.inf /t NTN_SRCPATH = %ICA_ROOT_PATH%\BACstac /t NTN_Infoption = BACDL
My problem is that I do not understand how to debug in ISWI so I can only test if it works or not. At the moment it seem that I didn't found out the wright custom Action type.
2. I wrote an install script.
calling the same command:
function InstallBACstacProtocol()
STRING szProgram, szCmdLine;
STRING szResult, szCaption;
NUMBER ret;
begin
//SetBACstacInstallationFolder();
szProgram = WINSYSDIR ^"SETUP.EXE";
szCmdLine = "/f /i ";
szCmdLine = szCmdLine + WINSYSDIR;
szCmdLine = szCmdLine + "ncpashel.inf /t NTN_InstallMode = ";
bReinstall_g = FALSE;
if(bReinstall_g = TRUE) then
szCmdLine = szCmdLine + "Update";
else
szCmdLine = szCmdLine + "install";
endif;
szCmdLine = szCmdLine + " /t NTN_Origination = NCPA ";
szCmdLine = szCmdLine + "/t NTN_Infname = \"";
szCmdLine = szCmdLine + TARGETDIR;
szCmdLine = szCmdLine + "\\BACstac\\oemsetup.inf";
szCmdLine = szCmdLine + "\" /t NTN_SRCPATH = \"";
szCmdLine = szCmdLine + TARGETDIR ^"BACstac";
szCmdLine = szCmdLine + "\" /t NTN_Infoption = BACDL";
ret = LaunchAppAndWait (szProgram, szCmdLine, WAIT);
if (ret!=0) then
szResult = "Error Installing BACstac Protocol";
szCaption = "BACstac Protocol"; // SdLoadString(IFX_ONMAINTUI_CAPTION);
SprintfBox(MB_OK,szCaption,"%s",szResult);
endif;
szCmdLine = "/f /i ";
szCmdLine = szCmdLine + WINSYSDIR;
szCmdLine = szCmdLine + "ncpashel.inf /t NTN_InstallMode = install /t NTN_Origination = NCPA ";
szCmdLine = szCmdLine + "/t NTN_Infname = \"";
szCmdLine = szCmdLine + TARGETDIR;
szCmdLine = szCmdLine + "\\BACstac\\binding.inf\"";
ret = LaunchAppAndWait (szProgram, szCmdLine, WAIT);
if (ret!=0) then
szResult = "Error Installing BACstac Protocol";
szCaption = "BACstac Protocol"; //SdLoadString(IFX_ONMAINTUI_CAPTION);
SprintfBox(MB_OK,szCaption,"%s",szResult);
endif;
end;
As I did not found out for the moment how to debug install scripts I only can accept thath it seem for me that the script is never called. (I call it via an custom action Type 65744)
3. I used the spy programm.
The spy programm works very well. It finds out all nessesary components and registry entries. It also recognizes the service. But if i try the load the script.inc File into the iswi it brings me an error message. (Service could not be loaded ). If I make out of the result an setup all is being installed correctly even the service. The only problem is that the service can not be started.
Let me know if you find out a working way.
Posted 13 January 2002 - 10:32
Use SetupCopyOEMInf to copy the inf file to the system, To actually install the driver as per the specs in the inf file, use the DDK interface methods. I have outlined the skeleton of the calls I made for installing a network driver.
INetCfg*pNetCfg = NULL;
hResult = CoInitializeEx(NULL,COINIT_DISABLE_OLE1DDE | COINIT_APARTMENTTHREADED );
bResult = SetupCopyOEMInf(szINFFullPath,szInstallDir,SPOST_PATH,SP_COPY_DELETESOURCE,szInfNameAfterC
opy,MAX_PATH,NULL,NULL);
hResult = CoCreateInstance(CLSID_CNetCfg,NULL,CLSCTX_INPROC_SERVER,IID_INetCfg,(void **)&pNetCfg);
hResult = pNetCfg->QueryInterface(IID_INetCfgLock,(LPVOID *)&pncLock);
hResult = pncLock->AcquireWriteLock(2000, L"CustomDriver",(LPWSTR *)wsLockingApp);
hResult = pNetCfg->Initialize(NULL);
hResult = pNetCfg->QueryNetCfgClass(&GUID_DEVCLASS_NETTRANS,IID_INetCfgClassSetup,(void **)&pncSetup);
hResult = pncSetup->Install(L"ms_packet",&oboToken,NSF_POSTSYSINSTALL,0,NULL,NULL,&
amp;pncComponent);
hResult = pncSetup->Release();
hResult = pNetCfg->Apply();
hResult = pNetCfg->Uninitialize();
hResult = pncLock->ReleaseWriteLock();
pNetCfg->Release();
CoUninitialize();