Archive: NSIS extracting in wrong folder instead of overwrite/skip


NSIS extracting in wrong folder instead of overwrite/skip
Hi, i need a little help, im doing an install for a oracle runtime, it mess with registries and reg diles and another setups extracted to a temp file.

in that there is no problem i did everything reading the forums but now in the UAT.

i found the next problem.

When i install the first time it creates the folders as i told it. ie.

C:\oracle\forms
This is mis $INSTdir

and inside it it have several folders like BIN
C:\oracle\forms\bin

but after it finish i decide to reinstall it without uninstall it to see what it doest and i realize that the installations was not skipping or overwriting so i decide to dig a little and i found the next.

in the 2nd. install i found inside the BIN folder a identical structure as it was the instdir
so in exemple

inside C:\oracle\forms\bin
i found another bin
C:\oracle\forms\bin\bin
and in here i find all the files of the installation.

i checked and i dont find where to look to fix this error.
could it be when in compiled ? or a bad directory that i wrote.

here are some parts of my code.

OutFile "Setup.exe"
InstallDir "c:\oracle\forms"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "Runtime" SEC02
SetOutPath "$INSTDIR\BIN"
SetOverwrite try
File "C:\oracle\Forms\BIN\CA60.DLL"
File "C:\oracle\Forms\BIN\CORE40.DLL"
File "C:\oracle\Forms\BIN\D2SC60.DLL"
File "C:\oracle\Forms\BIN\D2SCV60.EXE"
File "C:\oracle\Forms\BIN\DE60.DLL"
File "C:\oracle\Forms\BIN\DEB60.DLL"
....
if someone could help me with some tip to fix this it would be really appreciated.

Thanks.

ps. i attached a composed image of 2 explorer windows so you can see what im talking.

It would be handy if you could attach your script.

-Stu


sure

here it is.

Regards


I think this might be the problem.
You are using:

InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""


However, when you write to it after installation (in Section -Post), your code is:
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\BIN\D2SCV60.EXE"


Should be:
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" $INSTDIR


Just a question... was it not possible to use File /r instead of including each and every file individualy?

-Stu

mh im have not so much expertise in nsis, first project and was this let me change that, mhh let me check with the file /r to see what can i do.

i will post the result thanks.


If you want to compress a folder, use:
SetOutPath $INSTDIR
File /r "local_folder\*.*"

This will extract all files in local_folder to $INSTDIR.

Similarly:
SetOutPath $INSTDIR
File /r "local_folder"

This will extract local_folder and its contents to $INSTDIR.

-Stu


yes thanks. that worked i just needed to remove the value in the registry since it was saved from the last install.
but after that it worked

Great. thanks.