Beispiel #1
0
        private void PrepMsi(string msiPath, string dstDir, PaintDotNet.SystemLayer.ProcessorArchitecture platform, Hashtable msiProperties)
        {
            string dstMsiExt = "." + platform.ToString().ToLower() + ".msi";
            string dstMsiName = Path.ChangeExtension(msiPath, dstMsiExt);

            if (!Directory.Exists(dstDir))
            {
                Directory.CreateDirectory(dstDir);
            }

            string dstMsiPath = Path.Combine(dstDir, dstMsiName);

            this.statusText.Text = dstMsiName;
            WizardHost.Update();

            File.Copy(msiPath, dstMsiPath, true);
            ++this.progressBar.Value;

            Msi.SetMsiTargetPlatform(dstMsiPath, platform);
            ++this.progressBar.Value;

            foreach (string key in msiProperties.Keys)
            {
                string value = (string)msiProperties[key];
                Msi.SetMsiProperties(dstMsiPath, Msi.PropertyTable, new string[1] { key }, new string[1] { value });
                ++this.progressBar.Value;
            }

            ++this.progressBar.Value;
        }