Beispiel #1
0
        public void SetRightClickContextMenu(bool rightClickContextMenu)
        {
            var currentRightClickContextMenu = RegistryStuff.GetRightClickContextMenu(DefaultForceOverwrite);

            if (currentRightClickContextMenu != rightClickContextMenu)
            {
                RegistryStuff.SetRightClickContextMenu(rightClickContextMenu);
            }
        }
Beispiel #2
0
        public void SetForceOverwrite(bool forceOverwrite)
        {
            var currentForceOverwrite = RegistryStuff.GetForceOverwrite(DefaultForceOverwrite);

            if (currentForceOverwrite != forceOverwrite)
            {
                RegistryStuff.SetForceOverwrite(forceOverwrite);
            }
        }
Beispiel #3
0
        public string SetOutputFolder(string outputFolder, string currentOutputFolder = null)
        {
            if (currentOutputFolder == null)
            {
                currentOutputFolder = RegistryStuff.GetOutputFolder(DefaultOutputFolder);
            }

            if (outputFolder == null)
            {
                // If not given, use the existing default folder
                outputFolder = currentOutputFolder;
            }

            if (outputFolder != currentOutputFolder)
            {
                // Update the registry key if the output folder has changed
                RegistryStuff.SetOutputFolder(outputFolder);
            }

            return(outputFolder);
        }
Beispiel #4
0
        public ExitCode Run(string destination, string shortcutPath, string outputFolder, string openWithAppPath = null, bool force = false)
        {
            var result = ExitCode.NotStarted;

            var currentOutputFolder = RegistryStuff.GetOutputFolder(DefaultOutputFolder);

            outputFolder = SetOutputFolder(outputFolder, currentOutputFolder);

            var systemPathResult = PathSetup.AddToOrReplaceInSystemPath(currentOutputFolder, outputFolder);

            if (!systemPathResult)
            {
                result = ExitCode.CannotUpdatePath;
            }
            else
            {
                var shortcut = new Shortcut(destination, shortcutPath, outputFolder, openWithAppPath);

                if (shortcut.Type != ShortcutType.Unknown)
                {
                    var createOutputFolderResult = CreateOutputFolder(shortcut.Folder);

                    if (!createOutputFolderResult)
                    {
                        result = ExitCode.CannotCreateOutputFolder;
                    }
                    else
                    {
                        var createShortcutResult = CreateShortcutFile(shortcut, force);

                        result = createShortcutResult ?
                                 ExitCode.Success :
                                 ExitCode.FileAlreadyExists;
                    }
                }
            }

            return(result);
        }
Beispiel #5
0
        public bool GetRightClickContextMenu()
        {
            var rightClickContextMenu = RegistryStuff.GetRightClickContextMenu(DefaultRightClickContextMenu);

            return(rightClickContextMenu);
        }
Beispiel #6
0
        public bool GetForceOverwrite()
        {
            var forceOverwrite = RegistryStuff.GetForceOverwrite(DefaultForceOverwrite);

            return(forceOverwrite);
        }
Beispiel #7
0
        public string GetOutputFolder()
        {
            var outputFolder = RegistryStuff.GetOutputFolder(DefaultOutputFolder);

            return(outputFolder);
        }