Old 24th November 2006, 10:56   #1
Nniol
Junior Member
 
Join Date: Oct 2006
Posts: 26
Version check against currently installed version

Hi,

HOw would you access the Exe currently within the archive so that it can have its version checked against a currenlty installed version so that versions are not overwritten with a prior or equivalent versiobn

Nniol
Nniol is offline   Reply With Quote
Old 24th November 2006, 11:01   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Use GetDllVersionLocal to get the version information of a local file on the build system. See Include\Library.nsh for a usage example.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 24th November 2006, 11:04   #3
Nniol
Junior Member
 
Join Date: Oct 2006
Posts: 26
I can get the version on the local system, but having trouble with GetFileVersion error in macro line 5.....

I need to access the FileVersion of the executable within the archive...

Nniol
Nniol is offline   Reply With Quote
Old 24th November 2006, 11:05   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
What macro? Are you talking about a file inside another archive and not your installer? You'd have to extract it first.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 24th November 2006, 11:06   #5
Nniol
Junior Member
 
Join Date: Oct 2006
Posts: 26
NO... the executable is whithin my install, I need to make sure that its version is greater than the currently installed version....
Nniol is offline   Reply With Quote
Old 24th November 2006, 11:17   #6
Nniol
Junior Member
 
Join Date: Oct 2006
Posts: 26
Is GetDllLocalVesion what I require
Nniol is offline   Reply With Quote
Old 24th November 2006, 11:19   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The executable in your install could only come from your local machine. Therefore, using GetDllVersionLocal should provide you with the correct version details. Include\Library.nsh provides a perfect usage example for your case, comparing the versions of a local file, also bundled in the installer, and a file on the user's system.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 24th November 2006, 11:33   #8
Nniol
Junior Member
 
Join Date: Oct 2006
Posts: 26
Do I need to have added it using File first?

I have my script in a root directory and then all files to be installed are in a child directory called Install.

However

GetDllVersionLocal "Install\$ServiceExeName" $R0 $R1

Can not find the executable..

The command I use later on to add all the files to the Archive is:
File /r .\Install\*.*

Nniol
Nniol is offline   Reply With Quote
Old 24th November 2006, 11:36   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
There's no need to include the file in order to get its version. The problem in your script is that you use a variable in a compile time command. The compiler can't possibly know what $ServiceExeName will contain at runtime. Use the real file name, without any variables.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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