bjonreyes
25th September 2006 22:23 UTC
how do you install to c:\; installoptions buttons and background
hello, i am a newbie here. i need some help in creating my web installer for my FilipinoDictionary-TTS thesis.
as of now, i created it using mingw.nsi but there are a few bugs and features i want it to do.
when using ultramodern ui and having an installoptions page, the background of that installoptions page, is not blue (i.e. doesn't conform with its background). it is a gray square on a blue background. how do you make it all blue? i tried putting some code from installoptions.nsi from the ultramodern ui examples to no avail. so how do you make installoptions background transparent even in ultramodern ui?
next how do you activate buttons in an installoptions page? i.e. activate an exec command when a button is pressed? i tried code from testnotify.nsi in the installoptions folder to no avail also.
also, is there a way to continue installation even if the installation directory chose in the directory page is c:\? i.e. enable next button on the directory page even if the chosen installation dir is c:\?
the reason is i included java, servcd, mingw, no-ip's duc, ie6, windows media player 10 and my thesis applications together where there are programs under a folder i made "program files". if my application is installed in c:\ it can also install java and under "program files" to "c:\program files" so that the user can have those applications installed at their default locations in c:\. You might say to just install using their msi's but i made it so like that, so that i can have these features:
1. run all of it in a cd via buttons in the installer (all executable files are beside the installer executable)
2. install all or any of the applications via the installer
3. install it in c:\ so all programs are installed in default locations
4. download programs whose files are not already beside the installer (done already)
5. use UltraModernUI to make the components' descriptions fit in the window (done)
6. use UltraModernUI while having installoptions pages with the default background. Using ModernUI makes their backgrounds default but the components' descriptions don't fit there.
so far i am having problems with numbers 1, 3 and 6.
any help would be very appreciated.
also , sorry for my english(i am filipino) and this long question.
and thanks in advance
attached is my installer
:)
bjonreyes
25th September 2006 22:28 UTC
part 2 of above
correction on last post
..chosen in the directory...
..java and programs under "program files"...
i have forgotten to include the php files
kichik
29th September 2006 15:38 UTC
1. You can have a custom InstallOptions page with buttons on it. Use the NOTIFY flag with every button and execute the installer when it's clicked and the notification is activated.
3.Use AllowRootInstallDir.
6. You usually set colors using SetCtlColors, but UMUI probably has a macro for its custom pages.
bjonreyes
12th October 2006 22:26 UTC
thanks, i discovered toset Flags in the .ini file to NOTIFY before when studying testnotify.nsi . AllowRootInstallDir worked but not SetCtlColors. I want to set the background of an installoptions .ini file to dark blue like that of UltraModernUI's background. can anybody help me here?. making it gray makes it out of place.
bjonreyes
15th October 2006 18:58 UTC
thanks for the help. i got them all. i read the UMUI readme to change the background color of the UMUI installoptions custom page. i had to recurse the exit function of the installoptions page just to get the installer to exit from it. the buttons load other applications then quit the installer. here's some code (so people having similar problems like me can search it more easily through search engines, "..." means irrelevant code)
showmirror.ini file
;ShowMirror.ini
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=7
[Field 1]
Type=Groupbox
Text=Run from CD, Install or just download files?
Left=0
Right=172
Top=0
Bottom=9
=
[Field 2]
Type=RadioButton
Text=Install
State=1
Left=84
Right=211
Top=40
Bottom=54
[Field 3]
Type=RadioButton
Text=Download only
Left=32
Right=38
Top=20
Bottom=26
[Field 4]
Type=Label
Text=Using mirror
Left=44
Right=276
Top=19
Bottom=28
[Field 5]
Type=Button
Text=run OfflineFilipinoDictionaryGU from Compact Disc
Left=42
Right=246
Top=102
Bottom=116
Flags=NOTIFY
[Field 6]
Type=Button
Text=run FilipinoDictionaryWebsite from Compact Disc
Left=42
Right=246
Top=81
Bottom=94
Flags=NOTIFY
[Field 7]
Type=Button
Text=run SysAdDic from Compact Disc
Left=42
Right=246
Top=59
Bottom=73
Flags=NOTIFY
FilipinoDictionary.nsi file
...
!include "UMUI.nsh"
;!include "MUI.nsh"
...
AllowRootDirInstall true
...
Page custom DownLoadOrInstall Buttons ": Download, install or run?"
...
Function .onInit
;-----------------------------------------------------------------------------------------------------------------------
...
installing:
InitPluginsDir
GetTempFileName $mirrorINI $PLUGINSDIR
File /oname=$mirrorINI "Dialogs\ShowMirror.ini"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "Dialogs\ShowMirror.ini" "ShowMirror.ini"
StrCpy $mirrorINI "$PLUGINSDIR\ShowMirror.ini"
FunctionEnd
...
var execsa
var execofgu
var execfdw
Function Buttons
ReadINIStr $0 $mirrorINI "Settings" "State"
StrCmp $0 5 executeofgu +1
StrCmp $0 6 executefdw +1
StrCmp $0 7 executesa end
executeofgu:
StrCmp $execofgu "1" end executeofgu1
executefdw:
StrCmp $execfdw "1" end executeofgu1
executesa:
StrCmp $execsa "1" end executeofgu1
executeofgu1:
Exec '$EXEDIR\FilipinoDictionaryWebsite.exe'
StrCpy $execofgu "1"
executefdw2:
Exec '$EXEDIR\OfflineFilipinoDictionaryGU.exe'
StrCpy $execfdw "1"
executesa3:
Exec '$EXEDIR\SysAdDic.exe'
StrCpy $execsa "1"
end:
call Buttons
Quit
FunctionEnd
...
Var HWND
;Page instfiles
;-----------------------------------------------------------------------------------------------------------------------
Function DownloadOrInstall
;-----------------------------------------------------------------------------------------------------------------------
Call oninit
IntCmp $Updating 1 update +1
WriteINIStr $mirrorINI "Field 4" "Text" "Download url is $PRODUCT_WEB_SITE/offline."
FlushINI $mirrorINI
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ShowMirror.ini"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ShowMirror.ini"
Pop $HWND ;HWND of dialog
;Apply the Background color at the page
SetCtlColors $HWND "" ${MUI_BGCOLOR}
;Apply the right text color and background color at all the field
GetDlgItem $0 $HWND 1200
SetCtlColors $0 ${MUI_TEXT_COLOR} ${MUI_BGCOLOR}
GetDlgItem $0 $HWND 1201
SetCtlColors $0 ${MUI_TEXT_COLOR} ${MUI_BGCOLOR}
GetDlgItem $0 $HWND 1202
SetCtlColors $0 ${MUI_TEXT_COLOR} ${MUI_BGCOLOR}
GetDlgItem $0 $HWND 1203
SetCtlColors $0 ${MUI_TEXT_COLOR} ${MUI_BGCOLOR}
!insertmacro MUI_INSTALLOPTIONS_SHOW
...
FunctionEnd
...