Skip to content

Commit 064c497

Browse files
committed
Merge pull request #6 from jcummins/master
Embedded files are now removed from XML
2 parents ca76a21 + 53543ef commit 064c497

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
labtech_decode_scriptxml
22
========================
33

4-
A command-line tool to decode packed Labtech script XML files.
4+
A command-line tool to decode packed Labtech script XML files and to extract embedded files.
55

66
DOWNLOAD:
77
==========
@@ -26,7 +26,7 @@ EXAMPLE:
2626

2727
For an example of both a packed and an unpacked Labtech script. See [CGauss' Current Date Script](https://github.com/ManagedITStack/labtech_create_current_date_variable_script)
2828

29-
The .xml file is the packed file, the .unpacked.xml is the unpacked file.
29+
The .xml file is the packed file, the .unpacked.xml is the unpacked file. The files extracted during the unpacking process will be extracted to the Transfer directory. Once unpacked, the embedded file is removed from the unpacked XML file.
3030

3131
USAGE:
3232
===========

labtech_decode_scriptxml/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ static int Main(string[] args)
195195

196196
string fileDir = Path.GetDirectoryName(fileNode.Attributes["Name"].Value.Replace(@"L:\", filesPath));
197197
string fileName = fileNode.Attributes["Name"].Value.Replace(@"L:\", filesPath);
198+
198199
/* Create the directory path if it doesn't exist */
199200
if (!Directory.Exists(fileDir))
200201
{
@@ -223,6 +224,7 @@ static int Main(string[] args)
223224
/* Write the bytes to disk and close the file */
224225
fs.Write(filebytes, 0, filebytes.Length);
225226
fs.Close();
227+
fileNode.Attributes["Bytes"].Value = "This value has been replaced and the file extracted to the Transfer folder";
226228
}
227229
}
228230

0 commit comments

Comments
 (0)