Skip to content
⌘ NSIS Forum Archive

Version check against currently installed version

9 posts

Nniol#

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
kichik#
Use GetDllVersionLocal to get the version information of a local file on the build system. See Include\Library.nsh for a usage example.
Nniol#
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
kichik#
What macro? Are you talking about a file inside another archive and not your installer? You'd have to extract it first.
Nniol#
NO... the executable is whithin my install, I need to make sure that its version is greater than the currently installed version....
kichik#
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.
Nniol#
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
kichik#
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.