Net-FullAuto

 view release on metacpan or  search on metacpan

installer/fa_installer.pl  view on Meta::CPAN

               'On this server, FullAuto will install itself, and then '.
               'proceed with processing where FullAuto will stand '.
               'up other servers, and exhibit the completely automated '.
               'installation and startup of complex software/application '.
               'architecture spanning multiple hosts. If you click the '.
               'button \'Tag for Removal\', FullAuto will terminate this '.
               'server along with all servers launched for the session '.
               'when you click the checkbox \'Cleanup on Terminate\' at the '.
               "bottom of the FullAuto AWS Dashboard interface.\n\nWould you ".
               "like to tag this server for later termination?\n\n(If you ".
               'are new to the Cloud, and only wish to test drive FullAuto, '.
               'it is recommended you choose \'Tag for '.
               'Removal\', and later check the box \'Cleanup on Terminate\' '.
               'when you are done with the session, so that you don\'t '.
               'incur any unnecessary Amazon fees.)';
   my $dialog=Wx::MessageDialog->new(
      $self,$message,$title,wxOK|wxCANCEL|wxICON_EXCLAMATION);
   $dialog->SetOKCancelLabels('Tag for Removal','Do NOT Tag');
   my $choice=$dialog->ShowModal();
   $choice||=0;
   if ($choice==5101) {
      $self->{tagged}=0;
   } else {
      $self->{tagged}=1;
   }

}

sub OnClick_chkbox1 {

   my ($self, $event) =@_;
   my $title='Cleanup on Terminate?';
   my $message='When this box is checked, upon termination of the '.
               'FullAuto© AWS Installer Dashboard window, '.
               'a cleanup process is launched which will destroy all the '.
               'servers this session creates on Amazon EC2, as well as all files '.
               'cached locally. NOTHING will be saved except for this '.
               'FullAuto-AWS-Installer-Dashboard-MSWin.exe file itself, which you '.
               'may manually delete. You will have to launch a '.
               'new FullAuto server from Amazon and download a new '.
               'key file and credentials file to run a session again, '.
               'if you terminate this instance of the Dashboard with this '.
               'box checked. So it is recommended that you DO NOT have '.
               'this box checked until you are pretty certain you have no '.
               'more need to run the FullAuto AWS Installer Dashboard, '.
               'for yourself or others.';
   my $dialog=Wx::MessageDialog->new(
      $self,$message,$title,wxOK|wxCANCEL|wxICON_EXCLAMATION);
   $dialog->SetOKCancelLabels('OK','CANCEL Cleanup');
   my $choice=$dialog->ShowModal() if $self->{cucb}->IsChecked();
   $choice||=0;
   if ($choice==5101) {
      $self->{cucb}->SetValue(0);
   }

}

sub OnClick_chkbox2 {

   my ($self, $event) =@_;
   my $desktop=$ENV{HOMEDRIVE}.$ENV{HOMEPATH}.'\\desktop';
   my $filedlg = Wx::FileDialog->new($self,         # parent
                                     'Open File',   # Caption
                                     $desktop,      # Default directory
                                     'putty',       # Default file
                                     "putty utilities (*.exe)|*.exe", # wildcard
                                     wxFD_SAVE|wxFD_OVERWRITE_PROMPT); #style
   # If the user really selected one
   if ($filedlg->ShowModal==wxID_OK)
   {
       my $filename = $filedlg->GetPath;
       my $dir=$filename;
       $dir=~s/^(.*)\\.*$/$1/;
       copy "putty.exe", $filename;
       copy "puttygen.exe", "$dir\\puttygen.exe";
       copy "pscp.exe", "$dir\\pscp.exe";
   }
   $self->{epcb}->SetValue(0);

}

sub OnClick_chkbox3 {

   my ($self, $event) =@_;
   my $desktop=$ENV{HOMEDRIVE}.$ENV{HOMEPATH}.'\\desktop';
   my $filedlg = Wx::FileDialog->new($self,         # parent
                                     'Open File',   # Caption
                                     $desktop,      # Default directory
                                     'logs',        # Default file
                                     "FullAuto Log Files (*.zip)|*.zip",
                                                    # wildcard
                                     wxFD_SAVE|wxFD_OVERWRITE_PROMPT); #style
   # If the user really selected one
   unless (-e "logs.zip") {
      my $title="No Log Files Available";
      my $message="No Log Files Available - Logs are available ".
                  "after an Instruction Set is run => $desktop";
      my $dialog=Wx::MessageDialog->new(
         $self,$message,$title,wxOK|wxICON_EXCLAMATION);
      my $choice=$dialog->ShowModal();
   } elsif ($filedlg->ShowModal==wxID_OK) {
       my $filename = $filedlg->GetPath;
       my $dir=$filename;
       $dir=~s/^(.*)\\.*$/$1/;
       copy "logs.zip", "$dir\\logs.zip";
   }
   $self->{elcb}->SetValue(0);

}

sub OnClick_chkbox_export {

   my ($self, $event) =@_;
   my $title='Launch New FullAuto Server?';
   my $message='';
   if (-e "ip.txt") {
      $message='It is important to note that this copy of '.
               'FullAuto_DEMO_MSWin.exe is supplied with active '.
               'credentials enabling you to bypass the somewhat lengthy '.
               'FullAuto Server setup, and saving you the task of having '.
               'to work with Amazon\'s AWS EC2 web dashboard. If you proceed '.
               'with this choice, you will have to first launch a server '.
               'from the Amazon AWS EC2 dashboard, create and download a new '.
               'private key, and obtain access credentials for the Amazon '.
               'API. Then you will have to wait at least 20 minutes for '.
               'a new FullAuto setup to be downloaded and installed on the '.
               'new FullAuto server before you can obtain the same setup, '.
               'access, and ability to run and view the session that you have '.
               "now.\n\nYOU CANNOT REVERSE THIS DECISION!\n\nOnce you proceed ".
               'with the choise to Launch a new FullAuto Server, the '.
               'currently active credentials will be permanently discarded '.
               "and unrecoverable.\n\nDo you still wish to proceed?";
   } elsif (-e "saved.txt") {
      $message='You have checked the box to Launch a New FullAuto Server. '.
               'Understand that if you proceed with this choice, that your '.
               'current settings will be permanently discarded. You will '.
               'again have to launch a server from the Amazon AWS EC2 '.
               'dashboard, or specify a pre-existing server (use the Amazon '.
               'AWS EC2 dashboard to learn the IP Address of any pre-existing '.
               'servers.) You will again have to create, download and '.
               'specify a credentials.csv file, or use a pre-existing one '.
               '(if the credentials are still active in AWS.) You will again '.
               'have to indicate a key file (<filename>.pem, a new one you '.
               'can choose to create when launching a new server, or '.
               'pre-existing if you have one that is still active. You will '.
               'again have to wait at least 20 minutes for a new FullAuto '.
               'install to take place before you can obtain the same setup '.
               'access, and ability to run and view the session that have now. '.
               "\n\nYOU CANNOT REVERSE THIS DECISION!\n\nOnce you proceed ".
               'with the choice to Launch a new FullAuto Server, the current '.
               'settings will be permanently discarded and unrecoverable '.
               "(except by manual re-entry.)\n\nDo you still wish to proceed?";
   } else {
      #$self->{nscb}->SetValue(1);
      $message='There are no saved settings, and a session is not currently '.
               'running. To run any FullAuto Instruction Set, a fully functioning '.
               'FullAuto Server is necessary, which it is the job of this '.



( run in 0.545 second using v1.01-cache-2.11-cpan-39bf76dae61 )