无效命令:SysRestore::StartRestorePoint 在 NSIS 中使用 SysRestore 插件时
Invalid command: SysRestore::StartRestorePoint When using SysRestore plug-in in NSIS
我想在我的 NSIS 2.46 安装程序中创建系统还原点。我搜索了一下,发现 SysRestore 插件是最好的选择。
我从http://nsis.sourceforge.net/SysRestore_plug-in下载了SysRestore.zip
,解压后复制到NSIS的安装文件夹。但即使是附带的示例 (\Examples\SysRestore\example.nsi
) 也无法正确编译。
日志如下:
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- LangDLL::LangDialog
- Math::Script
- NSISdl::download
- NSISdl::download_quiet
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- UserInfo::GetOriginalAccountType
- VPatch::GetFileCRC32
- VPatch::GetFileMD5
- VPatch::vpatchfile
- nsDialogs::Create
- nsDialogs::CreateControl
- nsDialogs::CreateItem
- nsDialogs::CreateTimer
- nsDialogs::GetUserData
- nsDialogs::KillTimer
- nsDialogs::OnBack
- nsDialogs::OnChange
- nsDialogs::OnClick
- nsDialogs::OnNotify
- nsDialogs::SelectFileDialog
- nsDialogs::SelectFolderDialog
- nsDialogs::SetRTL
- nsDialogs::SetUserData
- nsDialogs::Show
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore"
Processing script file: "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore\example.nsi"
Name: "System Restore Example"
OutFile: "Example.exe"
InstallDir: "$PROGRAMFILES$(^Name)\"
ShowInstDetails: Show
ShowUninstDetails: Show
Page: Directory
Page: InstFiles
UninstPage: UninstConfirm
UninstPage: InstFiles
Var: "Error"
Section: "install"
SetOverwrite: try
StrCpy $Error "0" () ()
DetailPrint: "Setting System Restore point..."
Invalid command: SysRestore::StartRestorePoint
Error in script "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore\example.nsi" on line 20 -- aborting creation process
据我所知,NSIS 插件应该提供一个 .nsh
文件以包含在 .nsi
脚本中。 include header 将提供有关 SysRestore::StartRestorePoint
等函数的定义。所以编译器不会抱怨它。
但是我在SysRestore的文件夹里没有找到.nsh
。这个插件有什么问题?或者我的用法中缺少什么?
谢谢!
查看此编译时消息,以及以下行:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
SysRestore::StartRestorePoint 没有出现在加载的插件列表中。您是否将 SysRestore.dll 复制到 Plugins 文件夹?如果您只是将它提取到不同的文件夹,那么您需要使用 !addplugindir
并包含该文件夹。
您不能只从提取的存档中复制文件夹,因为它使用 NSIS 3.x 插件文件结构。不过,复制文档和示例的文件夹没问题。
使用 NSIS 2.x 时,请确保将 Plugins\x68-ansi\SysRestore.dll
复制到 %PROGRAMFILES%\NSIS\Plugins
。
我想在我的 NSIS 2.46 安装程序中创建系统还原点。我搜索了一下,发现 SysRestore 插件是最好的选择。
我从http://nsis.sourceforge.net/SysRestore_plug-in下载了SysRestore.zip
,解压后复制到NSIS的安装文件夹。但即使是附带的示例 (\Examples\SysRestore\example.nsi
) 也无法正确编译。
日志如下:
MakeNSIS v2.46 - Copyright 1995-2009 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.
Processing config:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- LangDLL::LangDialog
- Math::Script
- NSISdl::download
- NSISdl::download_quiet
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- UserInfo::GetOriginalAccountType
- VPatch::GetFileCRC32
- VPatch::GetFileMD5
- VPatch::vpatchfile
- nsDialogs::Create
- nsDialogs::CreateControl
- nsDialogs::CreateItem
- nsDialogs::CreateTimer
- nsDialogs::GetUserData
- nsDialogs::KillTimer
- nsDialogs::OnBack
- nsDialogs::OnChange
- nsDialogs::OnClick
- nsDialogs::OnNotify
- nsDialogs::SelectFileDialog
- nsDialogs::SelectFolderDialog
- nsDialogs::SetRTL
- nsDialogs::SetUserData
- nsDialogs::Show
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack
!define: "MUI_INSERT_NSISCONF"=""
Changing directory to: "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore"
Processing script file: "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore\example.nsi"
Name: "System Restore Example"
OutFile: "Example.exe"
InstallDir: "$PROGRAMFILES$(^Name)\"
ShowInstDetails: Show
ShowUninstDetails: Show
Page: Directory
Page: InstFiles
UninstPage: UninstConfirm
UninstPage: InstFiles
Var: "Error"
Section: "install"
SetOverwrite: try
StrCpy $Error "0" () ()
DetailPrint: "Setting System Restore point..."
Invalid command: SysRestore::StartRestorePoint
Error in script "C:\Users\Administrator\Downloads\SysRestore\Examples\SysRestore\example.nsi" on line 20 -- aborting creation process
据我所知,NSIS 插件应该提供一个 .nsh
文件以包含在 .nsi
脚本中。 include header 将提供有关 SysRestore::StartRestorePoint
等函数的定义。所以编译器不会抱怨它。
但是我在SysRestore的文件夹里没有找到.nsh
。这个插件有什么问题?或者我的用法中缺少什么?
谢谢!
查看此编译时消息,以及以下行:
Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"
SysRestore::StartRestorePoint 没有出现在加载的插件列表中。您是否将 SysRestore.dll 复制到 Plugins 文件夹?如果您只是将它提取到不同的文件夹,那么您需要使用 !addplugindir
并包含该文件夹。
您不能只从提取的存档中复制文件夹,因为它使用 NSIS 3.x 插件文件结构。不过,复制文档和示例的文件夹没问题。
使用 NSIS 2.x 时,请确保将 Plugins\x68-ansi\SysRestore.dll
复制到 %PROGRAMFILES%\NSIS\Plugins
。