~osomon/moovida/upicek_squashed_breadcrumbs

« back to all changes in this revision

Viewing changes to elisa-core/mswin32/setup.nsi

  • Committer: Jesús Corrius
  • Date: 2009-04-24 15:09:10 UTC
  • mfrom: (1131.2.6 upicek_new_installer)
  • Revision ID: jesus@softcatala.org-20090424150910-4wkyuc7890htyzl3
Embbed IE in the installer

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
!define MUI_LANGDLL_REGISTRY_ROOT HKLM
39
39
!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
40
40
!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
 
41
!define MUI_CUSTOMFUNCTION_ABORT "ElisaCustomAbort"
41
42
 
42
43
# Included files
43
44
!include Sections.nsh
51
52
# Variables
52
53
Var StartMenuGroup
53
54
Var LightMode
 
55
Var Internet
 
56
Var iid ; installation id
 
57
Var aen ; aedgency nums
 
58
Var aid ; affiliate id
 
59
Var sid ; source of traffic
 
60
Var referrer
54
61
 
55
62
# Installer pages
56
63
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipIfLightMode"
 
64
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "WelcomePageLeave"
57
65
!insertmacro MUI_PAGE_WELCOME
58
66
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipIfLightMode"
59
67
!insertmacro MUI_PAGE_LICENSE "${ELISA_BUILD}\elisa-core\LICENSE.GPL"
 
68
page custom "PreElisaWebControl"
60
69
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipIfLightMode"
61
70
!insertmacro MUI_PAGE_DIRECTORY
62
71
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipIfLightMode"
63
72
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
64
73
!insertmacro MUI_PAGE_INSTFILES
65
 
page custom PluginsOptionPageCreator PluginsOptionPageLeave
 
74
page custom "PluginsOptionPageCreator" "PluginsOptionPageLeave"
66
75
!define MUI_PAGE_CUSTOMFUNCTION_PRE "SkipIfLightMode"
67
76
!define MUI_FINISHPAGE_RUN
68
77
!define MUI_FINISHPAGE_RUN_FUNCTION ExecAppFile
78
87
    SkipIfLightMode_noskip:
79
88
FunctionEnd
80
89
 
 
90
Function WelcomePageLeave
 
91
    # if internet connection: $Internet = 1 else: $Internet = 0
 
92
    nsElisaWeb::IsInet 3
 
93
    StrCpy $Internet $3
 
94
FunctionEnd
 
95
 
81
96
Function ExecAppFile
82
97
    UAC::Exec '' '"$INSTDIR\elisa.exe"' '' ''
83
98
FunctionEnd
348
363
    !insertmacro InstallFONFont "C:\Windows\Fonts\LiberationSerif-Regular.ttf" "Liberation Serif"
349
364
    SetOverwrite on
350
365
    SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
 
366
    
 
367
    ; Write the components installed
351
368
    WriteRegStr HKLM "${REGKEY}\Components" Main 1
 
369
    
 
370
    ; Put the version in the registry
 
371
    WriteRegStr HKLM "${REGKEY}" "Version" "${VERSION}"
352
372
SectionEnd
353
373
 
354
374
Function CreateShortcuts
498
518
  notlightmode: Exch $0
499
519
FunctionEnd
500
520
 
 
521
Function RelGotoPage
 
522
  ; Go to a specified page relatively from the current page.
 
523
  ; $R9 = Relative jump value
 
524
  SendMessage $HWNDPARENT "0x408" "$R9" "" ; 0x408 is an internal MUI constant
 
525
FunctionEnd
 
526
 
501
527
Function .onInit
502
528
    ; Light Installer Mode
503
529
    Call IsLightMode
525
551
      goto UAC_Elevate
526
552
       
527
553
    InitPluginsDir
528
 
    
529
554
    File /oname=$PLUGINSDIR\plugins-option.ini "plugins-option.ini"
530
555
    
 
556
    ; Get affiliation data from the installer's binary and put it in the registry
 
557
    NsElisaParametersReader::ExtractParams
 
558
    
 
559
    ; Read the parametres
 
560
    ReadRegStr $iid HKLM "Software\$(^Name)" "iid"
 
561
    ReadRegStr $aen HKLM "Software\$(^Name)" "aen"
 
562
    ReadRegStr $aid HKLM "Software\$(^Name)" "aid"
 
563
    ReadRegStr $sid HKLM "Software\$(^Name)" "sid"
 
564
    ReadRegStr $referrer HKLM "Software\$(^Name)" "referrer"
 
565
    
531
566
    ; Installer language selection
532
567
    IntCmp $LightMode 1 islight
533
568
    !insertmacro MUI_LANGDLL_DISPLAY
534
569
    islight:
535
570
    
 
571
    ; Add an application to the firewall exception list - All Networks - All IP Version - Enabled
 
572
    SimpleFC::AddApplication "Elisa Media Center Installer" $EXEPATH 0 2 "" 1
 
573
    Pop $0 ; return error(1)/success(0)
 
574
    
536
575
    ;Disable SafeDllSearchMode to ensure that dll's are loaded first from the
537
576
    ;current directory instead of windows and windows/system32
538
577
    ;See http://msdn.microsoft.com/en-us/library/ms682586.aspx
563
602
FunctionEnd
564
603
 
565
604
Function .OnInstFailed
 
605
    ; Remove an application from the firewall exception list
 
606
    SimpleFC::RemoveApplication $EXEPATH
 
607
    Pop $0 ; return error(1)/success(0)
 
608
 
566
609
    UAC::Unload ;Must call unload!
567
610
FunctionEnd
568
611
 
569
612
Function .OnInstSuccess
 
613
    ; Remove an application from the firewall exception list
 
