Windows installer windows installer(NSIS)生成应用程序后,无法打开该应用程序

Windows installer windows installer(NSIS)生成应用程序后,无法打开该应用程序,windows-installer,nsis,Windows Installer,Nsis,我已经创建了一个PowerTest.NSI文件。在这个文件中,我包含了如下所示的必需DLL和EXE,并添加了必需的 命令 File E:\Source\PowerTest.exe File E:\Source\testutil.dll File E:\Source\ntutil.dll 最后我加载了这个NSI脚本文件,它生成了PowerTest.exe 我运行了这个PowerTest.exe,它在路径(\Program Files\PowerTest)中生成了以下DLL和exe以及

我已经创建了一个PowerTest.NSI文件。在这个文件中,我包含了如下所示的必需DLL和EXE,并添加了必需的 命令

  File E:\Source\PowerTest.exe
  File E:\Source\testutil.dll
  File E:\Source\ntutil.dll
最后我加载了这个NSI脚本文件,它生成了PowerTest.exe

我运行了这个PowerTest.exe,它在路径(\Program Files\PowerTest)中生成了以下DLL和exe以及卸载exe

但是当我运行可执行文件时,它没有打开应用程序(它没有响应)

下面是完整的代码:(PowerTest.nsi)


请让我知道我错过了什么。我们还需要添加什么来启动应用程序吗?请建议我提供的.nsi文本脚本文件是否有任何更改。

您的
CreateShortcut
调用错误,它指向.nsi文件。它应该指向
$InstDir\PowerTest.exe

您的
Delete
调用也错误,删除.nsi没有意义,它应该删除您的.exe和.dll文件


NSIS不应该影响你的应用程序是否工作,问题很可能在其他地方。可能您需要注册.dll文件或其他一些配置更改。

请只发布与问题相关的代码。有关详细信息,请参阅。如果只是手动复制文件,会发生什么情况?应用程序工作吗?启动此可执行文件时是否连接了UPS?正如Anders所问,当您手动将文件复制到位时,它是否正常运行?你检查了文件的依赖关系了吗?不要破坏你的帖子。通过在此网站上发布,您已不可撤销地授予Stack Exchange network在其认为合适的时间内根据发布该内容的权利。有关删除的替代方案,请参见:
; PowerTest.nsi
;
;
; It will install PowerTest.nsi into a directory that the user selects.

;--------------------------------

; The name of the installer in the path C:\Program Files\PowerTest
Name "UPowerTestPSTest"

; The file to write  in the path E:\Source
OutFile "PowerTest.exe"

; The default installation directory in the path C:\Program Files\PowerTest
InstallDir $PROGRAMFILES\PowerTest

; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically) It shows the path the path C:\Program Files\PowerTest
InstallDirRegKey HKLM "Software\PowerTest" "Install_Dir"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

;--------------------------------

; Pages

Page components
Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------

; The stuff to install
Section "PowerTest(required)"

  SectionIn RO
  
  DetailPrint "PowerTest"

  ; Set output path to the installation directory. Here is the path C:\Program Files\PowerTest
  SetOutPath $INSTDIR

  ; Give the dll and exe path
  File E:\Source\PowerTest.exe
  File E:\Source\testutil.dll
  File E:\Source\ntutil.dll

  ; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\PowerTest"Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerTest" "DisplayName" "NSIS PowerTest"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerTest" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerTest" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerTest" "NoRepair" 1
  WriteUninstaller "uninstall.exe"

SectionEnd

; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\PowerTest"
  CreateShortcut "$SMPROGRAMS\PowerTest\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortcut "$SMPROGRAMS\PowerTest (MakeNSISW).lnk" "$INSTDIR\PowerTest.nsi" "" "$INSTDIR\PowerTest.nsi" 0

SectionEnd

;--------------------------------

; Uninstaller

Section "Uninstall"

  ; Remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\PowerTest"
  DeleteRegKey HKLM SOFTWARE\PowerTest

  ; Remove files and uninstaller
  Delete $INSTDIR\PowerTest.nsi
  Delete $INSTDIR\uninstall.exe

  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\PowerTest\*.*"

  ; Remove directories used
  RMDir "$SMPROGRAMS\PowerTest"
  RMDir "$INSTDIR"

SectionEnd