Author Topic: Crashed and lost button layout  (Read 15101 times)

JPCoetzee

  • Junior Member
  • **
  • Posts: 17
    • View Profile
Crashed and lost button layout
« on: October 24, 2023, 12:39:03 »
MC crashed as I was using the Button Editor to copy one button to another with CTRL pressed.
MC restarted automatically and the button panel has reset to default. Closing and reopening confirms. I have lost all my custom buttons.    :'(

Are the button configurations backed up anywhere?
« Last Edit: October 24, 2023, 12:49:55 by JPCoetzee »

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Crashed and lost button layout
« Reply #1 on: October 24, 2023, 12:56:12 »
Not if you did not do a backup of all configuration..
But Windows might have done it

If you go to
C:\Users\[USERNAME]\AppData\Roaming\MultiCommander\Config\MultiButtons.xml

right click and from the Windows Shell Context menu you might have a option named "Restore older version" or something like that.. Name might differ depending on name Windows version
you might also do Properties and there might be a Previous Versions tab.. But that is all depending on how things are setup in Windows for how much it should keep for old versions.

JPCoetzee

  • Junior Member
  • **
  • Posts: 17
    • View Profile
Re: Crashed and lost button layout
« Reply #2 on: October 31, 2023, 16:54:02 »
This Multi-script creates a timestamped configuration backup in a specific directory. It's a bit quicker to use than Help > Backup/Restore if assigned to a hotkey, button or the "User commands" menu. You'll need to edit line 10:

Code: [Select]
@var $backupdir = "C:\\Users\\jpcoetzee\\Documents\\Apps\\MultiCommander\\;
to suit your own requirements.

Code: [Select]
// 1. Create filename with data and time
// 2. Get location of config files
// 3. Use PackFile to create the backup
// ---------------------------------------

// 1. Create filename with data and time
@var $now = GetTime();
@var $datestamp = FormatDate( "yyyyMMdd" , $now );
@var $timestamp = FormatTime( "HHmmss" , $now );
@var $backupdir = "C:\\Users\\jpcoetzee\\Documents\\Apps\\MultiCommander\\;
@var $zipfilename = $backupdir + "MC_ConfigBackup_" + $datestamp + "_" + $timestamp + ".zip";

// 2. Get location of config files
@var $mcconfigdir = GetTagValue("${mcconfigpath}");
@var $mcuserdatadir = StrReplace( $mcconfigdir, "\Config" , "\UserData" );
// LogDump($datestamp)
// LogDump($timestamp)
// LogDump($backupdir)
// LogDump($zipfilename)
// LogDump($mcconfigdir);
// LogDump($mcuserdatadir);

// 3. Use PackFile to create the backup
PackFile($zipfilename, $mcconfigdir,   "*.*", "zip", "NOWAIT, USEEXISTINGQUEUE");
PackFile($zipfilename, $mcuserdatadir, "*.*", "zip", "NOWAIT, USEEXISTINGQUEUE");

I'm sure the wizards here could improve it!

HTH,

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: Crashed and lost button layout
« Reply #3 on: November 01, 2023, 10:53:09 »
Built in backup do not just take everything in the folder.. Just the file that belong to MC. and some other things..

But I think I can add so the internal method for backup/restore can be called from script with something like

Code: [Select]
BackupConfiguration( $filename );

RestoreConfiguration( $filename );



AlanJB

  • VIP Member
  • *****
  • Posts: 436
  • VERY old Programmer
    • View Profile
Re: Crashed and lost button layout
« Reply #4 on: November 01, 2023, 12:22:58 »
Built in backup do not just take everything in the folder.. Just the file that belong to MC. and some other things..

But I think I can add so the internal method for backup/restore can be called from script with something like

Code: [Select]
BackupConfiguration( $filename );

RestoreConfiguration( $filename );

Not  the OP, but that would be very useful Mathias

JPCoetzee

  • Junior Member
  • **
  • Posts: 17
    • View Profile
Re: Crashed and lost button layout
« Reply #5 on: November 02, 2023, 19:29:28 »
Not  the OP, but that would be very useful Mathias

Seconded!