|
|
|
|
#1 |
|
Junior Member
Join Date: Mar 2008
Posts: 33
|
rollback.nsh
I'm working on a nice rollback include. ( Aptly titled rollback.nsh ) Just a set of macros really, but it sets up a log that can be saved to a provided path.... builds the log...as you install or edit files and registry entries... and when you're done you close the "session". Then later you could come back and execute the rollback.
Works well for my application which can't really depend on having a clean folder for its files. So 'rollback' means recopying whatever files I detect that I've stepped on, back into the working folder on a rollback. ( Essentially parsing the log file... for FILE entries, and putting it back where the PATH attribute says to go. ) Maybe we should include a log for SQL calls to? Or better a log to execute SQL files against a database... that might abstract your issue better. It'd be ready for a demo as a general include, except that I'd like to include the ability to tie in a CallBack on a failed copy.... i.e. If you tried to restore a file it was tied up or something. Currently I have a string that gets read from the log file and passed to ExecWait but that's just a bit limiting and somewhat impractical. I'd rather be able to read a string from the log file and call back a function in the NSIS script... like so: Function handleErrorWithCustomCallback MessageBox MB_OK "Handled Error." FunctionEnd ## SNIP ## ## In some Section or function... ReadFile $myFile $myCallBackString ; blah blah blah ## myCallBackString now has "handleErrorWithCustomCallback" Call $myCallBackString ; but this isn't resolving.... ; macros seem to do something like this with ${_label} but not quite.... The lack of runtime binding/resolution seems to not resolve this.... or maybe I'm not resolving the var's contents like I should be.... any comments Stu? |
|
|
|
|
|
#2 | ||
|
Junior Member
Join Date: Apr 2011
Posts: 1
|
Quote:
Quote:
|
||
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|