Old 1st July 2007, 06:10   #1
SteveAtkinson
Junior Member
 
Join Date: Jul 2007
Posts: 3
Start Menu question

Sorry if this has been answered a bazliion times, but I have been searching the docs and google for a while and cant find the answer.

I want to modify my install script so that it asks if the user would like to add a start menu shortcut for their own menu or for all users. I can see how to make the change to current/all but not how to get that info from the user.

I've inherited a project and this is the first time I've had to mess with install scripts.

Thanks for your help!
SteveAtkinson is offline   Reply With Quote
Old 1st July 2007, 10:50   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Either use InstallOptions:
code:

[Settings]
NumFields=3

[Field 1]
Type=Label
Left=0
Right=-1
Top=0
Bottom=24

[Field 2]
Type=RadioButton
Left=30
Right=-1
Top=50
Bottom=58
State=1
Flags=GROUP

[Field 3]
Type=RadioButton
Left=30
Right=-1
Top=70
Bottom=78
State=0



Or use a MessageBox!

Stu
Afrow UK is offline   Reply With Quote
Old 1st July 2007, 17:33   #3
SteveAtkinson
Junior Member
 
Join Date: Jul 2007
Posts: 3
well I'm a total noob to the nsis scripting, I'd imagined that this would be a "standard feature" of an installer, it must be a very common request. I was kinda hoping for a simpler answer, but I'll have a look at the custom message box. It just feels "clumsy" seeing as you already have a very nice dialog box (MUI_STARTMENU)

I'd like to add another question if I may regarding "AddSize"

The script includes a check for .Net Framework 2.0 which, in a greatly simplified form, is shown below.

The problem is, the size is getting added whether or not .Net is isnatlled. Why is this and how can I fix it?

code:

Section "Microsoft .NET Framework v2.0"
SectionIn RO
Call GetDotNETVersion
Pop $0
${If} $0 == "not found"
goto lbl_StartInstallNotFound
${EndIf}
# version check snipped
goto lbl_Done

lbl_Confirmed:
AddSize 153600
nsisdl::download \
/TIMEOUT=30000 "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe" "$PLUGINSDIR\dotnetfx.exe"
# more snippage

lbl_done:
SectionEnd


SteveAtkinson is offline   Reply With Quote
Old 1st July 2007, 17:39   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
AddSize is a compile time instruction and therefore cannot be jumped over at run time. Use SectionSetSize instead.

MessageBoxes are very easy to use. As for a standard feature, using InstallOptions is very easy, so you could turn it into a macro for others to use.

Stu
Afrow UK is offline   Reply With Quote
Old 1st July 2007, 18:49   #5
SteveAtkinson
Junior Member
 
Join Date: Jul 2007
Posts: 3
Thanks Afrow, I've been messing with it and sorted the AddSize out by modifying my .onInit and checking there if .Net is installed, and if so, doing a SectionSetSize.

I hadn't intended getting this deep into the nitty-gritty of NSIS but it's kinda fun. At least now I can close one of our TRAC tickets
SteveAtkinson 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