HM NIS edit和NSIS,将python项目打包成exe程序,请问nis文件怎么配置?

HM NIS edit和NSIS,将python项目打包成exe程序,请问nis文件怎么配置?

我需要将Python项目整个打包成exe程序,有一个起始脚本py文件,多个目录,目录下都是不同的py方法;现在用nis edit来编辑配置它,请问怎么配置?exe程序应用自己的ico图标

; Script generated by the HM NIS Edit Script Wizard.

; HM NIS Edit Wizard helper defines

!define PRODUCT_NAME "fixture test"

!define PRODUCT_VERSION "1.0"

!define PRODUCT_PUBLISHER "your God"

!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\AppMainExe.exe"

!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

!define PRODUCT_UNINST_ROOT_KEY "HKLM"

; MUI 1.67 compatible ------

!include "MUI.nsh"

; MUI Settings

!define MUI_ABORTWARNING

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"

!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

; Language Selection Dialog Settings

!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"

!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"

!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"

; Welcome page

!insertmacro MUI_PAGE_WELCOME

; License page

!insertmacro MUI_PAGE_LICENSE "..\..\..\path\to\licence\YourSoftwareLicence.txt"

; Directory page

!insertmacro MUI_PAGE_DIRECTORY

; Instfiles page

!insertmacro MUI_PAGE_INSTFILES

; Finish page

!define MUI_FINISHPAGE_RUN "$INSTDIR\AppMainExe.exe"

!insertmacro MUI_PAGE_FINISH

; Uninstaller pages

!insertmacro MUI_UNPAGE_INSTFILES

; Language files

!insertmacro MUI_LANGUAGE "English"

!insertmacro MUI_LANGUAGE "SimpChinese"

; MUI end ------

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"

OutFile "Setup.exe"

InstallDir "$PROGRAMFILES\fixture test"

InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""

ShowInstDetails show

ShowUnInstDetails show

Function .onInit

!insertmacro MUI_LANGDLL_DISPLAY

FunctionEnd

Section "MainSection" SEC01

SetOutPath "$INSTDIR"

SetOverwrite ifnewer

File "..\..\..\path\to\file\AppMainExe.exe"

CreateDirectory "$SMPROGRAMS\fixture test"

CreateShortCut "$SMPROGRAMS\fixture test\fixture test.lnk" "$INSTDIR\AppMainExe.exe"

CreateShortCut "$DESKTOP\fixture test.lnk" "$INSTDIR\AppMainExe.exe"

File "..\..\..\path\to\file\Example.file"

SectionEnd

Section -AdditionalIcons

CreateShortCut "$SMPROGRAMS\fixture test\Uninstall.lnk" "$INSTDIR\uninst.exe"

SectionEnd

Section -Post

WriteUninstaller "$INSTDIR\uninst.exe"

WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\AppMainExe.exe"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\AppMainExe.exe"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"

WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"

SectionEnd

Function un.onUninstSuccess

HideWindow

MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) 已成功地从你的计算机移除。"

FunctionEnd

Function un.onInit

!insertmacro MUI_UNGETLANGUAGE

MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "你确实要完全移除 $(^Name) ,其及所有的组件?" IDYES +2

Abort

FunctionEnd

Section Uninstall

Delete "$INSTDIR\uninst.exe"

Delete "$INSTDIR\Example.file"

Delete "$INSTDIR\AppMainExe.exe"

Delete "$SMPROGRAMS\fixture test\Uninstall.lnk"

Delete "$DESKTOP\fixture test.lnk"

Delete "$SMPROGRAMS\fixture test\fixture test.lnk"

RMDir "$SMPROGRAMS\fixture test"

RMDir "$INSTDIR"

DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"

DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

SetAutoClose true

SectionEnd

感谢

以上是 HM NIS edit和NSIS,将python项目打包成exe程序,请问nis文件怎么配置? 的全部内容, 来源链接: utcz.com/p/938605.html

回到顶部