Skip to content

Commit

Permalink
add advanced menu option to copy program to program files
Browse files Browse the repository at this point in the history
  • Loading branch information
jmclaren7 committed Aug 11, 2024
1 parent 87eeeed commit 462da5f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion SimpleBackup.au3
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ While 1
; Setup a custom menu
Global $MenuMsg = 0
If Not IsDeclared("ExitMenuItem") Then Global Enum $ExitMenuItem = 1000, $ScheduledTaskMenuItem, $FixConsoleMenuItem, $BrowserMenuItem, _
$VerboseMenuItem, $TemplateMenuItem, $NewProfileMenuItem, $AboutMenuItem, $WebsiteMenuItem
$VerboseMenuItem, $TemplateMenuItem, $NewProfileMenuItem, $AboutMenuItem, $WebsiteMenuItem, $InstallMenuItem

; Setup file menu
$g_hFile = _GUICtrlMenu_CreateMenu()
Expand All @@ -227,6 +227,7 @@ While 1

; Setup tools menu
$g_hTools = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem($g_hTools, -1, "Copy " & @ScriptName & " To Program Files And Restart Program", $InstallMenuItem)
_GUICtrlMenu_InsertMenuItem($g_hTools, -1, "Create/Reset Scheduled Task (Profile: " & _GetProfileName() & ")", $ScheduledTaskMenuItem)
_GUICtrlMenu_InsertMenuItem($g_hTools, -1, "Open Restic Browser", $BrowserMenuItem)
_GUICtrlMenu_InsertMenuItem($g_hTools, -1, "Add Missing Configuration Options From Template", $TemplateMenuItem)
Expand Down Expand Up @@ -388,6 +389,15 @@ While 1
_UpdateEnv($aConfig)
$ResticBrowserPid = Run($ResticBrowserFullPath)

; Copy the program to Program Files
Case $InstallMenuItem
If @Compiled Then
$sDestinationFullPath = @ProgramFilesDir & "\" & StringTrimRight(@ScriptName, 4) & "\" & @ScriptName
FileCopy(@ScriptFullPath, $sDestinationFullPath, $FC_CREATEPATH)
ShellExecute($sDestinationFullPath)
Exit
EndIf

; Create a sceduled task to run the backup
Case $ScheduledTaskMenuItem
If _GetProfileName() <> "Default" Then
Expand Down

0 comments on commit 462da5f

Please sign in to comment.