Nmap Development mailing list archives

Re: silent installation of Nmap-WinPcap to a specific directory


From: "EBIHARA, Yuichiro" <ebihara () iplocks co jp>
Date: Mon, 23 Jun 2008 09:46:00 +0900

I sent a reply directly to Rob by mistake...
--
Thank you, Rob.

I tried the workaround you proposed and it completely worked.
Since I also need to consider the possibility that an old version of
WinPcap is installed, I refered to the source code of Nmap-WinPcap
installer and implemented a logic to uninstall it beforehand.

For the time being, all of my issues are resolved and I'm very
satisfied but it's greatly appreciated if the installer is enhanced.

Thank you,

ebi

2008/6/20 Rob Nicholls <robert () everythingeverything co uk>:
Hi,

I'm afraid you can't currently change the location where WinPcap is
installed when you perform a silent installation of Nmap, as you've rightly
pointed out it's hardcoded into Nmap's installer.

However, as a workaround (although I've not tried it as I'm at work), I
believe the current installer logic should allow you to run our version of
the WinPcap installer (that you can obtain from nmap-4.65-win32.zip) after
you've installed Nmap, specifying the new location where you want WinPcap to
be installed. A silent installation of WinPcap bypasses the version check
when wpcap.dll is present, then runs the WinPcap uninstaller, then installs
WinPcap to the new location you've specified at the command line.

e.g.

nmap-4.65-setup.exe /S /D="C:\tools\Nmap\"
winpcap-nmap-4.02.exe /S /D="C:\tools\WinPcap\"

I'll look into modifying the Nmap installer to accept a new parameter that
states where to install WinPcap, probably based on
http://nsis.sourceforge.net/Get_Parameter_Value unless I can find/write
something simpler. I suspect /W would be a fairly logical choice, e.g.
/W="C:\tools\WinPcap\", with Nmap's installer passing the default Program
Files folder if /W hasn't been specified.

As an aside, I've noticed that when our (silent) WinPcap calls the
uninstaller because wpcap.dll is present, a GUI will appear if WinPcap was
installed using the official installer (as their uninstaller doesn't support
a silent uninstall). I can't think of a workaround for that, other than
updating our installer to (inelegantly) manually delete some of WinPcap's
registry keys and files and stop the npf service before we continue with our
installation, rather than run their uninstaller (but only for a silent
install). Do people think it's worth us worrying about/proactively fixing?


Rob


-----Original Message-----
From: EBIHARA, Yuichiro [mailto:ebihara () iplocks co jp]
Sent: 20 June 2008 10:51
To: nmap-dev () insecure org
Subject: silent installation of Nmap-WinPcap to a specific directory

Hi,

Nmap 4.65 supports silent installation for Nmap and Nmap-WinPcap.
This is a great enhancement and I tried it.

nmap-4.65-setup.exe /S /D=C:\tools\Nmap

Nmap is installed in C:\tools\nmap as I expected and WinPcap is
installed in C:\Program Files\WinPcap.
Actually, I want to install WinPcap in C:\tools\WinPcap and I wonder
if I can specify the destination directory for WinPcap.

I looked into the source file, mswin32/nsis/Nmap.nsi, and I found the
following lines.

  winpcap_silent:
    ExecWait '"$INSTDIR\winpcap-nmap-4.02.exe" /S
/D=$\""$PROGRAMFILES\WinPcap\"$\"'

It seems $PROGRAMFILES is replaced with the system's default program
files directory. Is there any way to temporarily change it without
updating the Windows registry?

Thanks in advance,

ebi

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: