Old 18th October 2007, 21:46   #1
sina_izad
Junior Member
 
Join Date: Oct 2007
Posts: 4
dotNet version detection problem

Hi there

i was having some problems with detecting the version of the dotnet installed.

i use this function to detect the dot net version installed. which works fine!

PHP Code:
Function GetDotNETVersion
    Push 
$0
    Push 
$1
    
    StrCpy 
$0 0
    System
::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i r2r2) i .r1"
    
StrCmp $"error" +2
    StrCpy 
$"not found"
    
    
MessageBox MB_OK $0
    Pop 
$1
    Exch 
$0
FunctionEnd 
here is what happends

- i have dotnet version 1.1 installed
- i run installer which checks for version 2.0
- it senses that 1.1 is installed and runs the version 2.0's installer using execwait
- after installation dotnet is done i check the version using the above function and it still thinks that version 1.1 is installed

so there is noway for me to know if installation was successful

here is the interesting thing, if i run my installer again the first time it checks for latest version of dotnet it senses version 2.0 and continues happily ever after.

has anyone had the same problem? what is the work around?
to see if 2.0 was successfully installed? or is there a more reliable way to check for latest version of dotnet installed?

thanks
Sina
sina_izad is offline   Reply With Quote
Old 19th October 2007, 07:36   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes there is. ExecWait has an extra parameter, i.e. ExecWait "...dotnetfx.exe ..." $R0

$R0 will be 0 on success or an error specific error code.

Stu
Afrow UK is offline   Reply With Quote
Old 19th October 2007, 13:48   #3
sina_izad
Junior Member
 
Join Date: Oct 2007
Posts: 4
thanx Afrow UK it works

its nice that even if user cancels installation and dotnet installer exits gracefully it still receives some error
sina_izad 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