예제 #1
0
 public ADPermissionsForm(VirtPackage virtPackage)
 {
     this.virtPackage = virtPackage;
     allowedEntities  = new List <ADEntity>();
     deniedEntities   = new List <ADEntity>();
     InitializeComponent();
 }
예제 #2
0
        public RegistryEditor(VirtPackage virtPackage, DelegateRequireElevation requireElevation,
                              TreeView fsFolderTree, ListView fsFilesList, Label fsFolderInfoFullName,
                              ComboBox fsFolderInfoIsolationCombo, ToolStripButton regRemoveBtn, ToolStripButton regEditBtn)
        {
            this.virtPackage                = virtPackage;
            this.requireElevation           = requireElevation;
            this.fsFolderTree               = fsFolderTree;
            this.fsFilesList                = fsFilesList;
            this.fsFolderInfoFullName       = fsFolderInfoFullName;
            this.fsFolderInfoIsolationCombo = fsFolderInfoIsolationCombo;
            this.regRemoveBtn               = regRemoveBtn;
            this.regEditBtn = regEditBtn;

            fsFolderInfoFullName.Text       = "";
            fsFolderInfoIsolationCombo.Text = "";
            fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.fullAccess);
            fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.isolated);
            if (VirtPackage.PkgVer > 1)
            {
                fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.strictlyIsolated);
            }
            fsFolderTree.AfterSelect += OnFolderTreeSelect;
            fsFolderInfoIsolationCombo.SelectionChangeCommitted += OnFolderSandboxChange;
            regRemoveBtn.Click += OnRemoveBtnClick;
            regEditBtn.Click   += OnEditClick;
            dirty      = false;
            treeHelper = new TreeHelper(virtPackage);

            // delegate for AddFileOrFolder init
            Del_AddFOrF = new DelegateAddFileOrFolder(this.AddFileOrFolder);
        }
예제 #3
0
 public CustomEventsForm(VirtPackage virtPackage)
 {
     this.virtPackage     = virtPackage;
     onStartUnvirtualized = new List <CustomEvent>();
     onStartVirtualized   = new List <CustomEvent>();
     onStopVirtualized    = new List <CustomEvent>();
     onStopUnvirtualized  = new List <CustomEvent>();
     InitializeComponent();
 }
예제 #4
0
        private void PropertyToLv(String property)
        {
            // propertyAutoLaunchMenuLV (from autoLaunchMenu)
            propertyMenuLV.Items.Clear();
            String[] items = autoLaunchMenu.Split(';');
            for (int i = 0; i < items.Length; i++)
            {
                String[] values = items[i].Split('>');
                if (values.Length < 2)
                {
                    continue;                        // Not allowed
                }
                ListViewItem lvItem = new ListViewItem();

                // Col 0: name
                if (values.Length >= 3)
                {
                    lvItem.Text = VirtPackage.FriendlyShortcutName(values[2]);
                }

                // Col 1: target
                if (values.Length >= 1)
                {
                    lvItem.SubItems.Add(values[0]);
                }
                else
                {
                    lvItem.SubItems.Add("");
                }

                // Col 2: description
                if (values.Length >= 4)
                {
                    lvItem.SubItems.Add(values[3]);
                }
                else
                {
                    lvItem.SubItems.Add("");
                }

                // Col 3: args
                if (values.Length >= 2)
                {
                    lvItem.SubItems.Add(values[1]);
                }
                else
                {
                    lvItem.SubItems.Add("");
                }

                // Add to list
                propertyMenuLV.Items.Add(lvItem);
            }
        }
예제 #5
0
        private void DataStorageForm_Load(object sender, EventArgs e)
        {
            int licenseType = VirtPackage.LicDataLoadFromFile(null);

            if (licenseType < VirtPackage.LICENSETYPE_PRO)
            {
                MainForm.DisableControl(propertyDataDir);
                MainForm.DisableControl(propertyDataDirName);
                //Height -= 50;
            }
        }
예제 #6
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);
            }
        }
예제 #7
0
 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;
     }
 }
예제 #8
0
        public FileSystemEditor(VirtPackage virtPackage, TreeView fsFolderTree, ListView fsFilesList,
                                Label fsFolderInfoFullName, ComboBox fsFolderInfoIsolationCombo,
                                ToolStripButton fsAddBtn, ToolStripButton fsRemoveBtn, ToolStripButton fsAddEmptyDirBtn,
                                ToolStripButton fsSaveFileAsBtn, ToolStripButton fsAddDirBtn)
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));

            this.virtPackage                = virtPackage;
            this.fsFolderTree               = fsFolderTree;
            this.fsFilesList                = fsFilesList;
            this.fsFolderInfoFullName       = fsFolderInfoFullName;
            this.fsFolderInfoIsolationCombo = fsFolderInfoIsolationCombo;
            this.fsAddBtn         = fsAddBtn;
            this.fsRemoveBtn      = fsRemoveBtn;
            this.fsAddEmptyDirBtn = fsAddEmptyDirBtn;
            this.fsSaveFileAsBtn  = fsSaveFileAsBtn;
            this.fsAddDirBtn      = fsAddDirBtn;

            fsFolderInfoFullName.Text       = "";
            fsFolderInfoIsolationCombo.Text = "";
            fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.fullAccess);
            fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.isolated);
            if (VirtPackage.PkgVer > 1)
            {
                fsFolderInfoIsolationCombo.Items.Add(PackageEditor.Messages.Messages.strictlyIsolated);
            }
            fsFolderTree.AfterSelect += OnFolderTreeSelect;
            fsFolderInfoIsolationCombo.SelectionChangeCommitted += OnFolderSandboxChange;
            fsAddBtn.Click         += OnAddBtnClick;
            fsAddDirBtn.Click      += OnAddDirBtnClick;
            fsRemoveBtn.Click      += OnRemoveBtnClick;
            fsAddEmptyDirBtn.Click += OnAddEmptyDirBtnClick;
            fsSaveFileAsBtn.Click  += OnSaveFileAsBtnClick;
            fsFilesList.KeyDown    += Vfs_KeyDown;
            fsFolderTree.KeyDown   += Vfs_KeyDown;
            dirty      = false;
            treeHelper = new TreeHelper(virtPackage);

            // delegate for AddFileOrFolderRecursive init
            Del_AddFOrFR = new DelegateAddFileOrFolderRecursive(this.AddFileOrFolderRecursive);
        }
예제 #9
0
 public TreeHelper(VirtPackage virtPackage)
 {
     this.virtPackage = virtPackage;
 }
예제 #10
0
 public AutoLaunchForm(VirtPackage virtPackage, FileSystemEditor fileSystemEditor)
 {
     this.virtPackage      = virtPackage;
     this.fileSystemEditor = fileSystemEditor;
     InitializeComponent();
 }
예제 #11
0
 public FileProperties(VirtPackage virtPackage)
 {
     InitializeComponent();
     this.virtPackage = virtPackage;
 }
예제 #12
0
 public VirtFilesBrowse(VirtPackage virtPackage, FileSystemEditor fileSystemEditor)
 {
     InitializeComponent();
     this.virtPackage      = virtPackage;
     this.fileSystemEditor = fileSystemEditor;
 }
예제 #13
0
        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);
            }
        }