pages/SiteConfig.nsi
changeset 0 67e1cc6cd929
child 2 0c0d5dadfca3
equal deleted inserted replaced
-1:000000000000 0:67e1cc6cd929
       
     1 Page custom SiteConfigCreate SiteConfigLeave " - Configure site information"
       
     2 
       
     3 Function SiteConfigCreate
       
     4   !insertmacro XPUI_INSTALLOPTIONS_EXTRACT_AS "pages\SiteConfig.ini" "SiteConfig.ini"
       
     5   !insertmacro XPUI_HEADER_TEXT "Configure website" "Enter basic information about your website."
       
     6   !insertmacro XPUI_INSTALLOPTIONS_DISPLAY "SiteConfig.ini"
       
     7 FunctionEnd
       
     8 
       
     9 Function SiteConfigLeave
       
    10   StrCmp $XPUI_ABORTED 1 0 +2
       
    11     Return
       
    12     
       
    13   ReadINIStr $site_name "$PLUGINSDIR\SiteConfig.ini" "Field 1" "State"
       
    14   StrCmp $site_name "" 0 +3
       
    15     MessageBox MB_OK|MB_ICONEXCLAMATION "Please enter a name for your site."
       
    16     Abort
       
    17     
       
    18   ReadINIStr $site_desc "$PLUGINSDIR\SiteConfig.ini" "Field 2" "State"
       
    19   StrCmp $site_desc "" 0 +3
       
    20     MessageBox MB_OK|MB_ICONEXCLAMATION "Please enter a description for your site."
       
    21     Abort
       
    22     
       
    23   ReadINIStr $site_copyright "$PLUGINSDIR\SiteConfig.ini" "Field 3" "State"
       
    24   StrCmp $site_copyright "" 0 +2
       
    25     StrCpy $site_copyright "No copyright assigned."
       
    26     
       
    27   Push $site_copyright
       
    28   Call CleanCopyright
       
    29   Pop $site_copyright
       
    30   
       
    31   StrCpy $url_scheme "standard"
       
    32   ReadINIStr $0 "$PLUGINSDIR\SiteConfig.ini" "Field 4" "State"
       
    33   IntCmp $0 1 0 +2 +2
       
    34     StrCpy $url_scheme "short"
       
    35     
       
    36   StrCpy $start_with "blank"
       
    37   ReadINIStr $0 "$PLUGINSDIR\SiteConfig.ini" "Field 6" "State"
       
    38   IntCmp $0 1 0 +2 +2
       
    39     StrCpy $start_with "tutorial"
       
    40 FunctionEnd
       
    41 
       
    42 Function CleanCopyright
       
    43   Pop $0
       
    44   ${str_replace} $0 "©" "©" "$0"
       
    45   Push $0
       
    46 FunctionEnd