Archive: How to locate path for drv.sys file in NSIS.


How to locate path for drv.sys file in NSIS.
Hi all,

I need one urgent help.

I am installing one driver using NSIS installer on the Win-XP system. My whole installer is working fine, but in the process of installation the system device manager (New Hardware found wizard) asks for 'drv.sys' file location to complete the installation. But before this only the required 'drv.sys' file is made available in "$WINDIR\System32\drivers" folder through the NSIS script.
Can any one suggest me how to set the path in the NSIS script or any alternative solution so that the installer should not ask for the drv.sys file location and pick it automatically from "$WINDIR\System32\drivers" during installation.
Kindly anyone reply.
Thanks in advance.

Regards
VCR


Did you try IfFileExists?

Also for the system path try $SYSDIR


You can set the working directory using SetOutPath. The Archive contains some pages about setting the path (use the one with the System.dll call). But I think you somehow need to register your driver, not set the path variable or the working directory.


I have already done the SetOutPath "$WINDIR\System32\drivers", but its not working.

I am doing the following registry entry:

............................
WriteRegStr HKLM SOFTWARE\Driver "Install_Directory" "$INSTDIR"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Driver" "DisplayName" "MyDrv(1)"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Driver" "UninstallString" "$INSTDIR\Driver_Uninst.exe"

WriteUninstaller "Driver_Uninst.exe"
............................

Is there any registry entry I am missing... Plz tell if any other entry I have to make, so that the System Device Manager can find the drv.sys file from the "$WINDIR\System32\drivers" directory.

Waiting for reply.

Thanks in advance...

VCR


Did you try:


SetOutPath "$SYSDIR\drivers"
File "C:\path\of\file\in\your\harddrive\drv.sys"

Hi all,

Thanks for your replies.
I tried the above options, but it does not work for me.
I did
SetOutPath "$SYSDIR\drivers"
File "C:\path\of\file\in\your\harddrive\drv.sys"

But still the windows pops up asking for the file 'drv.sys' under the caption "Files Needed"
It says "The file 'drv.sys' on [Unknown] is needed.
Type the pathwhere the file is located, and then click OK"
Canm anybody tell what the problem is, or is there any NSIS function to solve it or where the problem could be traced.
As I have told the drv.sys file is already been copied to the "$SYSDIR\drivers".
Please help me in solving this as I need it badly.

Kind Regards,
VCR


Can you be sure that the driver is in the "driver" folder after NSIS closes?


Hi,
Yes, after the installation also (exit from NSIS)
the driver file is in the \system32\drivers folder.
In fact I locate the same file(\system32\drivers\drv.sys) when prompted for loaction and installation suceeds.
But still NSIS did not pick it automatically.

-VCR


huh?

Yes, after the installation also (exit from NSIS)
the driver file is in the \system32\drivers folder.
But still NSIS did not pick it automatically.
mmm...
Let's try something like this

section -InstallDriver
SetOutPath "$SYSDIR\drivers"
File "$SYSDIR\drivers\drv.sys"
;RegDLL "$SYSDIR\drivers\drv.sys"
sectionend

Hi,

I tried all the above options, but its not working at all... Even then the Found new hardware wizard for location the "drv.sys" file is prompted.

Plz help me out....

Regards
VCR