/[AnywhereTS-MSSQL]/trunk/TSAdminTool/Image.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/Image.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSAdminTool/Image.cs	2012/08/28 12:19:34	432
+++ trunk/TSAdminTool/Image.cs	2012/08/28 12:25:52	433
@@ -79,7 +79,7 @@
         }
 
 
-        public void Make(string Server)
+        public void Make()
         {
             TempFileCollection objTempRoot = new TempFileCollection();        //Temp file collection, to be deleted afterwards
 
@@ -124,20 +124,20 @@
             DesigntimeConfig.WriteDefaultsToDatabase();
 
             // Save defaults to database, so they can be used by new clients
-           
+
             // If client is managed or there is no server in default settings, then update default settings
             ATSImageRuntimeConfig defaultRuntimeConfig = new ATSImageRuntimeConfig();
             defaultRuntimeConfig.ReadDefaultFromDatabase();
             if (defaultRuntimeConfig.ServerName == "" //  There is no server name in default config, update default record.
                 || DesigntimeConfig.ConfigFile) // Client is managed, update default record
-            {   
+            {
                 RuntimeConfig.WriteDefaultsToDatabase();
                 ProSupport.WriteConfigFiles(RuntimeConfig, "network", true);
             }
 
             string strRoot = objTempRoot.BasePath;
 
-            CreateInitrd(strRoot, Server);
+            CreateInitrd(strRoot);
             objTempRoot.Delete();
 
         }
@@ -331,10 +331,10 @@
                         strString += " vga=791"; // Default to 1024x768
 
                         using (log4net.NDC.Push(string.Format("width=", DesigntimeConfig.BootPicture.Width)))
-                            {
-                                Logging.ATSAdminLog.Error("ERROR unknown boot picture resolution (49488)");
-                            }
-                        
+                        {
+                            Logging.ATSAdminLog.Error("ERROR unknown boot picture resolution (49488)");
+                        }
+
                         break;
                 }
             }
@@ -342,9 +342,9 @@
         }
 
         // Create an ISO file containing a bootable client
-        public void CreateClientISO(string Server)
+        public void CreateClientISO()
         {
-            CreateISO(objTempdir.BasePath + string.Format(@"\{0}\initrd", Server));
+            CreateISO(objTempdir.BasePath + @"\initrd");
         }
 
         public void CreateISO(string pathInitrd)
@@ -352,7 +352,7 @@
             string strCDroot = objTempdir.BasePath + @"\cd";
             string strAppdir = Path.GetDirectoryName(Application.ExecutablePath);
             CreateClientRoot(pathInitrd, strCDroot);
-            
+
             // Lauch mkisofs.exe to create the ISO
             Process p = new Process();
             p.StartInfo = new ProcessStartInfo(strAppdir + @"\mkisofs\mkisofs.exe");
@@ -364,7 +364,7 @@
             {
                 objTempdir.AddFile(objTempdir.BasePath + @"\client.iso", false);
             }
-            catch {}
+            catch { }
         }
 
         public void CreateEtherboot()
@@ -386,10 +386,10 @@
                 MessageBox.Show("Internal error: Failed to create Network Boot Image. Aborting (22399).", "AnywhereTS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
 
                 using (log4net.NDC.Push(string.Format("image=", strBase + @"\client")))
-                    {
-                        Logging.ATSAdminLog.Error("Failed to create Network Boot Image.");
-                    }
-                
+                {
+                    Logging.ATSAdminLog.Error("Failed to create Network Boot Image.");
+                }
+
                 Application.Exit();
             }
             try
@@ -406,20 +406,20 @@
         // All that is then needed is a booter, that varies with the media
         // IN pathIntird: Path to the Initrd file that contains the client
         // IN strClientDirectory: Path to the directory where the client will be put. If not existing, directory will be created.
