|
|
#1 |
|
Junior Member
Join Date: Aug 2003
Posts: 39
|
Copy file - Register dll - Shared counter
I tried to rewrite sunjammers code about "Upgrade a DLL" (http://nsis.sourceforge.net/archive/...instances=0,11)... His prg snippet is an macro, but I want to write Function if possible because I have to install lot of dll... I added more functionality, shared files counter handler from Add a shared DLL (http://nsis.sourceforge.net/archive/...instances=0,11)
First, I Push the parameters from the macro, then I pop the parameters, and do what I need from the function. I am using this include file for this functionality: [edited by kichik]attach large scripts. attached below If I try to compile i got a next error message: GetDLLVersionLocal: error reading version info from "$LOCALFILE" !include: error in script: "Include\Installer.nsi" on line 52 Error in script "E:\Fejlesztes\ACE Mega CoDecS Pack\ACE Mega CoDecS Pack.nsi" on line 6 -- aborting creation process I think error caused by $LOCALFILE variable, because If I remmark this line, the compiler stops next where $LOCALFILE appear... What I did wrong? Please help me! Best regards, ACEMCP |
|
|
|
|
|
#2 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
I wrote that macro.
You are mising up run-time and compile time. GetDLLVersionLocal gets the version of a DLL on the compiler system (the DLL that will be included), so you can never use a run-time variable. Always increasing the shared item count is also not a good idea. For example, it should not be increased when reinstalling. |
|
|
|
|
|
#3 | |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
Quote:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Aug 2003
Posts: 39
|
Sorry kichik!
Dear Joost! Are there any way to solve this problem? I want to use this intelligent update feature for about 200 dlls. I think macro method makes the installer lot bigger. How can I determine users run as installer or reinstaller? Enough to watch HKLM\Software\${PRODUCT} exist or there are another better sollution? |
|
|
|
|
|
#5 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Indeed, checking files or registry keys is a good solution.
You should use compile-time defines for GetDLLVersionLocal. |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2003
Posts: 18
|
Yeah, you could store it in the reg' and remove the entry at uninstall. you chould also check if the file(s) your installing already exist and need replacing.
eg http://nsis.sourceforge.net/Docs/AppendixC.html#C.4 |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Aug 2003
Posts: 39
|
So I have to build dll table with define command like this:
!define aaadll aaa.dll !define baadll baa.dll etc to add all the filename information to the script? Then I can use it compile time?Is it a right sollution? Or macro the whole Upgrade a DLL - at about 200 times? |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Aug 2003
Posts: 39
|
Dear Joost!
I switched back to macro, because using function this are is an stupid move )I tried to add more functionality: Register dll, Shared counter Register dll already implemented, but I may help for shared file counter: there are a variable: var INSTALLCOUNT in the begening of installation: ReadRegDWORD $INSTALLCOUNT HKLM "Software\${PRODUCT}" "Installer Counter" ; increase for every installation ; decreased every uninstallation IntOp $INSTALLCOUNT $INSTALLCOUNT + 1 WriteRegDWORD HKLM "Software\${PRODUCT}" "Installer Counter" $INSTALLCOUNT I increase every time, (of course deinstallation remove at all) When I installing files, I use this method If file non exist shared dll counter be 1 If file exist but my program first installed (Installer Counter==1) shared dll counter Increased by 1 If file exist but my program already installed (Installer Counter>1) No increment. If file exist and no (or 0) value of shared dll counter, the shared dll counter be 2. Uninstall: Uninstallation always decrease counter, and file and counter removed if reached 0... This is the right sollution? Or you have better one? ACEMCP |
|
|
|
|
|
#9 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
For the shared DLL count, a separate function is available. You should also call it on a new installion (check whether installion files or registry keys exist).
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Aug 2003
Posts: 39
|
But what is the matter if files exist but the file's sharedDLLs counter is 0 or non exist?
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|