Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 3rd February 2004, 00:54   #1
ursus76
Junior Member
 
Join Date: Jan 2004
Posts: 8
.Net Framework Installation

I need to install .Net Framework and I need
1.silent installation of dotnetfx.exe
2.need to get the return code(error code, reboot etc as Microsoft's website described http://msdn.microsoft.com/library/de...operations.asp)

I tried this, works, however, can't get the return code.
--->
ExecWait "$TEMP\dotnetfx.exe /q:a /c:$\"install /l /q$\""

So instead, I use the command below. And I get $0=0(which supposed to mean no error) but actually dotnet framework is not installed at all. Is there any problem with my script or I should use different approach?
--->
nsExec::ExecToStack "dotnetfx.exe" $TEMP\
Pop $0

Thanks!
ursus76 is offline   Reply With Quote
Old 3rd February 2004, 02:49   #2
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Try this code
code:
ExecWait '$TEMP\dotnetfx.exe /q:a /c:$\"install /l /q$\"' $1
Now $1 should contain the error/exit code.

Vytautas
Vytautas is offline   Reply With Quote
Old 3rd February 2004, 09:41   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
As for the second one, I doubt it really returns 0. You ended your line with a backslash which means the next line will be appended to it. This means the Pop isn't really executed but is sent as an argument to nsExec. This argument plus the stack item you forgot to pop will corrupt the stack and leave it in a state you don't expect it to be.

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 3rd February 2004, 18:34   #4
ursus76
Junior Member
 
Join Date: Jan 2004
Posts: 8
Thanks, I'm using ExecWait now and sorry, the second one shouldn't have backslash.

Another question regarding this:
I'd like to test that whenever the error message generated by dotnetfx.exe (like reboot-needed), I'm able to suppress it till the program finishes(like reboot after the installation is done). But since I can't make my dotnetfx.exe wrong on my computer, is there any way to test it?
ursus76 is offline   Reply With Quote
Old 3rd February 2004, 18:41   #5
ursus76
Junior Member
 
Join Date: Jan 2004
Posts: 8
One more question:

ExecWait '$TEMP\dotnetfx.exe /q:a/c:$\"install /l /q$\"' $1

It takes quite some time to finish the dotnetfx execution, and the installation program just seems hangs and stops there. Is there any way to keep the progress bar moving or give the user any feedback about what is going on?

Thanks a lot!
ursus76 is offline   Reply With Quote
Old 3rd February 2004, 20:23   #6
opher
Junior Member
 
opher's Avatar
 
Join Date: Jan 2004
Location: Rishon Le Zion, Israel
Posts: 36
Send a message via Yahoo to opher
Vytautas hi,
Afaik, one doesn't need to use $\" to insert a " (double-qoute) in a string pre- and post-pended with ' (single-qoute). This for example works
code:
ExecWait 'cmd.exe /c dir "C:\Program Files" && pause'
opher is offline   Reply With Quote
Old 3rd February 2004, 21:14   #7
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
ursus76 there is no easy way to keep the progress bar moving, the only solution would be to make the other install visible if thats possible.

If you get the reboot-needed error you should set the reboot flag in nsis and it will ask you to reboot when complete.

opher you are right, I had just copied ursus76's code and quickly modified it to return the error varialble without analysing it too much.

Vytautas
Vytautas is offline   Reply With Quote
Old 4th February 2004, 12:26   #8
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
ursus76, you can use the Banner plug-in to let the user know something is going on.

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 4th February 2004, 12:49   #9
eccles
NSIS Dev
 
eccles's Avatar
 
Join Date: Sep 2001
Location: Leicester, UK
Posts: 193
ursus76,

Give this a try. It uses the System plugin and the attached include file.
code:
!include ExecProgress.nsh

Name "ExecProgress Example"
OutFile ExecProgress.exe
ShowInstDetails show

Section

SetOutPath $TEMP

File "${NSISDIR}\makensisw.exe"
File "${NSISDIR}\makensis.exe"
!insertmacro ExecProgress makensisw SW_SHOWNORMAL $0
DetailPrint "Returned: $0"
Delete $TEMP\makensis.exe
Delete $TEMP\makensisw.exe

ReadEnvStr $0 "COMSPEC"
!insertmacro ExecProgress $0 SW_SHOWNORMAL $0
DetailPrint "Returned: $0"

!insertmacro ExecProgress '"I will surely fail"' SW_SHOWNORMAL $0
DetailPrint "Returned: $0"

SectionEnd

Attached Files
File Type: nsh execprogress.nsh (3.0 KB, 230 views)
eccles is offline   Reply With Quote
Old 16th June 2005, 21:02   #10
JCD29
Junior Member
 
Join Date: Sep 2003
Location: FRANCE
Posts: 34
it works but how to know that the dotnetfx.exe has been installed on my computer...because I don't want to install it whenever my installer is launched
thanks in advance

JCD
JCD29 is offline   Reply With Quote
Old 17th June 2005, 18:53   #11
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
http://nsis.sourceforge.net/archive/...nces=0,110,809 - how to detect
http://nsis.sourceforge.net/archive/...nstances=0,110 - "How to detect if ... is installed"
Takhir is offline   Reply With Quote
Old 17th June 2005, 19:41   #12
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,351
Send a message via ICQ to deguix
Or the wiki links:

http://nsis.sourceforge.net/wiki/ind....NET_Framework
http://nsis.sourceforge.net/wiki/ind...tion_Functions

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 19th November 2005, 01:49   #13
mrak
Junior Member
 
Join Date: Nov 2005
Posts: 1
Arrow

Is there a way to "fake" the completition in the progress bar? Install of .net Framework takes approx. 3-4 minutes, so one could simulate this?
mrak is offline   Reply With Quote
Old 13th January 2006, 20:26   #14
chuying
Guest
 
Posts: n/a
How to silently uninstall .Net Framework 2.0 beta?

Is there anyone who can help me to figure out
how to silently uninstall .Net Framework 2.0 beta?

Can I use similar command to silent install as
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Microsoft .NET Framework 2.0 Beta 2\install.exe /q:a /c:"install /q /l"
but change the switch?

Or if you can point me to any site where I can find the information. Thanks.
  Reply With Quote
Old 13th January 2006, 20:32   #15
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
You can check what the Add/Remove control panel calls when uninstalling .NET. Search under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

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 13th January 2006, 20:51   #16
chuying
Guest
 
Posts: n/a
Thank for Kichik's quick response.

The value for the registry key you have mentioned ( HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 2.0 Beta 2\uninstallstring)

is
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Microsoft .NET Framework 2.0 Beta 2\install.exe

When I ran this install.exe, it pops up user dialog since detecting the exists of the same version of .Netfx. In the dialog, there are two options: repair or uninstall. This dialog is what I want to pass by.
  Reply With Quote
Reply
Go Back   Winamp 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