-        public void CreateClientRoot (string pathInitrd, string strClientDirectory)
+        public void CreateClientRoot(string pathInitrd, string strClientDirectory)
         {   // pathInitrd = Path to the initrd file that should be put on the CD
             string strBase;
-            
+
             string strAppdir = Path.GetDirectoryName(Application.ExecutablePath);
             strBase = objTempdir.BasePath;
 
             // Make a temp directory for the client root
             Directory.CreateDirectory(strClientDirectory);
-            
+
             // Create the isolinux.cfg file
             System.IO.StreamWriter writer = null;
             bool writeok = false; // Assume we have a problem.
-           
+
             string isolinuxCfg = strClientDirectory + @"\isolinux.cfg"; // Path to isolinux.cfg
 
             // Write the isolinux.cfg file.
@@ -459,12 +459,12 @@
                 objTempdir.AddFile(strClientDirectory + @"\vmlinuz", false);
             }
             catch
-            {} // File already exists in the collection
+            { } // File already exists in the collection
 
             File.Copy(DesigntimeConfig.DataDirectory + @"\isolinux.bin", strClientDirectory + @"\isolinux.bin", true);
             try
             {
-            objTempdir.AddFile(strClientDirectory + @"\isolinux.bin", false);
+                objTempdir.AddFile(strClientDirectory + @"\isolinux.bin", false);
             }
             catch
             { } // File already exists in the collection
@@ -480,7 +480,7 @@
 
         }
 
-        public void CreateCfg(string strCfgName,string strDestPath)
+        public void CreateCfg(string strCfgName, string strDestPath)
         {
             // Create the isolinux.cfg file
             System.IO.StreamWriter writer = null;
@@ -514,19 +514,19 @@
             else
             {
                 MessageBox.Show("Error cannot write to file (10565)", "AnywhereTS");
-               
-                    using (log4net.NDC.Push(string.Format("file={0}", isolinuxCfg)))
-                    {
-                        Logging.ATSAdminLog.Error("Cannot write to file");
-                    }
-                
+
+                using (log4net.NDC.Push(string.Format("file={0}", isolinuxCfg)))
+                {
+                    Logging.ATSAdminLog.Error("Cannot write to file");
+                }
+
                 return;
             }
         }
 
         // Create an initrd file
         // strRoot: 
-        public void CreateInitrd(string strRoot, string Server)
+        public void CreateInitrd(string strRoot)
         {
             string strBase;
 
@@ -544,13 +544,13 @@
             Process p = new Process();
             p.StartInfo = new ProcessStartInfo(strAppdir + @"\mksquash\mksqfs.exe");
             p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
-            p.StartInfo.Arguments = @"""" + strRoot + @"""" + " " + @"""" + strBase + string.Format(@"\{0}\initrd", Server) + @"""";
+            p.StartInfo.Arguments = @"""" + strRoot + @"""" + " " + @"""" + strBase + @"\initrd" + @"""";
             p.Start();
             p.WaitForExit();
         }
 
         // Create an ISO file containing a hard disk boot client including a hard disk writer that writes the client to hard disk
-        public void CreateHardDiskBootISO( string Server)
+        public void CreateHardDiskBootISO()
         {
             string strBase, strHDroot;
 
@@ -584,7 +584,7 @@
             p.WaitForExit();
 
             // Prepare CD with an initrd that is the HD burner
-            CreateISO(strHDroot + string.Format(@"\{0}\initrd", Server));
+            CreateISO(strHDroot + @"\initrd");
         }
 
         // Make a hard disk boot client including a hard disk writer that writes the client to hard disk, to be written to an USB drive 
@@ -730,7 +730,7 @@
                 fileSignature[1] = 71;
                 // Append to initrd file
                 FileStream objDest = File.Open(strPathInitrd, FileMode.Append, FileAccess.Write);
-                objDest.Write(fileSignature,0,2);
+                objDest.Write(fileSignature, 0, 2);
                 objDest.Close();
             }
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22