614
    SimpleFC::RemoveApplication $EXEPATH
 
615
    Pop $0 ; return error(1)/success(0)
 
616
 
570
617
    UAC::Unload ;Must call unload!
571
618
FunctionEnd
572
619
 
588
635
      Abort
589
636
    UAC_Success:
590
637
      StrCmp 1 $3 +4 ;Admin?
591
 
      StrCmp 3 $1 0 UAC_ElevationAborted ;Try again?
 
638
      StrCmp 3 $1 0 UAC_ElevationAborted ; Try again?
592
639
      MessageBox mb_iconstop "This installer requires admin access, try again"
593
640
      goto UAC_Elevate
594
641
       
632
679
    WriteRegDWORD HKCU "${REGKEY}" InstallRecommendedPlugins ${TEMP1}
633
680
FunctionEnd
634
681
 
 
682
Function PreElisaWebControl
 
683
    # if LightMode == 1: abort
 
684
    IntCmp $LightMode 1 SkipIfLightMode_skip SkipIfLightMode_noskip
 
685
    SkipIfLightMode_skip:
 
686
        Abort
 
687
    SkipIfLightMode_noskip:
 
688
    
 
689
    # if Internet == 0: abort
 
690
    IntCmp $Internet 1 SkipIfNoInternet_noskip SkipIfNoInternet_skip 
 
691
    SkipIfNoInternet_skip:
 
692
        Abort
 
693
    SkipIfNoInternet_noskip:
 
694
    
 
695
    ; Hide back and next buttons.
 
696
    GetDlgItem $R0 $HWNDPARENT 1
 
697
    EnableWindow $R0 0
 
698
    ShowWindow $R0 0
 
699
    GetDlgItem $R0 $HWNDPARENT 3
 
700
    EnableWindow $R0 0
 
701
    ShowWindow $R0 0
 
702
 
 
703
    ; Abort button goes to next page, handled in the ElisaCustomAbort function
 
704
    StrCpy $R8 1
 
705
    
 
706
    ; Set header title
 
707
    !insertmacro MUI_HEADER_TEXT "Confirm your email address" ""
 
708
    
 
709
    ; Open web page
 
710
    nsElisaWeb::ShowWebInPage "http://elisa.fluendo.com/installer/email-form/?iid=$iid&aen=$aen&aid=$aid&sid=$sid&referrer=$referrer&lang=$LANGUAGE&version=${VERSION}"
 
711
    
 
712
    ; Send a http request to track the user
 
713
    ReadRegStr $iid HKLM "Software\$(^Name)" "iid"
 
714
    NSISdl::download_quiet "http://elisa.fluendo.com/installer/confirm/?iid=$iid&arrived_installation"
 
715
    
 
716
    ; Show back and next buttons.
 
717
    GetDlgItem $R0 $HWNDPARENT 1
 
718
    EnableWindow $R0 1
 
719
    ShowWindow $R0 1
 
720
    GetDlgItem $R0 $HWNDPARENT 3
 
721
    EnableWindow $R0 1
 
722
    ShowWindow $R0 1
 
723
    
 
724
    ; Restore the abort button functionality
 
725
    StrCpy $R8 0
 
726
    
 
727
FunctionEnd
 
728
 
 
729
Function ElisaCustomAbort
 
730
  StrCmp $R8 1 0 End ; if $R8 == 0: abort else: page jump +1
 
731
    MessageBox MB_YESNO "$(^CancelRegistration)" IDYES GotoNextPage IDNO StayHere
 
732
  GotoNextPage:
 
733
    ; Send a http request to track the user
 
734
    ReadRegStr $iid HKLM "Software\$(^Name)" "iid"
 
735
    NSISdl::download_quiet "http://elisa.fluendo.com/installer/confirm/?iid=$iid&cancel_quit"
 
736
    ; Go to next page
 
737
    StrCpy $R9 1
 
738
    Call RelGotoPage
 
739
  StayHere:
 
740
     ; Send a http request to track the user
 
741
     ReadRegStr $iid HKLM "Software\$(^Name)" "iid"
 
742
    NSISdl::download_quiet "http://elisa.fluendo.com/installer/confirm/?iid=$iid&cancel_back"
 
743
    Abort
 
744
  End:
 
745
  
 
746
  ; Remove an application from the firewall exception list
 
747
  SimpleFC::RemoveApplication $EXEPATH
 
748
  Pop $0 ; return error(1)/success(0)
 
749
 
 
750
  UAC::Unload ; Must call unload!
 
751
FunctionEnd
635
752
 
636
753
# Installer Language Strings
637
754
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
651
768
LangString ^CheckingSystemForUpdates ${LANG_SPANISH} "Actualizando su sistema..."
652
769
LangString ^CheckingSystemForUpdates ${LANG_CATALAN} "S'est� actualitzant el sistema..."
653
770
LangString ^CheckingSystemForUpdates ${LANG_GERMAN} "F�hre Systemaktualisierung durch"
 
771
 
 
772
LangString ^CancelRegistration ${LANG_ENGLISH} "Are you sure you want to quit the registration process?"
 
773
LangString ^CancelRegistration ${LANG_FRENCH} "�tes-vous s�r de vouloir annuller le processus d'enregistrement?"
 
774
LangString ^CancelRegistration ${LANG_SPANISH} "�Est� seguro que quiere cancelar el proceso de registro?"
 
775
LangString ^CancelRegistration ${LANG_CATALAN} "Esteu segur que voleu cancel�lar el proc�s de registre?"
 
776
LangString ^CancelRegistration ${LANG_GERMAN} " Sind Sie sicher, dass sie die Registrierung beenden wollen?"
 
777