Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 11th September 2012, 16:12   #1
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
Smile NSIS script not installing in correct directory System32

Hello everybody,

I am trying to make an install script. I need to place some dlls and ocx on C:\Windows\System32 either on 32bits pc or 64bits pc. I am not able to redirect the system to System32 on 64 bit PC.

My script is something like this:

;--------------------------------

!include "MUI2.nsh"
!include 'LogicLib.nsh'
;!include "x64.nsh"

Section "Basic Installing DLL"

SetOutPath "$WINDIR\System32"
SetOverwrite ifnewer
DetailPrint "Installer running on 64-bit host"

;Placing dll on System32
File "C:\Installation\Basic Installation\System32\DINTER.DLL"

;Registering dll
ExecWait 'regsvr32.exe /s "$WINDIR\System32\DINTER.DLL"'
RegDLL "$WINDIR\SysWOW64\DINTER.DLL"

SectionEnd


My installation is doing the following:
  • For 64 bits PCs is placing the DLLs on SysWOW64 Directory
  • It is not registering correctly the DLLs

I have two questions:
  • How can I redirect the installer to place my DLLs on System32 no matter if the PC/system is 32 or 64 bits?
  • How can I register my DLLs correctly? Should I be using: regsvr32.exe or RegDLL?

Thank you for your help and advise,

N
noemig is offline   Reply With Quote
Old 11th September 2012, 16:27   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
You've included x64.nsh but not used ${DisableX64FSRedirection}.

Edit: And it is safe to use that on any OS (no need to check you are running on x64).

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 11th September 2012, 16:48   #3
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
The following works for me:

SetOutPath $SYSDIR
${DisableX64FSRedirection}
SetOutPath "$WINDIR\System32"

I am still having this question:

How can I register my DLLs correctly? Should I be using: regsvr32.exe or RegDLL?

N
noemig is offline   Reply With Quote
Old 11th September 2012, 16:50   #4
noemig
Junior Member
 
Join Date: Feb 2012
Posts: 14
Thanks Stu,

It works. I see your point to use that on any OS not checking if I am running on X64.

Any idea about how to register correctly the dlls that I am installing on system32?

N
noemig is offline   Reply With Quote
Old 11th September 2012, 19:08   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
I'm not sure if RegDLL will work on 64-bit DLL's. If it does then you should use that.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Tags
dll, regdll, regsvr32.exe, setoutpath, syswow64

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump