コード例 #1
0
ファイル: CustomEventsForm.cs プロジェクト: win7guru/cameyo
        private String GetPropertiesChecksum()
        {
            String checksum = "";
            String value;

            value     = ""; virtPackage.GetProperty("OnStartUnvirtualized", ref value);
            checksum += value + ";";
            value     = ""; virtPackage.GetProperty("OnStartVirtualized", ref value);
            checksum += value + ";";
            value     = ""; virtPackage.GetProperty("OnStopVirtualized", ref value);
            checksum += value + ";";
            value     = ""; virtPackage.GetProperty("OnStopUnvirtualized", ref value);
            checksum += value + ";";
            return(checksum);
        }
コード例 #2
0
ファイル: AutoUpdateForm.cs プロジェクト: gsool/cameyo
 public AutoUpdateForm(VirtPackage virtPackage)
 {
     this.virtPackage = virtPackage;
     InitializeComponent();
     txtFinish       = literalFinish.Text;
     txtNext         = btnNext.Text;
     tbVersion.Text  = virtPackage.GetProperty("Version");
     tbLocation.Text = virtPackage.GetProperty("AutoUpdate");
     if (string.IsNullOrEmpty(tbLocation.Text))
     {
         radioDisableFeature.Checked = true;
         tbLocation.Text             = @"\\server\apps\" + Path.ChangeExtension(Path.GetFileName(virtPackage.openedFile), ".xml");
     }
     else
     {
         autoUpdateAlreadyConfigured = true;
         radioEnableFeature.Checked  = true;
     }
 }
コード例 #3
0
ファイル: AutoUpdateForm.cs プロジェクト: gsool/cameyo
        private void btnGenerateXml_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.AddExtension = true;
            saveFileDialog.Filter       = "Cameyo auto update XML (*.xml)|*.xml";
            saveFileDialog.DefaultExt   = "xml";
            saveFileDialog.FileName     = Path.ChangeExtension(virtPackage.openedFile, ".xml");
            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                try   // catch
                {
                    XmlTextWriter xmlOut = new XmlTextWriter(saveFileDialog.FileName, Encoding.Default);
                    try   // finally
                    {
                        xmlOut.Formatting = Formatting.Indented;
                        xmlOut.WriteStartDocument();
                        xmlOut.WriteStartElement("AutoUpdate");
                        {
                            xmlOut.WriteStartElement("Pkg");
                            {
                                xmlOut.WriteAttributeString("updateCondition", "IfHigher");
                                xmlOut.WriteAttributeString("version", tbVersion.Text);
                                xmlOut.WriteAttributeString("buildUID", virtPackage.GetProperty("BuildUID"));
                            }
                            xmlOut.WriteEndElement();
                        }
                        xmlOut.WriteEndElement();
                        xmlOut.WriteEndDocument();
                        xmlOut.Flush();
                        didXmlGeneration = true;
                    }
                    finally
                    {
                        xmlOut.Close();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error creating XML file: \n" + ex.Message);
                }
            }
        }
コード例 #4
0
ファイル: AutoLaunchForm.cs プロジェクト: vaginessa/cameyo
 private void FillAutoLaunchCombo(ComboBox comboBox)
 {
     comboBox.Items.Clear();
     String[] shortcutDetails = virtPackage.GetProperty("Shortcuts").Split(';');
     foreach (String shortcutDetail in shortcutDetails)
     {
         if (shortcutDetail != "")
         {
             // [0] = Target
             // [1] = Args
             // [2] = Name
             // [3] = Description
             String[] items = shortcutDetail.Split('>');
             if (items.Length >= 2)
             {
                 comboBox.Items.Add(items[0]);
                 //System.IO.Path.GetFileNameWithoutExtension(items[0]) +
                 //SHORTCUT_DESCRIPTION_FRIENDLY_SEPARATOR +
             }
         }
     }
 }
コード例 #5
0
        public bool Do(VirtPackage virtPackage, ref bool dirty)
        {
            String oldValue = virtPackage.GetProperty("BaseDirName");
            String newValue;

            propertyLocalStorageCustomDir.Text = "";
            if (oldValue == "")
            {
                propertyLocalStorageDefault.Checked = true;
            }
            else if (oldValue.Equals("%ExeDir%\\%AppID%.cameyo.data", StringComparison.InvariantCultureIgnoreCase))
            {
                propertyLocalStorageExeDir.Checked = true;
            }
            else
            {
                propertyLocalStorageCustom.Checked = true;
                propertyLocalStorageCustomDir.Text = oldValue;
            }
            if (ShowDialog() == DialogResult.OK)
            {
                if (propertyLocalStorageDefault.Checked)
                {
                    newValue = "";
                }
                else if (propertyLocalStorageExeDir.Checked)
                {
                    newValue = "%ExeDir%\\%AppID%.cameyo.data";
                }
                else
                {
                    newValue = propertyLocalStorageCustomDir.Text;
                }
                if (newValue != oldValue)
                {
                    virtPackage.SetProperty("BaseDirName", newValue);
                    dirty = true;
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #6
0
ファイル: DataStorageForm.cs プロジェクト: gsool/cameyo
        public bool Do(VirtPackage virtPackage, ref bool dirty)
        {
            String oldValue = virtPackage.GetProperty("BaseDirName");
            String newValue;

            // BaseDirName
            //propertyLocalStorageCustomDir.Text = "";
            propertyLocalStorageCustomDir.Text = DefaultBaseDir;   // Shows user how to build this path
            if (oldValue == "")
            {
                propertyLocalStorageDefault.Checked = true;
            }
            else if (oldValue.Equals("%ExeDir%\\%AppID%.cameyo.files", StringComparison.InvariantCultureIgnoreCase))
            {
                propertyLocalStorageExeDir.Checked = true;
            }
            else
            {
                propertyLocalStorageCustom.Checked = true;
                propertyLocalStorageCustomDir.Text = oldValue;
            }

            // DataDirName
            string DefaultDataDirName = System.IO.Path.Combine(propertyLocalStorageCustomDir.Text, "CHANGES");

            propertyDataDirName.Text = virtPackage.GetProperty("DataDirName").Trim();
            propertyDataDir.Checked  = !string.IsNullOrEmpty(propertyDataDirName.Text);
            if (propertyDataDirName.Text == "")
            {
                propertyDataDirName.Text = DefaultDataDirName;   // Show user how to build this path
            }
            propertyDataDir_CheckedChanged(null, null);
            propertyLocalStorageCustom_CheckedChanged(null, null);

retry:
            if (ShowDialog() == DialogResult.OK)
            {
                propertyLocalStorageCustomDir.Text = propertyLocalStorageCustomDir.Text.Trim();
                propertyDataDirName.Text           = propertyDataDirName.Text.Trim();

                // Validate
                if (propertyLocalStorageCustom.Checked && propertyLocalStorageCustomDir.Text.Trim('\\').IndexOf('\\') == -1 &&
                    MessageBox.Show(PackageEditor.Messages.Messages.storageDirSubdirWarning + "\n" + propertyLocalStorageCustomDir.Text,
                                    "", MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.Yes)
                {
                    goto retry;
                }
                if (propertyDataDir.Checked && propertyDataDirName.Text.Trim('\\').IndexOf('\\') == -1 &&
                    MessageBox.Show(PackageEditor.Messages.Messages.storageDirSubdirWarning + "\n" + propertyDataDirName.Text,
                                    "", MessageBoxButtons.YesNo) != System.Windows.Forms.DialogResult.Yes)
                {
                    goto retry;
                }

                // BaseDirName
                if (propertyLocalStorageCustomDir.Text.Equals(DefaultBaseDir, StringComparison.InvariantCultureIgnoreCase))
                {
                    propertyLocalStorageCustomDir.Text = "";
                }
                if (propertyLocalStorageDefault.Checked)
                {
                    newValue = "";
                }
                else if (propertyLocalStorageExeDir.Checked)
                {
                    newValue = "%ExeDir%\\%AppID%.cameyo.files";
                }
                else
                {
                    newValue = propertyLocalStorageCustomDir.Text;
                }
                if (newValue != oldValue)
                {
                    virtPackage.SetProperty("BaseDirName", newValue);
                    dirty = true;
                }

                // DataDirName
                if (!propertyDataDir.Checked) // Causes bug (Tom Ferratt case): || propertyDataDirName.Text.Equals(DefaultDataDirName, StringComparison.InvariantCultureIgnoreCase))
                {
                    propertyDataDirName.Text = "";
                }
                virtPackage.SetProperty("DataDirName", propertyDataDirName.Text);

                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #7
0
ファイル: ADPermissions.cs プロジェクト: gsool/cameyo
        private void ADPermissionsForm_Load(object sender, EventArgs e)
        {
            dirty                 = false;
            ActiveControl         = comboBox;
            oldPropertiesChecksum = GetPropertiesChecksum();

            // AuthMaxOfflineDays
            int authMaxOfflineDays = 0;

            Int32.TryParse(virtPackage.GetProperty("AuthMaxOfflineDays"), out authMaxOfflineDays);
            numOfflineUsage.Value = authMaxOfflineDays;

            // AuthDenyMsg
            cbAuthDenyMsg.Checked = (virtPackage.GetProperty("AuthDenyMsgMode") == "1");
            tbAuthDenyMsg.Text    = virtPackage.GetProperty("AuthDenyMsg");
            if (string.IsNullOrEmpty(tbAuthDenyMsg.Text))
            {
                tbAuthDenyMsg.Text = "The company's security policy does not allow you to run this application.";
            }

            // ActiveDirectory
            PropertyToADEntities("ADAllowedGroups", allowedEntities);
            PropertyToADEntities("ADDeniedGroups", deniedEntities);
            cbRequireDomainConnection.Checked = (virtPackage.GetProperty("ADAllowedDomainsMode") == "1");
            tbRequireDomainConnection.Text    = virtPackage.GetProperty("ADAllowedDomains");
            cbNestedCheck.Checked             = (virtPackage.GetProperty("ADNestedCheck") == "1");

            curEntities            = allowedEntities;
            comboBox.SelectedIndex = 0;
            RefreshDisplay();
        }