xca-0.4.6.nsi
来自「一个精简的CA程序」· NSI 代码 · 共 129 行
NSI
129 行
; xca.nsi;; This is the .nsi script for creating the nullsoft windows installer; The name of the installerName "X CA"Caption "X Certification Authority"; The licenseagreementLicenseText "You must accept the following BSD like license to continue."LicenseData COPYRIGHT; The file to writeOutFile "xca-0.4.6.exe"; The default installation directoryInstallDir $PROGRAMFILES\xca; Registry key to check for directory (so if you install again, it will ; overwrite the old one automatically)InstallDirRegKey HKLM SOFTWARE\xca "Install_Dir"; The text to prompt the user to enter a directoryComponentText "This will install the X Certification Authority (c) 2002 by Christian@Hohnstaedt.de"; The text to prompt the user to enter a directoryDirText "Choose a directory to install in to:"; The stuff to installSection "xca (required)" ClearErrors UserInfo::GetName IfErrors Win9x UserInfo::GetAccountType Pop $0 StrCmp $0 "Admin" 0 +3 SetShellVarContext all Goto done SetShellVarContext current Win9x: SetShellVarContext current done: ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File "Release\xca.exe" File "img\bigcert.png" File "img\bigcrl.png" File "img\bigcsr.png" File "img\bigkey.png" File "img\bigtemp.png" File "img\halfkey.png" File "img\invalidcert.png" File "img\invalidcertkey.png" File "img\key.png" File "img\key.ico" File "img\key.xpm" File "img\netscape.png" File "img\req.png" File "img\reqkey.png" File "img\revoked.png" File "img\template.png" File "img\validcert.png" File "img\validcertkey.png" File "img\crl.png" File "Release\libdb41.dll" File "Release\SSLeay32.dll" File "Release\libeay32.dll" File "Release\msvcrt.dll" File "Release\msvcp60.dll" File "Release\qt-mt230nc.dll" ; Write the installation path into the registry WriteRegStr HKLM SOFTWARE\xca "Install_Dir" "$INSTDIR" ; Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xca" "DisplayName" "X CA (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xca" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "uninstall.exe"SectionEnd; optional sectionSection "Start Menu Shortcuts" CreateDirectory "$SMPROGRAMS\xca" CreateShortCut "$SMPROGRAMS\xca\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 CreateShortCut "$SMPROGRAMS\xca\xca.lnk" "$INSTDIR\xca.exe" "" "$INSTDIR\xca.exe" 0SectionEnd; uninstall stuffUninstallText "This will uninstall xca. Hit next to continue."; special uninstall section.Section "Uninstall" ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\xca" DeleteRegKey HKLM "SOFTWARE\xca" DeleteRegKey HKCU "SOFTWARE\xca" ; remove files Delete $INSTDIR\xca.exe Delete $INSTDIR\*.png Delete $INSTDIR\*.dll Delete $INSTDIR\*.ico Delete $INSTDIR\*.xpm ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe RMDir $INSTDIR ClearErrors UserInfo::GetName IfErrors Win9x UserInfo::GetAccountType Pop $0 StrCmp $0 "Admin" 0 +3 SetShellVarContext all Goto done SetShellVarContext current Win9x: SetShellVarContext current done: ; remove shortcuts, if any. Delete "$SMPROGRAMS\xca\*.*" ; remove directories used. RMDir "$SMPROGRAMS\xca" SectionEnd; eof
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?