无效命令:SysRestore :: StartRestorePoint在NSIS中使用SysRestore插件时

时间:2016-02-29 08:46:23

标签: installer nsis

我想在NSIS 2.46安装程序中创建系统还原点。我google了一下,发现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标头将提供有关SysRestore::StartRestorePoint等函数的定义。所以编译器不会抱怨它。

但是我没有在SysRestore的文件夹中找到.nsh。这个插件有什么问题?或者我的使用中缺少一些东西?

谢谢!

2 个答案:

答案 0 :(得分:2)

您不能只从提取的存档中复制文件夹,因为它使用NSIS 3.x文件结构来插件。复制文件夹以获取文档和示例很好。

使用NSIS 2.x时,请确保Plugins\x68-ansi\SysRestore.dll已复制到%PROGRAMFILES%\NSIS\Plugins

答案 1 :(得分:0)

查看此编译时消息,以及以下行:

Processing plugin dlls: "C:\Program Files (x86)\NSIS\Plugins\*.dll"

SysRestore :: StartRestorePoint不会出现在加载的插件列表中。您是否将SysRestore.dll复制到Plugins文件夹?如果您只是将其解压缩到另一个文件夹,则需要使用!addplugindir并包含该文件夹。