Skip to content
⌘ NSIS Forum Archive

System Restore plugin

32 posts

JasonFriday13#

System Restore plugin

I created this plugin in less than 24 hours, added the plugin to the scons stucture, compiled it and made a zip and installer, and the size is 2.5KB. How good am I?

Just extract the contents to your NSIS directory.

NSIS Development Team: I can upload the source if you want to include this plugin with your distribution installer.

onad#
Yes, JasonFriday13 your great!

If you need another challenge:

I will propose an un-installer issue still to fix in NSIS under W95/W98/W98SE

From a theoretical perspective I know how to solve it, but I have not done so, being a quite bussy man.
JasonFriday13#
Sorry, I made a few mistakes in the example script and the docs. I didn't document the InstallFailed function properly.

Note: There will be no new versions since the code is so simple. Also, I will (probably) not be able to view the NSIS forums for the next few months (until the middle of February), it just depends on whether I have access to the internet.

JasonFriday13#
And here is the source ready for scons compiling.

Attachment removed; see http://nsis.sourceforge.net/System_Restore_Plugin for source.
deguix#
Could you create a NSIS Wiki page for it? The forum is too big to post contributions: it could be easily lost.
JasonFriday13#
Finally, I have done a simple wiki page here. I ran out of time on the public computer so it just links back to here to download it.
JasonFriday13#
I have finally been able to finish the wiki page. It has the dll and the source code on it. The link is above.
JasonFriday13#
Just uploaded an updated version. Is now easier to use, added a couple of comments to the source code, made the source a .C file, and combined the source and plugin package together. Now the source code is under the Contrib\SysRestore folder. Also updated the wiki page here.
Ma2xx#
Need info for error code: 1457832

Hello,
SysRestore is a great PlugIn - thank you. I use this on some machines without any problems, but on one PC i become an error with the code 1457832 while closing the SysRestore point. Have anybody some information about this error code?
Thanks Ma2xx
Yathosho#
whenever i use this plugin, i get a messagebox reporting "0". happens once on start and finish. same with the example scripts.
Afrow UK#
That would be me. Fixed.

Searching Google for SRSetRestorePoint and 1457832 returns nothing. Are you sure that error code is correct?

Stu
Yathosho#
does anybody know if it's possible to read the names of past restore points? i want to add the option to my uninstaller to select a restore point to revert.
Yathosho#
found some info on it, but by default access to that directory is denied. anyway, thought i'd share it with you.
Koopa#
Is it possible, that the plugin has a small glitch with NSIS Unicode?

It correctly set the restore point, but it shows just the first letter of the name in the system restore dialog:



I set the name of the restore point to 'Blah', but it just shows, 'B' in the restore points.

SysRestore::StartRestorePoint /NOUNLOAD "Blah"
Except for this, the rest is working fine.
Or do I miss something?
poiuytrez#
Hello guys,

I have some issues with the description on Windows 7 64 bits :


I entered an enlish text, but it seems that the characters are converted to Chinese !

Any ideas ?
AndyJoeB#
Great plug in, but it seems the SysRestore.dll is based on MSVCR90.dll. Unless it is on the box, it will not work. I am trying to do a sys restore on an XP box, and it fails.

I noticed that many other plugins do not use the MSVCRs, so why this? Where can I get a version of this dll that works out of the box?

Thanks
Andy
JasonFriday13#
I don't explicitly link to msvcr90.lib, some of my plugins do require it and some don't. I guess the compiler is implicitly linking it in (I use VS2008 with the Windows 7 SDK). The older ansi only builds were built with VS6.0 with the windows 2003 sdk. I'll see if I can get rid of the MS runtime library.
JasonFriday13#
So I've done a whole update for this plugin, changes:

Minor tweaks, upgraded to 3.0a0+ plugin API, removed MSVCR*.dll dependency, updated docs and example script.

The msvcr*.dll dependency was harder to remove than I thought. I finally found it in a single function call in the code, so I swapped it out for a secure version, and presto! Dependency Walker also shows no link to the runtime now.

I've uploaded it to: http://nsis.sourceforge.net/SysRestore_plug-in
Afrow UK#
The plug-in DLL still has a Microsoft.VC90.CRT dependency in its XML manifest. You need to disable XML manifest embedding in the project properties.

Stu
JasonFriday13#
Oh great, another thing that VS is doing behind my back. I'll have to check all my plugins now and turn it off 🙁.
DrO#
JasonFriday13: you can also just quickly remove the manifest resource if it's too much of a hassle to recompile things with an appropriate resource editor. though it's been a default behaviour for over 6 years in MSVC.

AndyJoeB: that's not needed especially if JasonFriday13 has already gotten the plug-in changed to not need to use it anyway. hence just removing the manifest resource is enough for what's needed.
JasonFriday13#
Just try the new plugin I uploaded and if it still complains about msvcr*.dll, use resource hacker to remove the manifest. I already checked it and the xml is the only resource embedded.

Also, like I said earlier, I don't explicitly link to msvcr*.dll, the compiler automatically includes it if a function uses one of the calls. That's how changing ZeroMemory() to SecureZeroMemory() removed the dependency on it. It would be nice to turn this behavior off, although I could use /nodefaultlib and manually specify the required libs.

[edit] Come to think of it, most if not all my plugins have libc.lib as an ignore lib as it doesn't exist on my machine.
Anders#
Try linking with /MANIFEST:NO

ZeroMemory is usually just a define for memset. Other things like char foo[10] = {0}; can end up as a call to memset, it depends on the compiler version. Or if you are unlucky like me it will turn a custom memset function like void memset(char*p,int c,size_t s) { for (...); } into a call to memset in the CRT. At that point I wrote the loop in assembly but you can also work around it in other ways, see http://forums.winamp.com/showthread.php?t=378657&page=2
JasonFriday13#
I remember reading that thread a while ago. Problem is, I haven't used memset(), not intentionally anyway. Maybe some other functions use it, perhaps I have to start commenting lines out until the dependency disappears, and find an equivalent function not based on msvcr*.dll.

[edit] You know what, it's probably my static initialization of pointers that's adding in the memset call. I will have to start using LocalAlloc/GlobalAlloc with sizeof() for pointers now, or manually initialize the struct before passing it's address.
AndyJoeB#
Jason,
If I go and download from http://nsis.sourceforge.net/SysRestore_plug-in, is this fixed now. Sorry to bug you but I need to reissue my installers...

Thanks
Andy