string system32Directory = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "system32", "dism.exe");
if (Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess)
{
system32Directory = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "sysnative", "dism.exe");
}
identifies the system architecture and uses DISM accordingly