Archive: .NET Framework Section Question


.NET Framework Section Question
  I have already created a function for checking if the .NET Framework is installed (attached). If neither version is installed, I would like the installer to create a read-only section with ".NET Framework". On the finish page, it would be nice if I could get a checked/read-only box with "Install .NET Framework Now" which runs the setup program after it has been unpacked and the have it run silently with:

ExecWait('".NET Framework 1.1 Redistributable Final Beta.exe" dotnetfx.exe /q:a /c:"install /l /q"' 
If the .NET Framework is detected, I would like nothing to be done. (No setup program extracted, nothing installed but the main program.)

Is this feasible?

AFAIK there is no instruction that can change the read-only parameter of a Section. So it isn't (yet) possible. Maybe an idea for NSIS.


Hmmm, that'll be okay for now.

I was just wondering if it is possible to add sections using functions. So is this (adding sections with functions) currently possible?


It's not possible to create functions but it is possible to change every flag of a section including read-only at runtime using SectionSetFlags and SectionGetFlags. You must do it before or after the components page shows because while it does you can only change the selected and bold flag.

What you need to do is create a RO section with the approriate name. Upon runtime, if you don't need this section to be shown in the components page and executed set its flags to not have SF_SELECTED and set its name to nothing.

For example:

StrCmp$0 "noneed" 0 donthide

# 0 doesn't include SF_SELECTED of course :)
SectionSetFlags ${SEC} 0
SectionSetText${SEC} ""
>donthide:

I have decided to take a difference approach and check for .NET using ASP 3.0, which points you to the version of the installer that you need.

Now I need the installer to instead extract a file from itself to a temp directory, ExecWait that file, and then delete that file after the setup is over. How can I accomplish this?


Try this:


InitPluginsDir

File/oname=$PLUGINSDIR/file2exec.exe mylocalfile.exe
>
Then just exec the file and the file will be deleted automatically when the installer finishes because it is in the plugins dir. If you are using Modern UI, i believe it already inits the plugins dir so that line is not neeeded.

Sorry, the slash is backwards because the forum doesn't like the slash.


Thanks everyone very much for your help!