cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ebaichtal
Level 3

Add a modem

What is the best approach to add a modem in Windows XP/Vista using InstallShield 2008?

I write InstallScript code, etc. and if that is the best way, just point me at some functions, thanks!

-Ed
Labels (1)
0 Kudos
(5) Replies
ebaichtal
Level 3

Any place to start with InstallShield? Or do I have to write a separate app to install the modem driver?

-Ed
0 Kudos
TheTraveler
Level 8

I used this piece of code to load a USB dongle which required a specific driver. So you will need to replace the appropriate parameters for you modem.

Let me know if this works for you.


external prototype BOOL NewDev.UpdateDriverForPlugAndPlayDevicesA(HWND, // HWND hwndParent,
BYVAL STRING, // LPCTSTR HardwareId,
BYVAL STRING, // LPCTSTR FullInfPath,
LONG, // DWORD InstallFlags,
POINTER // PBOOL bRebootRequired OPTIONAL
);

function OnFirstUIAfter()
STRING strFileName;
STRING strTemp;
NUMBER nResult;
NUMBER nHwnd;
begin
strFileName = WINSYSDIR ^ "NewDev.dll";
strTemp = WINDIR ^ "INF\\DS24902k.inf";
nResult = UseDLL(strFileName);
if (nResult = 0) then
nHwnd = GetWindowHandle (HWND_INSTALL);
bResult = UpdateDriverForPlugAndPlayDevicesA(nHwnd,
"USB\\VID_04FA&PID_2490",
strTemp,
1,
NULL);
UnUseDLL(strFileName);
endif;
end;
0 Kudos
ebaichtal
Level 3

Hmm this looks good. But I will need to install the modem INF file, and also tell it what COM port to use. (And probably design a dialog box to ask for that, but I've got that part down.)

Don't suppose there is a pre-existing function for taking a COM port parameter? Or modem specific INF installation in InstallShield?

-Ed
0 Kudos
ebaichtal
Level 3

I've looked through a lot of various places on the net, and found rundll32.exe calling modem.cpl, but can't seem to make it work in XP and Vista to point at a COM port.

I just need to install an existing modem driver and point it to a COM port that a user selects. I'm sure people have done it before, but what is the simplest/common method?

-Ed
0 Kudos
ebaichtal
Level 3

Found the solution: http://support.microsoft.com/kb/304294
The Windows DDK (now WDK) is needed to compile it.

And then do a LaunchAppandWait with: "mdminst c:\mdmgen.inf COM3 mdmgen336"

There ya go.

-Ed
0 Kudos