@@ -63,7 +63,7 @@ static int Main(string[] args)
63
63
string [ ] arrValue = listArg . ToArray ( ) ;
64
64
string argValue = String . Join ( "=" , arrValue ) ;
65
65
66
- /* Map arguments to designaed local variables */
66
+ /* Map arguments to designated local variables */
67
67
if ( argLabel == "--input" )
68
68
{
69
69
inputPath = argValue ;
@@ -150,25 +150,41 @@ static int Main(string[] args)
150
150
XmlNodeList scriptData = inputXMLdoc . GetElementsByTagName ( "ScriptData" ) ;
151
151
XmlNodeList licenseData = inputXMLdoc . GetElementsByTagName ( "LicenseData" ) ;
152
152
153
- /* Decode the gzipped compressed string */
154
- string scriptDataString = GunzipString ( scriptData [ 0 ] . InnerText ) ;
155
- string licenseDataString = GunzipString ( licenseData [ 0 ] . InnerText ) ;
156
-
157
- /* Write new string to the XML node */
158
- scriptData [ 0 ] . InnerText = "" ;
159
- licenseData [ 0 ] . InnerText = "" ;
160
-
161
- /* Generate a new fragment from the decoded XML */
162
- XmlDocumentFragment scriptDecodedNode = inputXMLdoc . CreateDocumentFragment ( ) ;
163
- XmlDocumentFragment licenseDecodedNode = inputXMLdoc . CreateDocumentFragment ( ) ;
164
- scriptDecodedNode . InnerXml = scriptDataString ;
165
- licenseDecodedNode . InnerXml = licenseDataString ;
166
-
167
- /* Replace the original node with the decode node */
168
- XmlNode scriptDataParent = scriptData [ 0 ] . ParentNode ;
169
- XmlNode licenseDataParent = licenseData [ 0 ] . ParentNode ;
170
- scriptDataParent . ReplaceChild ( scriptDecodedNode , scriptData [ 0 ] ) ;
171
- licenseDataParent . ReplaceChild ( licenseDecodedNode , licenseData [ 0 ] ) ;
153
+ /* Loop through each scriptData element and decode it */
154
+ for ( int i = 0 ; i < scriptData . Count ; i ++ )
155
+ {
156
+ /* Decode the gzipped compressed string */
157
+ string scriptDataString = GunzipString ( scriptData [ i ] . InnerText ) ;
158
+
159
+ /* Write new string to the XML node */
160
+ scriptData [ i ] . InnerText = "" ;
161
+
162
+ /* Generate a new fragment from the decoded XML */
163
+ XmlDocumentFragment scriptDecodedNode = inputXMLdoc . CreateDocumentFragment ( ) ;
164
+ scriptDecodedNode . InnerXml = scriptDataString ;
165
+
166
+ /* Replace the original node with the decode node */
167
+ XmlNode scriptDataParent = scriptData [ i ] . ParentNode ;
168
+ scriptDataParent . ReplaceChild ( scriptDecodedNode , scriptData [ i ] ) ;
169
+ }
170
+
171
+ /* Loop through each licenseData element and decode it */
172
+ for ( int i = 0 ; i < scriptData . Count ; i ++ )
173
+ {
174
+ /* Decode the gzipped compressed string */
175
+ string licenseDataString = GunzipString ( licenseData [ i ] . InnerText ) ;
176
+
177
+ /* Write new string to the XML node */
178
+ licenseData [ i ] . InnerText = "" ;
179
+
180
+ /* Generate a new fragment from the decoded XML */
181
+ XmlDocumentFragment licenseDecodedNode = inputXMLdoc . CreateDocumentFragment ( ) ;
182
+ licenseDecodedNode . InnerXml = licenseDataString ;
183
+
184
+ /* Replace the original node with the decode node */
185
+ XmlNode licenseDataParent = licenseData [ i ] . ParentNode ;
186
+ licenseDataParent . ReplaceChild ( licenseDecodedNode , licenseData [ i ] ) ;
187
+ }
172
188
173
189
/* Find the File nodes */
174
190
XmlNodeList filesNodes = inputXMLdoc . SelectNodes ( "LabTech_Expansion/PackedScript/File" ) ;
0 commit comments