@@ -90,6 +90,94 @@ extern Boolean InitSSLCrypt(void);
9090
9191// //////////////////////////////////////////////////////////////////////////////
9292
93+ bool MCDeployParameters::InitWithArray (MCExecContext &ctxt, MCArrayRef p_array)
94+ {
95+ MCStringRef t_temp_string;
96+ MCArrayRef t_temp_array;
97+
98+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" engine_ppc" ), false , t_temp_string))
99+ return false ;
100+ MCValueAssign (engine_ppc, t_temp_string);
101+ MCValueRelease (t_temp_string);
102+
103+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" engine_x86" ), false , t_temp_string))
104+ return false ;
105+ MCValueAssign (engine_x86, t_temp_string);
106+ MCValueRelease (t_temp_string);
107+
108+ if (MCStringIsEmpty (engine_ppc) && MCStringIsEmpty (engine_x86))
109+ {
110+ if (!ctxt.CopyElementAsFilepath (p_array, MCNAME (" engine" ), false , t_temp_string))
111+ return false ;
112+ MCValueAssign (engine, t_temp_string);
113+ MCValueRelease (t_temp_string);
114+ }
115+
116+ if (!ctxt.CopyElementAsFilepath (p_array, MCNAME (" stackfile" ), false , t_temp_string))
117+ return false ;
118+ MCValueAssign (stackfile, t_temp_string);
119+ MCValueRelease (t_temp_string);
120+
121+ if (!ctxt.CopyElementAsFilepathArray (p_array, MCNAME (" auxillary_stackfiles" ), false , t_temp_array))
122+ return false ;
123+ MCValueAssign (auxillary_stackfiles, t_temp_array);
124+ MCValueRelease (t_temp_array);
125+
126+ if (!ctxt.CopyElementAsArray (p_array, MCNAME (" externals" ), false , t_temp_array))
127+ return false ;
128+ MCValueAssign (externals, t_temp_array);
129+ MCValueRelease (t_temp_array);
130+
131+ if (!ctxt.CopyOptElementAsString (p_array, MCNAME (" startup_script" ), false , startup_script))
132+ return false ;
133+ MCValueAssign (startup_script, t_temp_string);
134+ MCValueRelease (t_temp_string);
135+
136+ if (!ctxt.CopyElementAsArray (p_array, MCNAME (" redirects" ), false , t_temp_array))
137+ return false ;
138+ MCValueAssign (redirects, t_temp_array);
139+ MCValueRelease (t_temp_array);
140+
141+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" appicon" ), false , t_temp_string))
142+ return false ;
143+ MCValueAssign (app_icon, t_temp_string);
144+ MCValueRelease (t_temp_string);
145+
146+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" docicon" ), false , t_temp_string))
147+ return false ;
148+ MCValueAssign (doc_icon, t_temp_string);
149+ MCValueRelease (t_temp_string);
150+
151+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" manifest" ), false , t_temp_string))
152+ return false ;
153+ MCValueAssign (manifest, t_temp_string);
154+ MCValueRelease (t_temp_string);
155+
156+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" payload" ), false , t_temp_string))
157+ return false ;
158+ MCValueAssign (payload, t_temp_string);
159+ MCValueRelease (t_temp_string);
160+
161+ if (!ctxt.CopyOptElementAsFilepath (p_array, MCNAME (" spill" ), false , t_temp_string))
162+ return false ;
163+ MCValueAssign (spill, t_temp_string);
164+ MCValueRelease (t_temp_string);
165+
166+ if (!ctxt.CopyElementAsFilepath (p_array, MCNAME (" output" ), false , t_temp_string))
167+ return false ;
168+ MCValueAssign (output, t_temp_string);
169+ MCValueRelease (t_temp_string);
170+
171+ if (!ctxt.CopyElementAsArray (p_array, MCNAME (" version" ), false , t_temp_array))
172+ return false ;
173+ MCValueAssign (version_info, t_temp_array);
174+ MCValueRelease (t_temp_array);
175+
176+ return true ;
177+ }
178+
179+ // //////////////////////////////////////////////////////////////////////////////
180+
93181static bool MCDeployWriteDefinePrologueSection (const MCDeployParameters& p_params, MCDeployCapsuleRef p_capsule)
94182{
95183 MCCapsulePrologueSection t_prologue;
@@ -127,7 +215,7 @@ bool MCDeployWriteCapsule(const MCDeployParameters& p_params, MCDeployFileRef p_
127215 // Open the spill file, if required
128216 MCDeployFileRef t_spill;
129217 t_spill = NULL ;
130- if (t_success && p_params . spill != nil && !MCDeployFileOpen (p_params . spill, kMCSOpenFileModeWrite , t_spill))
218+ if (t_success && ! MCStringIsEmpty ( p_params . spill) && !MCDeployFileOpen (p_params . spill, kMCSOpenFileModeWrite , t_spill))
131219 t_success = MCDeployThrow (kMCDeployErrorNoSpill );
132220
133221 // First create our deployment capsule
@@ -362,65 +450,7 @@ Exec_stat MCIdeDeploy::exec(MCExecPoint& ep)
362450 MCExecContext ctxt (ep);
363451
364452 MCDeployParameters t_params;
365-
366- MCStringRef t_temp;
367- if (t_stat == ES_NORMAL )
368- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" engine_ppc" ), false , t_params.engine_ppc ))
369- t_stat = ES_ERROR ;
370- if (t_stat == ES_NORMAL )
371- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" engine_x86" ), false , t_params.engine_x86 ))
372- t_stat = ES_ERROR ;
373- if (t_stat == ES_NORMAL && MCStringIsEmpty (t_params.engine_ppc ) && MCStringIsEmpty (t_params.engine_x86 ))
374- if (!ctxt.CopyElementAsFilepath (*t_array, MCNAME (" engine" ), false , t_params.engine ))
375- t_stat = ES_ERROR ;
376-
377- if (t_stat == ES_NORMAL )
378- if (!ctxt.CopyElementAsFilepath (*t_array, MCNAME (" stackfile" ), false , t_params.stackfile ))
379- t_stat = ES_ERROR ;
380- if (t_stat == ES_NORMAL )
381- if (!ctxt.CopyElementAsFilepathArray (*t_array, MCNAME (" auxillary_stackfiles" ), false , t_params.auxillary_stackfiles ))
382- t_stat = ES_ERROR ;
383- if (t_stat == ES_NORMAL )
384- if (!ctxt.CopyElementAsArray (*t_array, MCNAME (" externals" ), false , t_params.externals ))
385- t_stat = ES_ERROR ;
386-
387- if (t_stat == ES_NORMAL )
388- if (!ctxt.CopyOptElementAsString (*t_array, MCNAME (" startup_script" ), false , t_params.startup_script ))
389- t_stat = ES_ERROR ;
390-
391- if (t_stat == ES_NORMAL )
392- if (!ctxt.CopyElementAsArray (*t_array, MCNAME (" redirects" ), false , t_params.redirects ))
393- t_stat = ES_ERROR ;
394-
395- if (t_stat == ES_NORMAL )
396- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" appicon" ), false , t_params.app_icon ))
397- t_stat = ES_ERROR ;
398- if (t_stat == ES_NORMAL )
399- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" docicon" ), false , t_params.doc_icon ))
400- t_stat = ES_ERROR ;
401-
402- if (t_stat == ES_NORMAL )
403- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" manifest" ), false , t_params.manifest ))
404- t_stat = ES_ERROR ;
405-
406- if (t_stat == ES_NORMAL )
407- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" payload" ), false , t_params.payload ))
408- t_stat = ES_ERROR ;
409-
410- if (t_stat == ES_NORMAL )
411- if (!ctxt.CopyOptElementAsFilepath (*t_array, MCNAME (" spill" ), false , t_params.spill ))
412- t_stat = ES_ERROR ;
413-
414- if (t_stat == ES_NORMAL )
415- if (!ctxt.CopyElementAsFilepath (*t_array, MCNAME (" output" ), false , t_params.output ))
416- t_stat = ES_ERROR ;
417-
418- if (t_stat == ES_NORMAL )
419- {
420- MCAutoArrayRef t_version;
421- if (!ctxt.CopyElementAsArray (*t_array, MCNAME (" version" ), false , &t_version))
422- t_params.version_info = MCValueRetain (*t_version);
423- }
453+ t_params.InitWithArray (ctxt, *t_array);
424454
425455 // If platform is iOS and we are not Mac then error
426456#ifndef _MACOSX
0 commit comments