Is Windows Restore Point creation supported by InstallBuilder?

asked 01 Dec '11, 03:16

GigaG's gravatar image

GigaG
419911
accept rate: 0%


There is no built-in action for performing it, but you can use VBScript to create a restore point.

The example below creates a random point with project's <fullName> as name of the restore point:

<writeFile>
    <path>${system_temp_directory}/createrestore.vbs</path>
    <text>Set SRP = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestore")
    Result = SRP.createrestorepoint ("${project.fullName}", 0, 100)

    If Result = 0 Then
        Wscript.Exit 0
    Else
        Wscript.Exit 1
    End If
    </text>
</writeFile>
<runProgram>
    <program>cscript</program>
    <programArguments>/NOLOGO "createrestore.vbs"</programArguments>
    <workingDirectory>${system_temp_directory}</workingDirectory>
</runProgram>
<deleteFile>
    <path>${system_temp_directory}/createrestore.vbs</path>
</deleteFile>

More information on using SystemRestore, its attributes and methods can be found on MSDN.

link

answered 02 Dec '11, 08:45

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×176

Asked: 01 Dec '11, 03:16

Seen: 828 times

Last updated: 02 Dec '11, 08:45