Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Question regarding on how to do an NDIS Driver installation using NSIS

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi,

I am new to this listserv so if this is not the appropriate forum please
let me know. I had been tasked with the installation script with the
software my company makes. For the most part I have no issues.
Now we are making custom drivers (in the past we used third party
installers with their own installer so using an execwait command was
fine).

While the driver itself hasn't been signed yet and I am aware of the
issues with Windows 7 x64, we are getting that handled.

But, how do I install the driver install, and how do I activate it? I
assume it will need to be activated for all network devices?

Which API do I need to make use off in order to do so? Does a system
reboot required?

I think when I ran the pnputil -a foo.inf from command prompt, it
installed it, but didn't activate it. Like I had to manually locate it in
the device properties itself.

I think this driver is a "netfilter" I am not totally sure because I do IT
work and I just develop the software installer routine not the actual
software itself and the developers aren't telling me much about the driver
itself.

Any advice is greatly appreciated.

Thanks.
«1

Comments

  • Paul_McDonoughPaul_McDonough Member Posts: 111
    netcfg [-v] [-e] [-winpe] [-l ] -c

    -i


    No idea why it's not "active" based on what you provided. Could be any
    number of things. But you should probably get some more details from the
    developers because they might have created some type of activate/deactivate
    scheme.

    Google is also your friend
    http://msdn.microsoft.com/en-us/library/windows/hardware/ff565517(v=vs.85).aspx
    http://www.osronline.com/showThread.cfm?link=81194


    On Thu, Sep 11, 2014 at 3:15 PM, Jonathan Weinraub <
    [email protected]> wrote:

    > Hi,
    >
    > I am new to this listserv so if this is not the appropriate forum please
    > let me know. I had been tasked with the installation script with the
    > software my company makes. For the most part I have no issues.
    > Now we are making custom drivers (in the past we used third party
    > installers with their own installer so using an execwait command was fine).
    >
    > While the driver itself hasn't been signed yet and I am aware of the
    > issues with Windows 7 x64, we are getting that handled.
    >
    > But, how do I install the driver install, and how do I activate it? I
    > assume it will need to be activated for all network devices?
    >
    > Which API do I need to make use off in order to do so? Does a system
    > reboot required?
    >
    > I think when I ran the pnputil -a foo.inf from command prompt, it
    > installed it, but didn't activate it. Like I had to manually locate it in
    > the device properties itself.
    >
    > I think this driver is a "netfilter" I am not totally sure because I do IT
    > work and I just develop the software installer routine not the actual
    > software itself and the developers aren't telling me much about the driver
    > itself.
    >
    > Any advice is greatly appreciated.
    >
    > Thanks.
    >
    >
    > --- NTDEV is sponsored by OSR Visit the list at:
    > http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
    > http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
    > other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
    > the List Server section of OSR Online at
    > http://www.osronline.com/page.cfm?name=ListServer

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hmm ok.
    Is there any API I can make use of (NSIS can make use of dll calls to
    system32.dll and the alike if you're not familiar with it)
    Rather than doing execwait commands?

    But I will try to find out more from them. Thanks.



    From: Paul
    To: "Windows System Software Devs Interest List"
    Date: 11/09/2014 22:14
    Subject: Re: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    netcfg [-v] [-e] [-winpe] [-l ] -c

    -i


    No idea why it's not "active" based on what you provided. Could be any
    number of things. But you should probably get some more details from the
    developers because they might have created some type of
    activate/deactivate scheme.

    Google is also your friend
    http://msdn.microsoft.com/en-us/library/windows/hardware/ff565517(v=vs.85).aspx
    http://www.osronline.com/showThread.cfm?link=81194


    On Thu, Sep 11, 2014 at 3:15 PM, Jonathan Weinraub <
    [email protected]> wrote:
    Hi,

    I am new to this listserv so if this is not the appropriate forum please
    let me know. I had been tasked with the installation script with the
    software my company makes. For the most part I have no issues.
    Now we are making custom drivers (in the past we used third party
    installers with their own installer so using an execwait command was
    fine).

    While the driver itself hasn't been signed yet and I am aware of the
    issues with Windows 7 x64, we are getting that handled.

    But, how do I install the driver install, and how do I activate it? I
    assume it will need to be activated for all network devices?

    Which API do I need to make use off in order to do so? Does a system
    reboot required?

    I think when I ran the pnputil -a foo.inf from command prompt, it
    installed it, but didn't activate it. Like I had to manually locate it in
    the device properties itself.

    I think this driver is a "netfilter" I am not totally sure because I do IT
    work and I just develop the software installer routine not the actual
    software itself and the developers aren't telling me much about the driver
    itself.

    Any advice is greatly appreciated.

    Thanks.


    --- NTDEV is sponsored by OSR Visit the list at:
    http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
    http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
    other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
    the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer

    --- NTDEV is sponsored by OSR Visit the list at:
    http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
    http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
    other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
    the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,282
    Jonathan Weinraub wrote:
    >
    > I am new to this listserv so if this is not the appropriate forum
    > please let me know. I had been tasked with the installation script
    > with the software my company makes. For the most part I have no issues.
    > Now we are making custom drivers (in the past we used third party
    > installers with their own installer so using an execwait command was
    > fine).
    >
    > While the driver itself hasn't been signed yet and I am aware of the
    > issues with Windows 7 x64, we are getting that handled.
    >
    > But, how do I install the driver install, and how do I activate it? I
    > assume it will need to be activated for all network devices?
    >
    > Which API do I need to make use off in order to do so? Does a system
    > reboot required?
    >
    > I think when I ran the pnputil -a foo.inf from command prompt, it
    > installed it, but didn't activate it. Like I had to manually locate
    > it in the device properties itself.
    >
    > I think this driver is a "netfilter" I am not totally sure because I
    > do IT work and I just develop the software installer routine not the
    > actual software itself and the developers aren't telling me much about
    > the driver itself.

    If you have a driver development team, it's their responsibility to tell
    you how to install it. There are several good tools for doing driver
    installation, but each type of driver has its own unique quirks. I'm
    not a network guy, so I don't know what the implications of a
    "netfilter" installer are. However, your team should know.

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    I am not familiar with what a ?netfilter? is.



    Is this a NDIS6 LWF ?filter?, an NDIS5 IM ?filter?, a WFP callout ?filter?
    or something altogether different?



    Does this have an associated PnP INF of class ?NetService?? If so you can
    install it with DIFXAPI or DIFXAPP or you can look at the BindView sample in
    the WDK (or dig up the snetcfg / netcfg sample from the W2K DDK) to see how
    to go about this with direct API calls.



    Keep in mind that NSIS is typically run as a 32-bit process but that NETCFG
    operations (or calls into DIFXAPI) must come from a ?native? process.



    As Tim said, ask your driver developer. I would hope that he or she knows
    at least one way to install it.



    This list has a number of threads in the history regarding installing IM
    filters and other NetService components with NSIS, DIFXAPI, and DIFXAPP.
    I suggest you search the list archives after you get some better guidance
    from the driver dev.



    Good Luck,

    Dave Cattley
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Yes i believe it is NDIS6. It's like winpcap does. It's used for 10 gbps data transfers. The dev more or less says I don't know. It's your job to install. They're manually doing it now. When I get back to my desk I'll try to find more info. Thanks for the nudging in the right direction.

    --
    Sent from my iPhone

    > On 12 Sep 2014, at 15:03 , "Dave Cattley" wrote:
    >
    > I am not familiar with what a ‘netfilter’ is.
    >
    > Is this a NDIS6 LWF ‘filter’, an NDIS5 IM ‘filter’, a WFP callout ‘filter’ or something altogether different?
    >
    > Does this have an associated PnP INF of class “NetService”? If so you can install it with DIFXAPI or DIFXAPP or you can look at the BindView sample in the WDK (or dig up the snetcfg / netcfg sample from the W2K DDK) to see how to go about this with direct API calls.
    >
    > Keep in mind that NSIS is typically run as a 32-bit process but that NETCFG operations (or calls into DIFXAPI) must come from a ‘native’ process.
    >
    > As Tim said, ask your driver developer. I would hope that he or she knows at least one way to install it.
    >
    > This list has a number of threads in the history regarding installing IM filters and other NetService components with NSIS, DIFXAPI, and DIFXAPP. I suggest you search the list archives after you get some better guidance from the driver dev.
    >
    > Good Luck,
    > Dave Cattley
    >
    > ---
    > NTDEV is sponsored by OSR
    >
    > Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
    >
    > OSR is HIRING!! See http://www.osr.com/careers
    >
    > For our schedule of WDF, WDM, debugging and other seminars visit:
    > http://www.osr.com/seminars
    >
    > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    > The dev more or less says I don't know. It's your job to install. They're manually doing it now.



    Two things.



    1. Exactly what is involved in manually installing it.

    2. Get new devs. :)



    Winpcap is an NDIS protocol. Maybe it has been updated to a LWF for NT6, not sure. Last I knew it was still an OSS project. Unless you are constrained by OSS blinders (not unreasonable) go look at it. That installer works just fine.



    Regards,

    Dave Cattley
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    It isnt much.,
    But this is the info I received today.
    They are based in eastern europe so there is always a time
    difference/delay.


    1. Microsoft example -
    http://code.msdn.microsoft.com/windowshardware/Bindview-ec8f6e0a
    2..PCAUsa example -
    http://www.ndis.com/ndis-general/ndisinstall/programinstall.htm

    The 10g driver doesn't work with Windows 8.0, there is a bug in Windows
    8.0 related to these type of drivers. The bug was fixed in Windows 8.1
    So the driver works on Windows Vista, Windows 7 and Windows 8.1

    It adds it as a network service in the device properties after it got
    installed, when I did so, it was manually.

    If I can ask them a more direct question that can aid you in aiding me,
    please let me know.

    Thanks!

    -jon





    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 12/09/2014 19:02
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    > The dev more or less says I don't know. It's your job to install.
    They're manually doing it now.

    Two things.

    1. Exactly what is involved in manually installing it.
    2. Get new devs. J

    Winpcap is an NDIS protocol. Maybe it has been updated to a LWF for NT6,
    not sure. Last I knew it was still an OSS project. Unless you are
    constrained by OSS blinders (not unreasonable) go look at it. That
    installer works just fine.

    Regards,
    Dave Cattley

    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    Does the component have an INF file? What class (look for Class= .... ) is it? Net, NetService, NetTrans, NetClient, something else?


    For NetService, NetTrans, and NetClient then look at the BindView sample or use DIFXAPI (or DIFXAPP if you are installing from an MSI package). Or if you just want to exec some command line that will work use NETCFG.EXE (inbox utility on Vista+)


    netcfg [-v] [-e] [-winpe] [-l <full-path-to-component-INF>] -c <p|s|c> -i <comp-id>

    -winpe installs TCP/IP, NetBIOS and Microsoft Client for Windows preinstallation envrionment
    -l provides the location of INF
    -c provides the class of the component to be installed (p == Protocol, s == Service, c == Client)
    -i provides the component ID

    The arguments must be passed in the order shown.

    Examples:
    netcfg -l c:\oemdir\foo.inf -c p -i foo
    ...installs protocol 'foo' using c:\\oemdir\\foo.inf

    netcfg -c s -i MS_Server
    ...installs service 'MS_Server'

    OR

    netcfg [-v] -winpe
    Examples:
    netcfg -v -winpe
    ...Installs TCP/IP, NetBIOS and Microsoft Client for Windows preinstallation environment

    OR

    netcfg [-v] -q <comp-id>
    Example:
    netcfg -q MS_IPX
    ...displays if component 'MS_IPX' is installed

    OR

    netcfg [-v] [-e] -u <comp-id>
    Example:
    netcfg -u MS_IPX
    ...uninstalls component 'MS_IPX'

    OR

    netcfg [-v] -s <a|n>
    where,
    -s\tprovides the type of components to show
    \ta == adapters, n == net components
    Examples:
    netcfg -s n
    ...shows all installed net components

    OR

    netcfg [-v] -b <comp-id>
    Examples:
    netcfg -b ms_tcpip
    ...shows binding paths containing 'MS_TCPIP'


    General Notes:\n"
    -v Run in verbose (detailed) mode
    -e Use servicing environment variables during install and uninstall
    -? Displays this help information



    My question to you was how do they (the devs) install it. Do they use BindView? Do they use the NDIS.COM sample installer? Have you installed the driver manually? How do you do it?


    Good Luck,

    Dave Cattley
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Yes it does.

    Class = NetService

    Unfortunately the installer is HUGE and invested too much time (amount of
    lines) and at this point I rather not dedicate a lot of time in converting
    it to msi/installshield. At the time, when this was more manageable the
    freeness of nsis was what I needed and this project sorta snowballed when
    it became my problem.

    When I was playing with it earlier, I found if i had I think more than 4
    services it wouldn't let me add a fifth (the filter they made). Is this a
    hard limit set by microsoft?
    I assume it will be too difficult to install the filter only on 10 gbps
    cards opposed to all cards?

    Is there an easy way to install without using an executable?
    The installer obviously already takes into account it is an admin user
    installing it.
    I assume there will be some sort of return code?

    I am used to access the system items in nsis like this

    System::Call 'shell32.dll::SHCHangeNotify(i, i, i, i) v
    (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)
    Or regsvr32 style by using the nsis regdll "foo.dll";

    So if there is a way to install the driver in a similar fashion, that can
    be very useful.

    Otherwise, if the netcfg is the only way, then I will need to play around
    with that too.

    Obviously i have code that checks operating systems. I believe we are no
    longer allowing XP for our software.
    Windows 7 x86/x64 installs appropriate version automatically. (nothing
    really gets registered in other than the system environment path and
    associated files). And the x64 is just x64 bit dlls but its in the
    program path, doesnt get registered nor copied to system32.

    There is one version of the actual file, so i assume its 32-bit that will
    get installed on 64-bit systems. They are still getting the digital
    signature stuff sorted out for the x64 win 7.
    Right now there is the foo.cat, foo.inf, and foo.sys.

    Sorry for making this such a long winded response just trying to make sure
    this is done correctly as the deadline is looming.

    Thanks.






    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 16/09/2014 12:00
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    Does the component have an INF file? What class (look for Class= .... )
    is it? Net, NetService, NetTrans, NetClient, something else?


    For NetService, NetTrans, and NetClient then look at the BindView sample
    or use DIFXAPI (or DIFXAPP if you are installing from an MSI package). Or
    if you just want to exec some command line that will work use NETCFG.EXE
    (inbox utility on Vista+)


    netcfg [-v] [-e] [-winpe] [-l ] -c

    -i


    -winpe installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation envrionment
    -l provides the location of INF
    -c provides the class of the component to be installed (p ==
    Protocol, s == Service, c == Client)
    -i provides the component ID

    The arguments must be passed in the order shown.

    Examples:
    netcfg -l c:\oemdir\foo.inf -c p -i foo
    ...installs protocol 'foo' using c:\\oemdir\\foo.inf

    netcfg -c s -i MS_Server
    ...installs service 'MS_Server'

    OR

    netcfg [-v] -winpe
    Examples:
    netcfg -v -winpe
    ...Installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation environment

    OR

    netcfg [-v] -q
    Example:
    netcfg -q MS_IPX
    ...displays if component 'MS_IPX' is installed

    OR

    netcfg [-v] [-e] -u
    Example:
    netcfg -u MS_IPX
    ...uninstalls component 'MS_IPX'

    OR

    netcfg [-v] -s
    where,
    -s\tprovides the type of components to show
    \ta == adapters, n == net components
    Examples:
    netcfg -s n
    ...shows all installed net components

    OR

    netcfg [-v] -b
    Examples:
    netcfg -b ms_tcpip
    ...shows binding paths containing 'MS_TCPIP'


    General Notes:\n"
    -v Run in verbose (detailed) mode
    -e Use servicing environment variables during install and uninstall
    -? Displays this help information



    My question to you was how do they (the devs) install it. Do they use
    BindView? Do they use the NDIS.COM sample installer? Have you
    installed the driver manually? How do you do it?


    Good Luck,

    Dave Cattley
    ---
    NTDEV is sponsored by OSR

    Visit the list at:
    http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer

  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    > Class = NetService


    So your options are:


    1. Write INetCfgXxx code as demonstrated in BindView (or other samples)

    2. Use a ready command line tool like NETCFG.EXE on Vista+

    3. Use DIXAPI.DLL and call it from your NSIS installer


    > When I was playing with it earlier, I found if i had I think more than
    > 4 services it wouldn't let me add a fifth (the filter they made). Is
    > this a hard limit set by microsoft?


    Did it give you some sort of error code? Have you looked at the value of


    HKLM\System\CurrentControlSet\Control\Network::MaxNumFilters ?


    See: http://support.microsoft.com/kb/2530477 for some official information or search of "MaxNumFilters" and read all about everyone complaining.


    > I assume it will be too difficult to install the filter only on 10 gbps
    > cards opposed to all cards?


    No, not difficult at all. You need to write a NotifyObject and have it simply decide whether or not to permit or reject a particular binding to an adapter based on whatever criterion you decide. There is a sample NotifyObject in the WDK.


    > Is there an easy way to install without using an executable?


    No. The only way that the APIs that manipulate anything in the system, especially the Network Configuration (NETCFG) is to run an executable. Your NSIS installer is an executable right?


    > The installer obviously already takes into account it is an admin user
    > installing it.


    Good because it will need to be running elevated to work.


    > I assume there will be some sort of return code?


    From what?


    > I am used to access the system items in nsis like this
    >
    > System::Call 'shell32.dll::SHCHangeNotify(i, i, i, i) v
    > (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)
    > Or regsvr32 style by using the nsis regdll "foo.dll";


    Sadly I understood that line of code.


    > So if there is a way to install the driver in a similar fashion, that
    > can be very useful.


    Yes, use NSIS to exec NETCFG.EXE with the appropriate command line parameters, capture the output, wait for the exit status, and hope for the best. Uninstall is similar.


    > Obviously i have code that checks operating systems. I believe we are
    > no longer allowing XP for our software.


    Is the NetService an NDIS6 driver? Then it does not work on XP. Do you have a NetService that is NDIS5?


    > There is one version of the actual file, so i assume its 32-bit that
    > will get installed on 64-bit systems. They are still getting the
    > digital signature stuff sorted out for the x64 win 7.
    > Right now there is the foo.cat, foo.inf, and foo.sys.


    FOO.SYS cannot possibly be made to run (same binary) on two different architectures. Your less than helpful devs have given you the x86 (32-bit) driver. You will be getting set for x64. Or alternatively (depending on the INF) you will be getting a single INF, CAT, and two SYS files.


    Which brings me to re-iterate a very important point: Whatever process that eventually calls the INetCfgXXX APIs to install this driver *MUST* be running native code. So 32-bit NSIS on an x64 system making System::Call 'blah' just won't do unless 'blah' is some DLL you write that figures out a way to ship the request off to some native (x64) helper process that actually does the work.


    So if you are believing you will have a single NSIS installer that automagically figures out how to install on x86 (native) and x64 (from WOW64), you will need a scheme to run the actually install action as native code.


    Here is a big hint: Imagine a 32-bit DLL that exports NSIS compatible entry points but that wraps an RPC interface to a helper EXE process (which is native code, so you have two of them) which actually makes the installer calls. DIFXAPI.DLL has a reasonable set of APIs for doing this install at a very high level but if you want ultimate control then INetCfgXXX and SETUPAPI is the lower level. I have built all of those and can tell you that after all that, I migrated to MSI as fast as I could.


    > Sorry for making this such a long winded response just trying to make
    > sure this is done correctly as the deadline is looming.


    I hope that deadline planning included testing. Getting this right is notoriously time consuming and the edge cases around upgrade can be very tricky depending on your requirements.


    Good Luck,

    Dave Cattley
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    The devs install it by going into control panel and install it as a
    service.

    I got this from them:

    B. Driver install
    The new driver is a NDIS 6.0 driver, so it cannot be installed on
    WindowsXP. For Vista and newer systems the steps are:
    1. Open the Network and Sharing Center Window
    2. Open a Properties window for any of the ethernet adapters, it doesn't
    matter which one. It should look like this
    3. Press the Install... button. You should see a window like this one
    4. Select Service and pres Add...
    5. Press the Have Disk... button , browse for blarg.inf and press OK. You
    should see a window like the following one
    6.Press OK. You should see a security confirmation window like this one
    (this will go away as Jim is getting it signed today)
    7. Press Install this driver anyway
    8. If everything worked you should see the installed driver in the
    Properties window


    My understanding is they have separate versions of the dll thats for x86
    and x64.
    Nsis automatically installs the x64 depending on which OS is automatically
    detected.
    The binary of the setup.exe is 32-bit regardless since it just extracts
    the internal bz2 file and interprets the script to process and do what it
    says.

    Then obviously the uninstlal can do the inverse.

    Running a system call is most likely the easiest.
    I meant about return code is whether or not it reurns a value i can
    capture so i can say if $ret = ( system("netcfg -l foo.inf..")) == 0; then
    cout << "success"; else if (ret == 1) cerr << "too bad, error: " ret.foo;
    or something, sorry for the silly nonsensical psuedocode
    Since it just runs i may have to capture just the stdout into a var?
    But regardless, this is sorta why i wanted an internal function opposed to
    executable to process the driver install.

    I hope this was more useful the information i provided this time.

    Thanks.

    Jon



    From: Dave Cattley <[email protected]>
    To: "Windows System Software Devs Interest List"
    Date: 16/09/2014 12:00
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    Does the component have an INF file? What class (look for Class= .... )
    is it? Net, NetService, NetTrans, NetClient, something else?


    For NetService, NetTrans, and NetClient then look at the BindView sample
    or use DIFXAPI (or DIFXAPP if you are installing from an MSI package). Or
    if you just want to exec some command line that will work use NETCFG.EXE
    (inbox utility on Vista+)


    netcfg [-v] [-e] [-winpe] [-l ] -c

    -i


    -winpe installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation envrionment
    -l provides the location of INF
    -c provides the class of the component to be installed (p ==
    Protocol, s == Service, c == Client)
    -i provides the component ID

    The arguments must be passed in the order shown.

    Examples:
    netcfg -l c:\oemdir\foo.inf -c p -i foo
    ...installs protocol 'foo' using c:\\oemdir\\foo.inf

    netcfg -c s -i MS_Server
    ...installs service 'MS_Server'

    OR

    netcfg [-v] -winpe
    Examples:
    netcfg -v -winpe
    ...Installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation environment

    OR

    netcfg [-v] -q
    Example:
    netcfg -q MS_IPX
    ...displays if component 'MS_IPX' is installed

    OR

    netcfg [-v] [-e] -u
    Example:
    netcfg -u MS_IPX
    ...uninstalls component 'MS_IPX'

    OR

    netcfg [-v] -s
    where,
    -s\tprovides the type of components to show
    \ta == adapters, n == net components
    Examples:
    netcfg -s n
    ...shows all installed net components

    OR

    netcfg [-v] -b
    Examples:
    netcfg -b ms_tcpip
    ...shows binding paths containing 'MS_TCPIP'


    General Notes:\n"
    -v Run in verbose (detailed) mode
    -e Use servicing environment variables during install and uninstall
    -? Displays this help information



    My question to you was how do they (the devs) install it. Do they use
    BindView? Do they use the NDIS.COM sample installer? Have you
    installed the driver manually? How do you do it?


    Good Luck,

    Dave Cattley
    ---
    NTDEV is sponsored by OSR

    Visit the list at:
    http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    When it comes to installers I've found you often need both dev and sysadmin knowledge: devs tend not to spot bad installers and go with the simplest option, while ops don't know enough about how the software works. After a bit of a fight I've managed to banish NSIS from installers I maintain - we were using the non-Unicode version and after a bit of prodding I found a bug that caused the entire contents of C:\ to be recursively deleted. MSI might be more difficult to learn, but it seems so much nicer after that!

    --
    Bruce

    > On Sep 12, 2014, at 5:02 PM, Dave Cattley wrote:
    >
    > > The dev more or less says I don't know. It's your job to install. They're manually doing it now.
    >
    > Two things.
    >
    > 1. Exactly what is involved in manually installing it.
    > 2. Get new devs. J
    >
    > Winpcap is an NDIS protocol. Maybe it has been updated to a LWF for NT6, not sure. Last I knew it was still an OSS project. Unless you are constrained by OSS blinders (not unreasonable) go look at it. That installer works just fine.
    >
    > Regards,
    > Dave Cattley
    >
    > ---
    > NTDEV is sponsored by OSR
    >
    > Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
    >
    > OSR is HIRING!! See http://www.osr.com/careers
    >
    > For our schedule of WDF, WDM, debugging and other seminars visit:
    > http://www.osr.com/seminars
    >
    > To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,282
    On Sep 23, 2014, at 8:30 PM, Bruce Cran > wrote:

    .... After a bit of a fight I've managed to banish NSIS from installers I maintain - we were using the non-Unicode version and after a bit of prodding I found a bug that caused the entire contents of C:\ to be recursively deleted. MSI might be more difficult to learn, but it seems so much nicer after that!

    Are you saying NSIS has a bug that caused this, or that one of your people wrote an installer with a bug that caused this? I?m a huge fan of NSIS, and it seems a little unfair to blame the tool for a script error. You can mangle your hard disk in virtually any language.
    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    If you will ever want to use DIFXAPP or DIFXAPI you must ask the dev team to
    add a line to the INF



    [Version]

    ?

    DriverPackageType=Network





    They have to do this before the driver package is WHQL signed since changing
    the INF will invalidate previous submission testing.



    So as far as NETCFG.EXE returning a value - you can easily test this. I?m
    pretty sure it does at least tell you success or failure and possibly even
    more fine-grained.



    Did you try NETCFG instead of the GUI process?



    You might also look at the sample in the WDK named DIFXCMD. You can adapt
    it to return whatever you want.



    Good Luck,

    Dave Cattley
  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    >? I?m a huge fan of NSIS, and it seems a little unfair to blame the tool
    for a script error. You can mangle your hard disk in virtually any
    language.



    +1



    (though I am perhaps not a huge fan, just a fan.)



    Dave Cattley
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    My understanding they got the files signed yesterday successfully.
    I will ask them about difxapp.
    What exactly is that in a way i can tell the dev besides a driver
    installation framework? How is it different than the netcfg method i will
    probably be ending up using?
    thanks



    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 24/09/2014 08:19
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    If you will ever want to use DIFXAPP or DIFXAPI you must ask the dev team
    to add a line to the INF

    [Version]
    ?
    DriverPackageType=Network


    They have to do this before the driver package is WHQL signed since
    changing the INF will invalidate previous submission testing.

    So as far as NETCFG.EXE returning a value - you can easily test this.
    I?m pretty sure it does at least tell you success or failure and possibly
    even more fine-grained.

    Did you try NETCFG instead of the GUI process?

    You might also look at the sample in the WDK named DIFXCMD. You can
    adapt it to return whatever you want.

    Good Luck,
    Dave Cattley

    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Besides nsis being free, i don't mind the msi curveball/learning curve. I
    was liking the idea to make an msi installer for some time but as ther
    script got complex as it did, i just got lazy (since this isn't my primary
    responsibility)

    But i agree with Tim, I would never use recursive deletions on
    directories.
    I've learned my lesson in linux far too many times!





    From: Tim Roberts
    To: "Windows System Software Devs Interest List"
    Date: 24/09/2014 02:03
    Subject: Re: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    On Sep 23, 2014, at 8:30 PM, Bruce Cran wrote:

    .... After a bit of a fight I've managed to banish NSIS from installers I
    maintain - we were using the non-Unicode version and after a bit of
    prodding I found a bug that caused the entire contents of C:\ to be
    recursively deleted. MSI might be more difficult to learn, but it seems so
    much nicer after that!

    Are you saying NSIS has a bug that caused this, or that one of your people
    wrote an installer with a bug that caused this? I?m a huge fan of NSIS,
    and it seems a little unfair to blame the tool for a script error. You
    can mangle your hard disk in virtually any language.
    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.


    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Not yet, the Florida office got the drivers signed so once I get them I
    will try the netcfg method from the command line for both x86 and x64.




    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 24/09/2014 08:19
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    If you will ever want to use DIFXAPP or DIFXAPI you must ask the dev team
    to add a line to the INF

    [Version]
    ?
    DriverPackageType=Network


    They have to do this before the driver package is WHQL signed since
    changing the INF will invalidate previous submission testing.

    So as far as NETCFG.EXE returning a value - you can easily test this.
    I?m pretty sure it does at least tell you success or failure and possibly
    even more fine-grained.

    Did you try NETCFG instead of the GUI process?

    You might also look at the sample in the WDK named DIFXCMD. You can
    adapt it to return whatever you want.

    Good Luck,
    Dave Cattley

    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    On 9/24/2014 12:03 AM, Tim Roberts wrote:
    > On Sep 23, 2014, at 8:30 PM, Bruce Cran <mailto:[email protected]>> wrote:
    >
    >> .... After a bit of a fight I've managed to banish NSIS from
    >> installers I maintain - we were using the non-Unicode version and
    >> after a bit of prodding I found a bug that caused the entire contents
    >> of C:\ to be recursively deleted. MSI might be more difficult to
    >> learn, but it seems so much nicer after that!
    >
    > Are you saying NSIS has a bug that caused this, or that one of your
    > people wrote an installer with a bug that caused this? I’m a huge fan
    > of NSIS, and it seems a little unfair to blame the tool for a script
    > error. You can mangle your hard disk in virtually any language.

    I think it was an NSIS bug - or at least a bug in the theme we were
    using, which can be found via the NSIS site. Normally, if you try and
    install to C:\ it will change the install directory to C:\ProductName\,
    but if you enter Unicode characters it can end up not creating the
    product directory and installing files to C:\ instead. But yes, it did
    end up being a problem with our script since it shouldn't have been
    trying to recursively delete a directory. I just think that NSIS makes
    it easier to make mistakes since it's relatively low level and
    installers can often end up depending on plugins of questionable quality.

    --
    Bruce
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    On 9/24/2014 7:06 AM, Jonathan Weinraub wrote:
    > Besides nsis being free, i don't mind the msi curveball/learning curve.

    If you ever do want to create MSI packages, the WiX Toolset is free and
    open source too: http://wixtoolset.org/ .

    --
    Bruce
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I had actually downloaded that but never got around to learn it.
    But since I am not the developer, I won't be using Visual Studio.
    I use HM Edit for NSIS as my IDE.

    My only requirements that caused me to really put the kibosh on it was the
    custom things I had made.

    I had designed a few plugins (dlls) that is pretty much done in pure Win32
    C that graphically shows a dialogue box that behaves in a strict manner
    that NSIS dialogues wouldnt do, so i made it myself in C.
    There are two such dialogues. If I can make a custom MessageBox that just
    returns values, that a functin calling it can handle then, yay!

    I have extensive OS requirements that get checked before loading.
    Depending if it is say XP, 2000, 7, 8, and 32 or 64 bit of each it can do
    certain things at certain times.
    Including now with the restrictions on this service I am trying to get
    done that works on 7 and 8.1 but not 8.0.
    Obviously standard stuff if the process is already running it shouldn't be
    installed until it is closed.
    Uninstalling previous version first.
    That refresh shell icon I did earlier.

    Determining which .NET is installed and install it if necessary. All
    files are included in the disc because the software assumes there is no
    internet access.
    Hwoever, it does add extensive (advanced) firewall rules programmatically
    as well.

    Making file associations with custom document icon.
    Registers a few dll's and of course uninstall will need to reverse this
    with the uinstaller program.
    Makes icons for all users rather than current user.
    So while most of it is run in the mill, there is some significant
    functionality I will need to find new ways of doing.

    Now I don't have the time since I have some major projects scheduled, but
    once that is done, I will certainly try to find new ways of making the
    msi.

    As it stands, my nsi script is little over a thousand lines of code.
    Not including any attached functions/headers

    While free isn't a requirement, I can certainly switch to InstallShield if
    need be if it means it is the better solution for us.

    I like nsis not only because its free and its robust community, but also
    because the installers are superior in speed compared to the older
    installshield that my predecessor did back in the day (it might have been
    3 or 4.0 days for IS)

    Thanks.

    jon





    From: Bruce Cran
    To: "Windows System Software Devs Interest List"
    Date: 24/09/2014 11:00
    Subject: Re: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    On 9/24/2014 7:06 AM, Jonathan Weinraub wrote:
    > Besides nsis being free, i don't mind the msi curveball/learning curve.

    If you ever do want to create MSI packages, the WiX Toolset is free and
    open source too: http://wixtoolset.org/ .

    --
    Bruce

    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,282
    Bruce Cran wrote:
    > On 9/24/2014 7:06 AM, Jonathan Weinraub wrote:
    >> Besides nsis being free, i don't mind the msi curveball/learning curve.
    > If you ever do want to create MSI packages, the WiX Toolset is free and
    > open source too: http://wixtoolset.org/ .

    I did try to climb aboard that bandwagon. I actually ported one of my
    installers to WiX and got it mostly working. It just seemed a lot more
    opaque. I recognize that is an unfair snap judgment based on my
    inexperience, and if NSIS exploded tomorrow, I'd jump right on WiX.

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Don_BurnDon_Burn Member - All Emails Posts: 1,760
    Tim,

    I had similar experiences with WiX, sorta mostly kinda working, but
    never something I would ship. NSIS worked out of the starting gate, and was
    a lot easier to use. Interestingly enough, I have never had a complaint
    from clients when I use NSIS, but have been told multiple times "NO WiX".


    Don Burn
    Windows Filesystem and Driver Consulting
    Website: http://www.windrvr.com




    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]] On Behalf Of Tim Roberts
    Sent: Wednesday, September 24, 2014 12:22 PM
    To: Windows System Software Devs Interest List
    Subject: Re: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS

    Bruce Cran wrote:
    > On 9/24/2014 7:06 AM, Jonathan Weinraub wrote:
    >> Besides nsis being free, i don't mind the msi curveball/learning curve.
    > If you ever do want to create MSI packages, the WiX Toolset is free
    > and open source too: http://wixtoolset.org/ .

    I did try to climb aboard that bandwagon. I actually ported one of my
    installers to WiX and got it mostly working. It just seemed a lot more
    opaque. I recognize that is an unfair snap judgment based on my
    inexperience, and if NSIS exploded tomorrow, I'd jump right on WiX.

    --
    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.


    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    On 9/24/2014 10:21 AM, Tim Roberts wrote:
    > I did try to climb aboard that bandwagon. I actually ported one of my
    > installers to WiX and got it mostly working. It just seemed a lot more
    > opaque. I recognize that is an unfair snap judgment based on my
    > inexperience, and if NSIS exploded tomorrow, I'd jump right on WiX.

    It _is_ opaque, and that to me is one of the main advantages. For
    example Windows Installer will handle moving the installation directory
    if a user chooses a different one during a modify/upgrade scenario -
    testing the latest NSIS installer, it forgets about that and instead
    orphans the old installation. The main problem with Windows Installer
    is that it's almost entirely a new system to learn (install sequences,
    component rules etc.), whereas NSIS is familiar to most people who have
    done Windows programming and a bit of scripting.

    --
    Bruce
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Hi,

    Sorry for taking so long to answer again. This is what I did.


    C:\temp>netcfg -l foo.inf -c s -i foo -v
    Trying to install foo ...

    ...foo.inf was copied to C:\Windows\INF\oem162.inf.

    ...done.

    And it automatically added and enabled it.
    I assume I can use the string as is for a shell.execute() type of command
    for the purpose of doing this in NSIS
    is there a way to capture the return value to verify it was successful or
    not (without the verbose)

    I also assume the uninstall is pretty straight forward too.

    Thanks again!

    -jon


    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 16/09/2014 12:00
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    Does the component have an INF file? What class (look for Class= .... )
    is it? Net, NetService, NetTrans, NetClient, something else?


    For NetService, NetTrans, and NetClient then look at the BindView sample
    or use DIFXAPI (or DIFXAPP if you are installing from an MSI package). Or
    if you just want to exec some command line that will work use NETCFG.EXE
    (inbox utility on Vista+)


    netcfg [-v] [-e] [-winpe] [-l ] -c

    -i


    -winpe installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation envrionment
    -l provides the location of INF
    -c provides the class of the component to be installed (p ==
    Protocol, s == Service, c == Client)
    -i provides the component ID

    The arguments must be passed in the order shown.

    Examples:
    netcfg -l c:\oemdir\foo.inf -c p -i foo
    ...installs protocol 'foo' using c:\\oemdir\\foo.inf

    netcfg -c s -i MS_Server
    ...installs service 'MS_Server'

    OR

    netcfg [-v] -winpe
    Examples:
    netcfg -v -winpe
    ...Installs TCP/IP, NetBIOS and Microsoft Client for Windows
    preinstallation environment

    OR

    netcfg [-v] -q
    Example:
    netcfg -q MS_IPX
    ...displays if component 'MS_IPX' is installed

    OR

    netcfg [-v] [-e] -u
    Example:
    netcfg -u MS_IPX
    ...uninstalls component 'MS_IPX'

    OR

    netcfg [-v] -s
    where,
    -s\tprovides the type of components to show
    \ta == adapters, n == net components
    Examples:
    netcfg -s n
    ...shows all installed net components

    OR

    netcfg [-v] -b
    Examples:
    netcfg -b ms_tcpip
    ...shows binding paths containing 'MS_TCPIP'


    General Notes:\n"
    -v Run in verbose (detailed) mode
    -e Use servicing environment variables during install and uninstall
    -? Displays this help information



    My question to you was how do they (the devs) install it. Do they use
    BindView? Do they use the NDIS.COM sample installer? Have you
    installed the driver manually? How do you do it?


    Good Luck,

    Dave Cattley
    ---
    NTDEV is sponsored by OSR

    Visit the list at:
    http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer

  • Jeffrey_Tippet_[MSFT]Jeffrey_Tippet_[MSFT] Member - All Emails Posts: 577
    You already have the source code to netcfg.exe - it's straight out of the bindview sample. Start with the sample's InstallSpecifiedComponent function. I think you'll find that when you strip away the sample's GUI code, it boils down to just a few dozen lines of code to install the driver directly. It would take almost as many lines of code to screenscrape the error code from netcfg.exe.

    https://code.msdn.microsoft.com/Bindview-ec8f6e0a/sourcecode?fileId=51239&pathId=1166401964
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    That i did not know.
    I can probably use the same code to make it a NSIS DLL that takes in the
    arguments of the code to do the install and uninstall.
    either way, I am definitely on the correct track.

    Thanks so much



    From: Jeffrey Tippet
    To: "Windows System Software Devs Interest List"
    Date: 09/10/2014 16:33
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]



    You already have the source code to netcfg.exe - it's straight out of the
    bindview sample. Start with the sample's InstallSpecifiedComponent
    function. I think you'll find that when you strip away the sample's GUI
    code, it boils down to just a few dozen lines of code to install the
    driver directly. It would take almost as many lines of code to
    screenscrape the error code from netcfg.exe.

    https://code.msdn.microsoft.com/Bindview-ec8f6e0a/sourcecode?fileId=51239&pathId=1166401964



    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
  • David_R._CattleyDavid_R._Cattley Member - All Emails Posts: 2,115
    <quote>

    It would take almost as many lines of code to screenscrape the error code from netcfg.exe.
    </quote>


    I just want to reiterate my original advice in context here.


    My suggestion to exec NETCFG.EXE and collect & parse its output in NSIS was not based on the ease of which one might the code to do what it is doing but was based on the fact that NSIS is a 32-bit executable and as such on a 64-bit Windows running in WOW64 it will not be permitted to call INetCfg interfaces or anything that relies on SETUPDI as those are only minimally operational in WOW64. Specifically, any operation that might need to invoke a CoInstaller, ClassInstaller, or NotfiyObject (of which Install and Remove will require most of these) is not permitted since those modules are *NATIVE* code.


    So the advice to just suck it up and exec NETCFG.EXE takes into account that you are not going to ship two installers (one 32-bit and one 64-bit) and your installer needs some way to install (and remove, the other few dozen lines of code, and upgrade the hard one which is remove followed by install) and it has to work on both 32-bit and 64-bit systems. NETCFG.EXE is a package of functionality that exists as native code on all NT6 platforms.


    So sure, not as sexy as writing a DLL that you can then call with the system package but at least it will work on x64 the same as it works on x86.


    I can't say as I am disagreeing with Mr. Tippet that the code itself is straightforward but perhaps just looking at the entire set of issues through the lenses of someone whom has built exactly what you need (multiple times, in all of NSIS, MSI, and stand-alone utilities).


    Good Luck,

    Dave Cattley
  • Jeffrey_Tippet_[MSFT]Jeffrey_Tippet_[MSFT] Member - All Emails Posts: 577
    Fair points. I had forgotten that the original context of the thread was about 32-bit running on 64-bit OS.

    Also, I personally have very little experience with NSIS. So if you're plugging into NSIS, there's wisdom in deferring to somebody who *does* have experience with NSIS.

    My claim to expertise is solely that I am the developer who currently has the blessing of maintaining the INetCfg APIs.
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    After examining the source code, and while it may be sexier to go with my
    own custom dll, and i may very well do that in the future, but for now, i
    think shellexec is fine enough. the deadline for this endeavour is next
    month and i got a lot of other pressing projects taking up a lot of time,
    so while i see exec a command as quick and dirty, i will have to agree
    with the KISS philosophy. Thank you though Mr Cattley, for your opinion
    is going to convince me for at least in this release to use the
    netcfg.exe. If i were to change my mind later, if anything when things
    are less busy, and for the challenge, then yes, i can...but for now, this
    is fine enough.




    From: Dave Cattley
    To: "Windows System Software Devs Interest List"
    Date: 09/10/2014 19:19
    Subject: RE: [ntdev] Question regarding on how to do an NDIS Driver
    installation using NSIS
    Sent by: [email protected]





    It would take almost as many lines of code to screenscrape the error code
    from netcfg.exe.



    I just want to reiterate my original advice in context here.


    My suggestion to exec NETCFG.EXE and collect & parse its output in NSIS
    was not based on the ease of which one might the code to do what it is
    doing but was based on the fact that NSIS is a 32-bit executable and as
    such on a 64-bit Windows running in WOW64 it will not be permitted to call
    INetCfg interfaces or anything that relies on SETUPDI as those are only
    minimally operational in WOW64. Specifically, any operation that might
    need to invoke a CoInstaller, ClassInstaller, or NotfiyObject (of which
    Install and Remove will require most of these) is not permitted since
    those modules are *NATIVE* code.


    So the advice to just suck it up and exec NETCFG.EXE takes into account
    that you are not going to ship two installers (one 32-bit and one 64-bit)
    and your installer needs some way to install (and remove, the other few
    dozen lines of code, and upgrade the hard one which is remove followed by
    install) and it has to work on both 32-bit and 64-bit systems. NETCFG.EXE
    is a package of functionality that exists as native code on all NT6
    platforms.


    So sure, not as sexy as writing a DLL that you can then call with the
    system package but at least it will work on x64 the same as it works on
    x86.


    I can't say as I am disagreeing with Mr. Tippet that the code itself is
    straightforward but perhaps just looking at the entire set of issues
    through the lenses of someone whom has built exactly what you need
    (multiple times, in all of NSIS, MSI, and stand-alone utilities).


    Good Luck,

    Dave Cattley
    ---
    NTDEV is sponsored by OSR

    Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

    OSR is HIRING!! See http://www.osr.com/careers

    For our schedule of WDF, WDM, debugging and other seminars visit:
    http://www.osr.com/seminars

    To unsubscribe, visit the List Server section of OSR Online at
    http://www.osronline.com/page.cfm?name=ListServer
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online
Developing Minifilters 23 May 2022 Live, Online
Writing WDF Drivers 12 September 2022 Live, Online