private void WriteProgressStatus(string status)
        {
            lock (this.updateLock)
            {
                if (this.isUpdating)
                {
                    return;
                }
                else
                {
                    this.isUpdating = true;
                }
            }

            // Only write out new progress information after
            // CM has consumed the previous progress information file
            //
            if (!File.Exists(this.progressFileName))
            {
                var tmpFileName = string.Format("{0}.tmp", this.progressFileName);

                ImageBuilderUtility.WriteStringToFile(tmpFileName, status, false, Encoding.Unicode);

                File.Move(tmpFileName, this.progressFileName);
            }

            lock (this.updateLock)
            {
                this.isUpdating = false;
            }
        }
Exemplo n.º 2
0
 public static string EnsureHashFile(string resourcePath, string hashFilePath, bool imageStoreServiceEnabled)
 {
     if (!FabricFile.Exists(hashFilePath))
     {
         string checksum = ChecksumUtility.ComputeHash(resourcePath, imageStoreServiceEnabled);
         ImageBuilderUtility.WriteStringToFile(hashFilePath, checksum);
         return(checksum);
     }
     else
     {
         return(ImageBuilderUtility.ReadStringFromFile(hashFilePath));
     }
 }