S Inst做pc軟件aller”
;The file to write
OutFile “MyIISInstaller.exe”
;The default installation directory
InstallDir $PROGRAMFILES\MyIIS
;——————————–
;Interface Settings
;The title displayed on the dialog
Caption “My IIS Installer”
;The text displayed on the welcome page
WelcomeText “Welcome to My IIS Installer.”
;The text displayed on the finish page
FinishText “My IIS was successfully installed.”
;——————————–
;Pages
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;——————————–
;Languages
!insertmacro MUI_LANGUAGE “English”
;——————————–
;Installer Sections
Section “IIS” SectionIIS
SetOutPath $INSTDIR
File /r “C:\IIS”
SectionEnd
;——————————–
;Uninstaller Section
Section “Uninstall”
;Remove installed files
Delete $INSTDIR\*
;Remove installed registry keys
DeleteRegKey HKLM “Software\MyCompany\MyIIS”
SectionEnd
“`
上面的腳本文件包含了以下幾個部分:
– General:指定打包的一些基本信息,例如打包后的文件名、默認(rèn)安裝目錄等。
– Interface Settings:指定打包時的界面設(shè)置,例如歡迎頁面和完成頁面的文字內(nèi)容。
– Pages:指定打包時需要顯示的頁面,例如選擇安裝目錄的頁面和完成頁面。
– Languages:指定打包時需要支持的語言。
– Installer Sections:指定需要打包的文件和配置信息。
– Uninstaller Section:指定卸載時需要刪除的文件和配置信息。
4. 打包 IIS
打開命令提示符窗口,進(jìn)入保存了 IIS 文件的文件夾,并輸入以下命令:
“`
makensis myinstaller.nsi
“`
執(zhí)行完該命令后,NSIS 將會生成一個名為 MyIISInstaller.exe 的可執(zhí)行文件,其中包含了 IIS 所需的所有文件和配置信息。
5. 在目標(biāo)計算機上運行 exe 文件
將 MyIISInstaller.exe 文件拷貝到目標(biāo)計算機上,雙擊運行即可。運行 exe 文件后,它會自動解壓并安裝 IIS 所需的所有文件和配置信息。安裝完成后,我們就可以在