Archive: How can we install to c:\dir ????


How can we install to c:\dir ????
Hello,

I would like to propose the following dir for my installation:

C:\econf

where c:\ is the system dir (so I could be d:\ for a multiboot OS, etc.)

I have seen this function:

StrCpy $0 $WINDIR 2

But I can't call it from the install dir ... (no section)

Could u help?


Hi DarkLord23

Is this what you want to do?

StrCpy $0 $WINDIR 2
InstallDir "$0\econf"


Good luck.

Greetz, Hendri.

I does't work ;(

StrCpy $0 "$WINDIR" (2) ()
Error: Can't add entry, no section or function is open!
Error in script "C:\release\econf.nsi" on line 50 -- aborting creation process


So you can only use this command StrCpy in a SECTION or a FUNCTION. Please read NSIS Documentation.

-Hn3.


I know that and I've read the doc.

I have tried to declare windir in the onInitSuccess function but it does not work either!

I am stuck!!


You shouldn't declare $WINDIR. It's given.

Just do:

function .onInit
StrCpy $0 $WINDIR 2
; Now $0 is the system drive
StrCpy $INSTDIR "$0\MyApp"
; this is to set the default install dir
; to the right choice.
FunctionEnd

Section
File...
SectionEnd


-Hendri.