Old 28th March 2009, 16:20   #1
I_Need_help2
Junior Member
 
Join Date: Jun 2008
Posts: 11
File and Product Version From File info

Hi
I would Like to get the Product Name and version from the Exe File and use this information on the welcome screen.

I have tried MoreInfo plug in and can get it to work if run from with in a Section but if I place i call it from a function all the values are blank.

I want to just set the file name and location and it pick up the product name version etc automaticaly thus I would only need to change one line each time I need to build an installer!

Any idea why I can only use MoreInfo after the welcome screen in a section?
I_Need_help2 is offline   Reply With Quote
Old 28th March 2009, 16:58   #2
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
no?

code:

!addplugindir "."
!addincludedir "."

!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"

; !include "MUI2.nsh"

OutFile "test.exe"

Function .onInit
InitPluginsDir
MoreInfo::GetFileDescription "$SYSDIR\rundll32.exe"
Pop $0
MoreInfo::GetFileVersion "$SYSDIR\rundll32.exe"
Pop $1
MessageBox MB_OK "[$0]$\r$\n[$1]"
FunctionEnd

Section
SectionEnd



Results in (on this machine):
code:

---------------------------
Name Setup
---------------------------
[Run a DLL as an App]

[5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)]
---------------------------
OK
---------------------------

Animaether is offline   Reply With Quote
Old 28th March 2009, 20:04   #3
I_Need_help2
Junior Member
 
Join Date: Jun 2008
Posts: 11
thank you
I_Need_help2 is offline   Reply With Quote
Old 29th March 2009, 11:05   #4
I_Need_help2
Junior Member
 
Join Date: Jun 2008
Posts: 11
OK It was / is working but only when I run it from inside HM NSIS!

I think the problem is that the file I want to use to get the information from is the the main file I'm delivering, so at the welcome screen it's still in the package!

can I use the moreinfo to get file info from the file to be delivered while still in the package so I can show the info on the welcome screen? Or is there a way of getting the info at compile time and saving it to be used during installation?

thanks

Last edited by I_Need_help2; 29th March 2009 at 11:27.
I_Need_help2 is offline   Reply With Quote
Old 29th March 2009, 16:20   #5
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
You should just be able to unpack the file to a temp location (like $PLUGINSDIR or $TEMP):
code:
Function .onInit
InitPluginsDir
File "/oname=$PLUGINSDIR\somefile.dll" somefile.dll
MoreInfo::GetFileDescription "$PLUGINSDIR\somefile.dll"
Pop $0
MoreInfo::GetFileVersion "$PLUGINSDIR\somefile.dll"
Pop $1
MessageBox MB_OK "[$0]$\r$\n[$1]"
FunctionEnd

Comperio is offline   Reply With Quote
Old 29th March 2009, 16:24   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If it's the file you are packing then you should be getting version information from it at compile time, not at run time.

http://nsis.sourceforge.net/Invoking...n_compile-time

Stu
Afrow UK is offline   Reply With Quote
Old 29th March 2009, 16:35   #7
I_Need_help2
Junior Member
 
Join Date: Jun 2008
Posts: 11
thanks Stu I will look into this.

Currently I have got around this by extracting it to the plugin folder so it gets auto deleted again and then reading its values from there.
I_Need_help2 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