A program (`.urp`) and an installation (`.installation`) of a Universal Robots cobot are compressed XML files. The SDK opens them on the PC, gives their XML, and writes them again. This page shows how, without a robot.

## How it works

`URProgram.Load` and `URInstallation.Load` read a file and decompress it. `XML` is the content of the file, as an `XElement`: read it, change it, add elements. `Save` writes the file again: to a `Stream`, or to a folder, with the name of the program as file name.

To get a file from the robot, or to send it back, use [SFTP](/universal-robots/documentation/sftp-file-handling). The XML format is the format of PolyScope: open a file saved by PolyScope to see the elements of an instruction.

## Program files

**C# : FileProgram**
```csharp
using System.Xml.Linq;
using UnderAutomation.UniversalRobots.Files;

class FileProgram
{
  static void Main(string[] args)
  {
    /**/
    // Open a program file downloaded from the robot
    URProgram program = URProgram.Load(@"C:\temp\my_program.urp");

    // Content of the program, as XML
    XElement xml = program.XML;

    // For example, the installation used by the program
    xml.Attribute("installationRelativePath").Value = "default";

    // Save in a folder: the file name is the name of the program.
    // Then send the file to the robot with SFTP
    string path = program.Save(@"C:\temp\modified");
    /**/
  }
}
```

**Python : FileProgram**
```python
from underautomation.universal_robots.files.ur_program import URProgram

##
# Open a program file downloaded from the robot
program = URProgram.load("C:\\temp\\my_program.urp")

# Content of the program, as a .NET XElement
xml = program.xml

# For example, the installation used by the program
xml.Attribute("installationRelativePath").Value = "default"

# Save in a folder: the file name is the name of the program.
# Then send the file to the robot with SFTP
path = program.save("C:\\temp\\modified")
##
```

## Installation files

**C# : FileInstallation**
```csharp
using System.Xml.Linq;
using UnderAutomation.UniversalRobots.Files;

class FileInstallation
{
  static void Main(string[] args)
  {
    /**/
    URInstallation installation = URInstallation.Load(@"C:\temp\default.installation");

    XElement xml = installation.XML;

    // For example, show the speed slider on the Run tab
    xml.Attribute("showSpeedSliderOnRunTab").Value = "true";

    // Save in a folder: the file name is the name of the installation
    string path = installation.Save(@"C:\temp\modified");
    /**/
  }
}
```

**Python : FileInstallation**
```python
from underautomation.universal_robots.files.ur_installation import URInstallation

##
installation = URInstallation.load("C:\\temp\\default.installation")

# Content of the installation, as a .NET XElement
xml = installation.xml

# For example, show the speed slider on the Run tab
xml.Attribute("showSpeedSliderOnRunTab").Value = "true"

# Save in a folder: the file name is the name of the installation
path = installation.save("C:\\temp\\modified")
##
```

A program or an installation changed by the SDK is loaded by PolyScope like any other file. Keep a copy of the original, and check the result in PolyScope or URSim before you use it on a robot.

## Try it in the demo application

Everything on this page can be tried without writing code, in the **Decompile programs and installation** page of the [demo application](/universal-robots/documentation/demo-app).

![Decompile programs and installation page of the Universal Robots SDK demo application](/universal-robots/WinformsScreenshots/Archive.jpg)

Its C# source is [ArchiveControl.cs](https://github.com/underautomation/UniversalRobots.NET/blob/main/UnderAutomation.UniversalRobots.Showcase.Forms/Components/ArchiveControl.cs).

## Reference

**Members of Files.URArchive**
```csharp
public abstract class URArchive {
    // Initializes a new instance of <xref href="UnderAutomation.UniversalRobots.Files.URArchive" data-throw-if-not-resolved="false"></xref> from the specified XML element.
    protected URArchive(XElement xml)

    // Gets the file extension for this archive type (e.g., ".urp" or ".installation").
    protected abstract string Extension { get; }

    // File name that should be used on a UR robot
    public string FileName { get; }

    // Load a UR archive from stream and decode it as XML
    public static XElement Load(Stream fileStream)

    // Load a UR archive from file path and decode it as XML
    public static XElement Load(string filePath)

    // Gets or sets the name of this archive, stored as an XML attribute.
    public string Name { get; set; }

    // Gets the XML attribute name used to store the archive name.
    protected abstract string NameAttribute { get; }

    // Gets the expected root XML element name for this archive type.
    protected abstract string RootElement { get; }

    // Save encoded file to a stream
    public void Save(Stream stream)

    // Save encoded file to a directory, overwrite it if it exists
    public string Save(string directory)

    // XML description of the object
    public XElement XML { get; }
}
```

**Members of Files.URProgram**
```csharp
public class URProgram : URArchive {
    // Creates a URProgram from its XML definition.
    public URProgram(XElement xml)

    // File extension for UR program files.
    public const string EXTENSION = ".urp"

    // Determines whether the specified object is equal to this program.
    public override bool Equals(object obj)

    // Gets the file extension for this archive type (e.g., ".urp" or ".installation").
    protected override string Extension { get; }

    // Returns a hash code for this program.
    public override int GetHashCode()

    // Load a program from stream
    public static URProgram Load(Stream urpStream)

    // Load a *.urp program from file path
    public static URProgram Load(string urpFile)

    // Gets the XML attribute name used to store the archive name.
    protected override string NameAttribute { get; }

    // Gets the expected root XML element name for this archive type.
    protected override string RootElement { get; }

    // Returns the file name of this program.
    public override string ToString()
}
```

**Members of Files.URInstallation**
```csharp
public class URInstallation : URArchive {
    // Creates a URInstallation from its XML definition.
    public URInstallation(XElement xml)

    // File extension for UR installation files.
    public const string EXTENSION = ".installation"

    // Determines whether the specified object is equal to this installation.
    public override bool Equals(object obj)

    // Gets the file extension for this archive type (e.g., ".urp" or ".installation").
    protected override string Extension { get; }

    // Returns a hash code for this installation.
    public override int GetHashCode()

    // Load an installation file from stream
    public static URInstallation Load(Stream urpStream)

    // Load a *.installation file from path
    public static URInstallation Load(string urpFile)

    // Gets the XML attribute name used to store the archive name.
    protected override string NameAttribute { get; }

    // Gets the expected root XML element name for this archive type.
    protected override string RootElement { get; }

    // Returns the file name of this installation.
    public override string ToString()
}
```