blayde
7th December 2003 13:05 UTC
UpgradeDLL and dao360.dll
hi,
i'm a bit of a newbie so please excuse me i'f i've missed something obvious :)
i want to install the file 'dao360.dll'. i do this with UpgradeDLL. everytime i run my nsis install program it says i have to reboot. i believe the code is asking this to rename, then register, the dll. while restarting i get an error roughly saying "couldn't find module temp_path\temp.file\dao360.dll" ( where temp_path is the temp path the file got extracted to, temp.file is the temporary file that got created, and dao360.dll is what the file should be renamed to ). which doesn't sound like it's even looking in the right place to me. the UpgradeDLL code looks like it should be looking for temp_path\dao360.dll. i'm using the latest tested release of NSIS, 2.0b4, and the latest version of UpgradeDLL.
any reasons this error might arise ?
the only possibility i can think of is the macro i use to call UpgradeDLL. I previously used MS P&DW and in examining that source code and found it handled this one file a little different. I have tried to take this into account with a custom macro. dao360.dll is the only file i use this custom macro on. i think this is probably the source of my error.
!macro UpgradeDAODLL LOCALPATH LOCALFILE
Push $R0 ; Gunna hold DAO dir
ClearErrors
ReadRegStr "$0" "HKLM" "SOFTWARE\Microsoft\Shared Tools\DAO350" "Path"
IfErrors er1 er2
er1:
DetailPrint "Unable to find DAO path.$\nFile ${LOCALFILE} has not been installed !"
Goto end
er2:
; Please note - this codes assumes the DAO350\Path key points to a file called ( or at least of the same length ) as dao350.dll
StrCpy $R0 $0 -10 ; 11 chars is 'dao350.dll' + a '\'
!insertmacro UpgradeDLL "${LOCALPATH}\${LOCALFILE}" "$R0\${LOCALFILE}" "$SYSDIR"
Goto end
end:
Pop $R0
!macroend
blayde
8th December 2003 07:56 UTC
fixed a small, probably unrelated bug.
changed
StrCpy $R0 $0 -10
to
StrCpy $R0 $0 -11
I'll have to go offline to continue testing ( dial up connection :( ). I'll post any results later.
!macro UpgradeDAODLL LOCALPATH LOCALFILE
Push $R0 ; Gunna hold DAO dir
ClearErrors
ReadRegStr "$0" "HKLM" "SOFTWARE\Microsoft\Shared Tools\DAO350" "Path"
IfErrors er1 er2
er1:
DetailPrint "Unable to find DAO path.$\nFile ${LOCALFILE} has not been installed !"
Goto end
er2:
; Please note - this codes assumes the DAO350\Path key points to a file called ( or at least of the same length ) as dao350.dll
StrCpy $R0 $0 -11 ; 11 chars is 'dao350.dll' + a ''
!insertmacro UpgradeDLL "${LOCALPATH}\${LOCALFILE}" "$R0\${LOCALFILE}" "$SYSDIR"
Goto end
end:
Pop $R0
!macroend
kichik
8th December 2003 09:49 UTC
The problem seems to be your usage of $R0. UpgradeDLL uses $R0 too and as the destination file parameter is processed after UpgradeDLL has already changed it, problems are caused. UpgradeDLL was not built to be used with paths containing variables.
For now you should avoid using $R0, $R1, $R2 and $R3 as UpgradeDLL's parameters. We'll see what can be done to improve this.
You should also use the detected DAO directory as TEMPBASEDIR (UpgradeDLL's third parameter). $SYSDIR is used in the example because that's where the example tries to install dllname.dll.
BTW, on my system the key you're trying to read doesn't exist. I only have SOFTWARE\Microsoft\Shared Tools\DAO350.dll. But I probably just don't have the component you're looking for...
blayde
8th December 2003 13:49 UTC
of course ! i'd forgotten it does that. and thanks for the tip on the tempdir.
thanks a lot kichik
which os are you running ? every computer i've seen so far has that reg entry.
i saw that some very smart person set up UpgradeDLL to use dynamic, unique, labels ( for GOTOs etc ). now that NSIS has defineable variable names too, maybe that concept could be extended to variable names. so that UpgradeDLL ( and other macros ) never have variables that interfere with others.
kichik
8th December 2003 14:12 UTC
Well, assuming it takes variables for runtime script is reasonable... ;)
I'm using XP SP1. No SOFTWARE\Microsoft\Shared Tools\DAO350, just SOFTWARE\Microsoft\Shared Tools\DAO350.dll.
blayde
8th December 2003 14:33 UTC
thanks a lot kichick.
i'd better alter my setup plan now. i'm glad i found out that reg entry thing now rather than from a customer.
and your suggest worked ! changed $R0 to $1 makes it work fine.
you have once again proven invaluable.
Joost Verburg
24th December 2003 18:36 UTC
UpgradeDLL now supports paths that contain variables.