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.
System Restore plugin
32 posts
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.
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.
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.
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.
And here is the source ready for scons compiling.
Attachment removed; see http://nsis.sourceforge.net/System_Restore_Plugin for source.
Attachment removed; see http://nsis.sourceforge.net/System_Restore_Plugin for source.
Could you create a NSIS Wiki page for it? The forum is too big to post contributions: it could be easily lost.
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.
I have finally been able to finish the wiki page. It has the dll and the source code on it. The link is above.
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.
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
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
whenever i use this plugin, i get a messagebox reporting "0". happens once on start and finish. same with the example scripts.
That would be me. Fixed.
Searching Google for SRSetRestorePoint and 1457832 returns nothing. Are you sure that error code is correct?
Stu
Searching Google for SRSetRestorePoint and 1457832 returns nothing. Are you sure that error code is correct?
Stu
Even err.exe can't find 1457832.
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.
found some info on it, but by default access to that directory is denied. anyway, thought i'd share it with you.
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.
Or do I miss something?
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.
Except for this, the rest is working fine.
SysRestore::StartRestorePoint /NOUNLOAD "Blah"
Or do I miss something?
Are you mixing the Unicode plug-in with ANSI NSIS or vice-versa?
Stu
Stu
Thanks ! That was it !
I was using the unicode version of the plugin...
I was using the unicode version of the plugin...
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
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
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.
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
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
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
Stu
Oh great, another thing that VS is doing behind my back. I'll have to check all my plugins now and turn it off 🙁.
I believe you need to do an /MT to statically link the CRTS...
Andy
Andy
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.
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.
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.
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.
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
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
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.
[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.
Compile with /FAcs and grep *.cod for memset...
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
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