Ticket #1458: FileZilla Server.nsi.patch

File FileZilla Server.nsi.patch, 11.5 KB (added by eyebex, 19 years ago)

CVS diff patch

  • source/install/FileZilla

    RCS file: /cvsroot/filezilla/FileZilla Server/source/install/FileZilla Server.nsi,v
    retrieving revision 1.36
    diff -u -r1.36 FileZilla Server.nsi
     
    1414;--------------------------------
    1515;Product Info
    1616
    17   !define VERSION "beta 0.9.4b" ;Define your own software version here
    18   Name "FileZilla Server ${VERSION}" ;Define your own software name here
     17  !define PRODUCT_NAME "FileZilla Server"
     18  !define PRODUCT_VERSION "beta 0.9.4b"
     19  !define PRODUCT_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
     20  Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
    1921
    2022;StartOptions Page strings
    2123LangString StartOptionsTitle ${LANG_ENGLISH} ": Server startup settings"
     
    2426;Modern UI Configuration
    2527
    2628  !define MUI_ABORTWARNING
    27  
     29
    2830  !define MUI_ICON "..\res\filezilla server.ico"
    2931  !define MUI_UNICON "uninstall.ico"
    30  
     32
    3133;--------------------------------
    3234;Pages
    3335
     
    4244
    4345;--------------------------------
    4446;Languages
    45  
     47
    4648  !insertmacro MUI_LANGUAGE "English"
    4749
    4850;--------------------------------
    4951;More
    50  
     52
    5153  ;General
    5254  OutFile "../../FileZilla_Server.exe"
    53  
     55
    5456  ;Installation types
    5557  InstType "Standard"
    5658  InstType "Full"
    5759
    5860  ;Descriptions
    59   LangString DESC_SecFileZillaServer ${LANG_ENGLISH} "Copy all required files of FileZilla server to the application folder."
     61  LangString DESC_SecFileZillaServer ${LANG_ENGLISH} "Copy all required files of FileZilla Server to the application folder."
    6062  LangString DESC_SecSourceCode ${LANG_ENGLISH} "Copy the source code of FileZilla Server to the application folder"
    61   LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create shortcuts to FileZilla Server in the Start menu"
     63  LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create shortcuts to FileZilla Server in the Start Menu"
    6264  LangString DESC_SecDesktopIcon ${LANG_ENGLISH} "Create an Icon on the desktop for quick access to FileZilla Server"
    6365
    6466  ;Folder-selection page
    65   InstallDir "$PROGRAMFILES\FileZilla Server"
     67  InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
     68  InstallDirRegKey HKLM "${PRODUCT_UNINSTALL}" "UninstallString"
    6669
    6770  ShowInstDetails show
    6871
     
    8588  Push "FileZilla Server Helper Window"
    8689  call CloseWindowByName
    8790  DetailPrint "Uninstalling service..."
    88   ExecWait '"$INSTDIR\FileZilla Server.exe" /uninstall' 
     91  ExecWait '"$INSTDIR\FileZilla Server.exe" /uninstall'
    8992  Sleep 500
    90   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "FileZilla Server"
    91   DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "FileZilla Server"
     93  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCT_NAME}"
     94  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCT_NAME}"
    9295  goto copy_main_done
    9396 found:
    9497  GetTempFileName $R1
     
    100103  Push "FileZilla Server Helper Window"
    101104  call CloseWindowByName
    102105  DetailPrint "Uninstalling service..."
    103   ExecWait '"$R1" /uninstall' 
     106  ExecWait '"$R1" /uninstall'
    104107  Sleep 500
    105   DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "FileZilla Server"
    106   DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "FileZilla Server"
     108  DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCT_NAME}"
     109  DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "${PRODUCT_NAME}"
    107110  Delete "$INSTDIR\FileZilla Server.exe"
    108111  Rename $R1 "$INSTDIR\FileZilla Server.exe"
    109112 copy_main_done:
    110113
    111   File "..\Release\FileZilla server.pdb"
     114  File "..\Release\FileZilla Server.pdb"
    112115
    113116  ; Stopping interface
    114117  DetailPrint "Closing interface..."
     
    116119  Call CloseWindowByName
    117120
    118121  ; Put file there
    119   File "..\Release\FileZilla server.pdb"
     122  File "..\Release\FileZilla Server.pdb"
    120123  File "..\Interface\Release\FileZilla Server Interface.exe"
    121124  File "..\GFtp\Release\FzGss.dll"
    122125  File "..\..\readme.htm"
    123126  File "..\..\license.txt"
    124127  File "dbghelp.dll"
    125128  ; Write the uninstall keys for Windows
    126   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FileZilla Server" "DisplayName" "FileZilla Server (remove only)"
    127   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FileZilla Server" "UninstallString" '"$INSTDIR\uninstall.exe"'
     129  WriteRegStr HKLM "${PRODUCT_UNINSTALL}" "DisplayName" "FileZilla Server (remove only)"
     130  WriteRegStr HKLM "${PRODUCT_UNINSTALL}" "UninstallString" '"$INSTDIR\uninstall.exe"'
    128131  WriteUninstaller "$INSTDIR\Uninstall.exe"
    129132SectionEnd
    130133
     
    160163  File "StartupOptions.ini"
    161164  File "uninstall.ico"
    162165  StrCpy $0 "source"
    163  
     166
    164167SectionEnd
    165168
    166169; optional section
    167170Section "Start Menu Shortcuts" SecStartMenu
    168171SectionIn 1 2
    169   CreateDirectory "$SMPROGRAMS\FileZilla Server"
    170   CreateShortCut "$SMPROGRAMS\FileZilla Server\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
    171   CreateShortCut "$SMPROGRAMS\FileZilla Server\FileZilla Server Interface.lnk" "$INSTDIR\FileZilla Server Interface.exe" "" "$INSTDIR\FileZilla Server Interface.exe" 0
     172  CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
     173  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
     174  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\FileZilla Server Interface.lnk" "$INSTDIR\FileZilla Server Interface.exe" "" "$INSTDIR\FileZilla Server Interface.exe" 0
    172175
    173176  strcmp $1 "9x" shortcut9x
    174177  !insertmacro MUI_INSTALLOPTIONS_READ $R0 $2 "Field 2" "State"
    175178  StrCmp $R0 "Do not install as service, start server automatically (not recommended)" shortcut9x
    176179
    177180  ;NT service shortcuts
    178   CreateShortCut "$SMPROGRAMS\FileZilla Server\Start FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/start" "$INSTDIR\FileZilla Server.exe" 0
    179   CreateShortCut "$SMPROGRAMS\FileZilla Server\Stop FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/stop" "$INSTDIR\FileZilla Server.exe" 0
     181  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Start FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/start" "$INSTDIR\FileZilla Server.exe" 0
     182  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Stop FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/stop" "$INSTDIR\FileZilla Server.exe" 0
    180183  goto shortcut_done
    181  shortcut9x: 
     184 shortcut9x:
    182185  ;Compat mode
    183   CreateShortCut "$SMPROGRAMS\FileZilla Server\Start FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/compat /start" "$INSTDIR\FileZilla Server.exe" 0
    184   CreateShortCut "$SMPROGRAMS\FileZilla Server\Stop FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/compat /stop" "$INSTDIR\FileZilla Server.exe" 0
     186  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Start FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/compat /start" "$INSTDIR\FileZilla Server.exe" 0
     187  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Stop FileZilla Server.lnk" "$INSTDIR\FileZilla Server.exe" "/compat /stop" "$INSTDIR\FileZilla Server.exe" 0
    185188
    186189 shortcut_done:
    187  
     190
    188191  StrCmp $0 "source" CreateSourceShortcuts NoSourceShortcuts
    189192 CreateSourceShortcuts:
    190   CreateShortCut "$SMPROGRAMS\FileZilla Server\FileZilla Server Source Project.lnk" "$INSTDIR\source\FileZilla Server.dsw" "" "$INSTDIR\source\FileZilla Server.dsw" 0
     193  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\FileZilla Server Source Project.lnk" "$INSTDIR\source\FileZilla Server.dsw" "" "$INSTDIR\source\FileZilla Server.dsw" 0
    191194 NoSourceShortcuts:
    192195SectionEnd
    193196
     
    199202Section "-PostInst"
    200203
    201204  ; Write the installation path into the registry
    202   WriteRegStr HKCU "SOFTWARE\FileZilla Server" "Install_Dir" "$INSTDIR"
    203   WriteRegStr HKLM "SOFTWARE\FileZilla Server" "Install_Dir" "$INSTDIR"
     205  WriteRegStr HKCU "SOFTWARE\${PRODUCT_NAME}" "Install_Dir" "$INSTDIR"
     206  WriteRegStr HKLM "SOFTWARE\${PRODUCT_NAME}" "Install_Dir" "$INSTDIR"
    204207
    205208  ;Set Adminport
    206209  !insertmacro MUI_INSTALLOPTIONS_READ $R0 $2 "Field 4" "State"
    207210  ExecWait '"$INSTDIR\FileZilla Server.exe" /adminport $R0'
    208211  ExecWait '"$INSTDIR\FileZilla Server Interface.exe" /adminport $R0'
    209  
     212
    210213  StrCmp $1 "9x" Install_9x
    211  
     214
    212215  !insertmacro MUI_INSTALLOPTIONS_READ $R0 $2 "Field 2" "State"
    213216  StrCmp $R0 "Do not install as service, started automatically (not recommended)" Install_Standard_Auto
    214217  DetailPrint "Installing Service..."
     
    221224  goto done
    222225 Install_9x:
    223226  !insertmacro MUI_INSTALLOPTIONS_READ $R0 $2 "Field 2" "State"
    224   StrCmp $R0 "Start manually" done 
     227  StrCmp $R0 "Start manually" done
    225228 Install_Standard_Auto:
    226229  DetailPrint "Put FileZilla Server into registry..."
    227230  ClearErrors
     
    243246  goto interface_done
    244247 interface_cu:
    245248  WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "FileZilla Server Interface" '"$INSTDIR\FileZilla Server Interface.exe"'
    246  interface_done: 
     249 interface_done:
    247250
    248251SectionEnd
    249252
     
    269272
    270273  ; we are not NT.
    271274  StrCpy $1 "9x"
    272  
     275
    273276  ;Extract InstallOptions INI Files
    274277  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "StartupOptions9x.ini"
    275278  StrCpy $2 "StartupOptions9x.ini"
     
    278281 detection_NT:
    279282  ; we are NT
    280283  StrCpy $1 "NT"
    281  
     284
    282285  ;Extract InstallOptions INI Files
    283286  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "StartupOptions.ini"
    284287  strcpy $2 "StartupOptions.ini"
     
    286289 detection_end:
    287290
    288291FunctionEnd
    289  
     292
    290293LangString TEXT_IO_TITLE ${LANG_ENGLISH} "Startup settings"
    291294LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "Select startup behaviour for FileZilla Server"
    292295
     
    344347  Push "FileZilla Server Helper Window"
    345348  Call un.CloseWindowByName
    346349  DetailPrint "Uninstalling service..."
    347   ExecWait '"$INSTDIR\FileZilla Server.exe" /uninstall' 
     350  ExecWait '"$INSTDIR\FileZilla Server.exe" /uninstall'
    348351  Sleep 500
    349352
    350353  ; Stopping interface
     
    353356  Call un.CloseWindowByName
    354357
    355358  ; remove registry keys
    356   DeleteRegValue HKCU "Software\FileZilla Server" "Install_Dir"
    357   DeleteRegValue HKLM "Software\FileZilla Server" "Install_Dir"
    358   DeleteRegKey /ifempty HKCU "Software\FileZilla Server"
    359   DeleteRegKey /ifempty HKLM "Software\FileZilla Server"
     359  DeleteRegValue HKCU "Software\${PRODUCT_NAME}" "Install_Dir"
     360  DeleteRegValue HKLM "Software\${PRODUCT_NAME}" "Install_Dir"
     361  DeleteRegKey /ifempty HKCU "Software\${PRODUCT_NAME}"
     362  DeleteRegKey /ifempty HKLM "Software\${PRODUCT_NAME}"
    360363  MessageBox MB_YESNO "Delete settings?" IDNO NoSettingsDelete
    361364  Delete "$INSTDIR\FileZilla Server.xml"
    362365  Delete "$INSTDIR\FileZilla Server Interface.xml"
    363366 NoSettingsDelete:
    364   DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FileZilla Server"
     367  DeleteRegKey HKLM "${PRODUCT_UNINSTALL}"
    365368  ; remove files
    366369  Delete "$INSTDIR\FileZilla Server.exe"
    367370  Delete "$INSTDIR\FileZilla Server Interface.exe"
    368   Delete "$INSTDIR\FileZilla server.pdb"
     371  Delete "$INSTDIR\FileZilla Server.pdb"
    369372  Delete $INSTDIR\FzGss.dll
    370373  Delete "$INSTDIR\dbghelp.dll"
    371374  Delete $INSTDIR\license.txt
     
    397400
    398401  ; MUST REMOVE UNINSTALLER, too
    399402  Delete $INSTDIR\uninstall.exe
    400  
     403
    401404  ; remove shortcuts, if any.
    402   Delete "$SMPROGRAMS\FileZilla Server\*.*"
     405  Delete "$SMPROGRAMS\${PRODUCT_NAME}\*.*"
    403406  Delete "$DESKTOP\FileZilla Server Interface.lnk"
    404   RMDir "$SMPROGRAMS\FileZilla Server"
     407  RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
    405408
    406409  ; remove directories used.
    407410