|
|
|
|
#1 |
|
Junior Member
Join Date: May 2004
Location: Canada
Posts: 6
|
Installing .NET with dotnetfx.exe
Hello all,
I just got NSIS, so I am very much a newbie. I used HM NIS Editor and its Wizard to make a simple install for an application I am working on. The application is written in VB.NET, and my boss would like me to distribute the framework, and install it if needed, with the installer for the application. I have a few questions regarding this issue. I found the nifty little function to detect .NET framework in the Documentation (and in the archives), and I got it to work with my script. I also read in the forums that you should place this in the on.Init function, or something like that. I didnt fully understand that. Right now this is what I do: PHP Code:
My second question is how do I get the installer to install the .NET Framework. So, how do I package dotnetfx.exe into my installer, and then how do I get it to run that file (instead of the MessageBox part). I couldn't find an example of this anywhere. I am kinda under time pressure, so I havent looked at the docs in great detail, so Im not familiar with much yet. That's also why I am asking for help. Sorry if this is supposed to be "common" knowledge or something, and I am asking how to do it. Aside, from my little experince with NSIS, it seems like its a pretty cool system. And definitly different from MS Visual Studio Installer tool. Thanks in advance, Latem |
|
|
|
|
|
#2 |
|
Senior Member
|
Welcome to the forums Latem
onInit isn't a section, it's a function which is called right after starting the exe so you should define your onInit function like below on the very first beginning of your script code: to install .NET framework you should use ExecWait, cause it waits until the called application finished, alternative you can call it after your last dialog to install if necessary ExecWait: ExecWait '"C:\path\framework.exe" (/parameters)' first you write the path of the file you wanna use, and after this you set parameters you maybe need (You can find more Examples in NSIS\Examples\ as the name says) hope this helps greets Davion |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Just a side note:
You should also be careful to install the .NET Framework that matches the INSTALLED locale version of the Operating System. You should obtain the framework from the appropriate link. I have listed a few of these below. If you do not adhere to this, you could make your clients system unstable. ; .NET Framework ;English !define URL_DOTNET_1033 "http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe" ;German !define URL_DOTNET_1031 "http://download.microsoft.com/download/4/f/3/4f3ac857-e063-45d0-9835-83894f20e808/dotnetfx.exe" ;Spanish !define URL_DOTNET_1034 "http://download.microsoft.com/download/8/f/0/8f023ff4-2dc1-4f10-9618-333f5b9f8040/dotnetfx.exe" ;French !define URL_DOTNET_1036 "http://download.microsoft.com/download/e/d/a/eda9d4ea-8ec9-4431-8efa-75391fb91421/dotnetfx.exe" ;Portuguese (Brazil) !define URL_DOTNET_1046 "http://download.microsoft.com/download/8/c/f/8cf55d0c-235e-4062-933c-64ffdf7e7043/dotnetfx.exe" ;Chinese (Simplified) !define URL_DOTNET_2052 "http://download.microsoft.com/download/7/b/9/7b90644d-1af0-42b9-b76d-a2770319a568/dotnetfx.exe" See the Microsoft Download page for the framework, select the disered language and view the source and scan it for the download link if you need a language that I have not provided above. Cheers, ZIMSMS |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: May 2004
Location: Canada
Posts: 6
|
Thanks for the feedback.
This is my .onInit function: PHP Code:
thanks, Latem |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Try the following:
PHP Code:
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2004
Location: Canada
Posts: 6
|
that worked.
thank you. Latem |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
I have contributed an example of installing the .Net Framework, feel free to take a look at it at the following location.
Installing the Microsoft .Net Framework (Multi Language Example) |
|
|
|
|
|
#8 |
|
Junior Member
|
I don't mean to steal your thread, or be a complete noob - but I have been fooling around with the same thing and haven't been able to get it working. For some reason or another nothing happens once the script gets compiled, it just doesnt execute, any ideas? Thanks in advance.
-matt |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Matt,
I have attached a modified version of your script that will give you the functionality you asked for, However, I strongly advise that you read my Archive document (Follow the link above), to see how this should be done properly in a multi lingual install. BTW: You had it in an endless loop, and were never actually checking the registry to see if .Net was installed. Cheers, ZIMSMS |
|
|
|
|
|
#10 |
|
Junior Member
|
Thanks alot! I was actually trying to edit or remove my post when you were posting your reply! I'll blame that one on me being just completely out of whack. I restarted/organized my script and I'm gonna take it one step at a time. I'm now looking more indepth to your documentation and getting overwhelmed already, but I will endure. heh Thanks again for the help!
-matt |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
If you need help, let me know. I made a really nice Multilingual Example, but unfortunately, I set it up with a real world build environment set up for locale branding and everything, very flexible. Unfortunately, doing all that made it a little bit too big to post on the archive or in a thread.
|
|
|
|
|
|
#12 |
|
Junior Member
|
Alittle help would be great! If you want to send it to me, that would be fine, mattnorman82@snet.net shoudl be able to take it, just something to give me a heads up on how it should be set up, I've come to terms with me being a total newb. lol. Thanks again for everything!
-matt ps- I'm also idling in the chat room under the handle Disaster |
|
|
|
|
|
#13 |
|
Guest
Posts: n/a
|
How to obtain right language
I think I'm not getting this right...
The dotnetfx.exe you install has to be the same language as the os you are installing it on right? But like I interpret your code, you let the user select a language... What if that isn't the right one? Isn't there a way to determine the OS language and not let the user select it? TIA, Fretje |
|
|
|
#14 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Hello Fretje,
Actually, It does interpret the OS you are running on, and installs the appropriate dotnet executable no matter what language you choose to install the application in. Cheers, zimsms |
|
|
|
|
|
#15 |
|
Junior Member
Join Date: Sep 2003
Location: FRANCE
Posts: 34
|
Just to know how to get if the .net dotnetfx.exe has already been installed.
To test if the registry key exists : Software\Microsoft\.NETFramework thanks by advance. JCD |
|
|
|
|
|
#16 |
|
Guest
Posts: n/a
|
Hello zimsms,
Can you please shed some light on this please, because I realy don't see it. What I see in your .OnInit function is the following line: StrCpy $URL_DOTNET "${URL_DOTNET_1033}" But that's the only place where $URL_DOTNET is assigned and this looks quite "hard coded" to me... Or am I missing something? Where is the logic which determines the os language, and assigns the $URL_DOTNET accordingly? Greetings, Fretje |
|
|
|
#17 |
|
Guest
Posts: n/a
|
Other people than zimsms may answer as well ;-)
Or am I not the only one who isn't seeing it? Greetz, Fretje |
|
|
|
#18 |
|
Junior Member
Join Date: Sep 2003
Location: FRANCE
Posts: 34
|
Just to know how to get if the .net dotnetfx.exe has already been installed.
To test if the registry key exists : Software\Microsoft\.NETFramework thanks by advance. JCD |
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Fretje,
There used to be a complete example in the archive, but they've changed so much on this site, that I can't find it. I went and looked at my post, the one you are asking about. It looks like a piece of it may be missing. I noticed some of my files had been altered as well. I currently don't have the code on this machine. But, I can tell you the code you are looking for was in an override of the .GUIInit function, which I had called MyGUIINit. Basically you check in this override for the variable you populated in the .oninit ($OSLANGUAGE) then StrCpy the appropriate URL into the URL_DOTNET variable. The initial assignment you are seeing is just a default initialization. I will see if I can find a copy of my old example, and post the block in the thread. Finding it, may take a while, and I won't be able to post it until 8pm EST. (Currently (1pm EST). Cheers, ZIMSMS |
|
|
|
|
|
#20 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
|
|
|
|
|
|
#21 |
|
Junior Member
Join Date: Nov 2005
Posts: 13
|
hello zimsms,
I'm looking forward to receiving the right code... Thanks a lot already! Fretje |
|
|
|
|
|
#22 | |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Quote:
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
|
#23 |
|
Junior Member
Join Date: Sep 2003
Location: FRANCE
Posts: 34
|
thanks zimsms
for your help.. i discover the link JCD |
|
|
|
|
|
#24 |
|
Junior Member
Join Date: Nov 2005
Posts: 13
|
Still waiting for the code...
or some more insight into retrieving the OS language... tnx, Fretje |
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
|
Fretje,
I sent you a private message a few days ago..... Cheers, ZIMSMS |
|
|
|
|
|
#26 |
|
Junior Member
Join Date: Nov 2005
Posts: 13
|
Zimsms,
I didn't even know I could receive private messages ;-) But I have seen it now and replied to it... Greetings, Fretje |
|
|
|
|
|
#27 |
|
Junior Member
Join Date: Sep 2003
Location: FRANCE
Posts: 34
|
where is described IsDotNETInstalled ?
this method is provided with NSIS examples ? JCD |
|
|
|
|
|
#28 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You can use this one:
http://nsis.sourceforge.net/Get_.NET_Version Or the original IsDotNETInstalled: http://nsis.sourceforge.net/Special:...otNETInstalled NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|