- Timestamp:
- 2006-04-21T10:27:53+12:00 (18 years ago)
- Location:
- trunk/gsinstaller
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsinstaller/DiskSpace.h
r2324 r11663 17 17 unsigned long totalFreeSpace(); 18 18 }; 19 19 20 #endif -
trunk/gsinstaller/configurable.cpp
r2534 r11663 26 26 { return this->option; 27 27 } 28 void configurable::setFirst(bool isFirst) 29 { this->first = isFirst; 30 } 31 32 bool configurable::isFirst() 33 { return this->first; 34 } 35 void configurable::setFinal(bool isFinal) 36 { this->final = isFinal; 37 } 38 bool configurable::isFinal() 39 { return this->final; 40 } 28 void configurable::setFirst(bool isFirst){ this->first = isFirst;}bool configurable::isFirst() 29 { return this->first;} 30 void configurable::setFinal(bool isFinal){ this->final = isFinal;} 31 bool configurable::isFinal(){ return this->final;} -
trunk/gsinstaller/copyProgress.h
r2534 r11663 1 1 #ifndef _COPYPROGRESS_H_ 2 2 #define _COPYPROGRESS_H_ 3 3 4 #include <windows.h> 4 5 #include <time.h> 6 5 7 6 8 class copyProgressBar … … 16 18 bool showing; 17 19 time_t startTime; 20 18 21 public: 19 22 // constructors/destructors … … 21 24 22 25 copyProgressBar(unsigned long totalSize, unsigned long totalFiles); 26 23 27 ~copyProgressBar(); // destructor introduced to ensure that open windows are closed 24 28 25 29 void registerClass(); // does the registration of the window classes into Windows 30 26 31 // the window procedure itself 27 32 LRESULT CALLBACK windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam); … … 29 34 // timing methods 30 35 void setStartTime() { this->startTime = time(NULL); } 36 31 37 // messaging methods 32 38 void done(unsigned long bytesDone); … … 36 42 // reinitialise the progress bar, giving a new total completion size 37 43 void init(unsigned long totalSize, unsigned long totalFiles); 44 38 45 // show the progress bar 39 46 void show(); 47 40 48 // close (hide) the progress bar 41 49 void close(); 50 42 51 }; 52 43 53 #endif -
trunk/gsinstaller/file.cpp
r2534 r11663 5 5 // #include <stdio.h> 6 6 7 #include "file.h" 8 9 #include <direct.h> 7 #include "file.h"#include <direct.h> 10 8 11 9 void File::_getDetails() … … 107 105 { return this->size; 108 106 } 109 unsigned long File::getFileSize() 110 { unsigned long size, files; 111 112 this->getFileSize(size, files); 113 return size; 114 } 107 unsigned long File::getFileSize(){ unsigned long size, files; this->getFileSize(size, files); return size;} 115 108 void File::getFileSize(unsigned long &totalSize, unsigned long &totalFiles) 116 { totalSize = 0; 117 totalFiles = 1; 109 { totalSize = 0; totalFiles = 1; 118 110 119 111 if (this->is_dir) … … 122 114 123 115 while (here != end) 124 { unsigned long ldata, lcount; 125 126 here->getFileSize(ldata, lcount); 127 totalSize += ldata; 128 totalFiles += lcount; 116 { unsigned long ldata, lcount; here->getFileSize(ldata, lcount); totalSize += ldata; totalFiles += lcount; 129 117 here ++; 130 } 131 } 132 133 totalSize += this->size; 134 } 118 } } totalSize += this->size;} 135 119 136 120 … … 154 138 { return this->does_exist; 155 139 } 156 bool File::remove() 157 { bool ok = true; 158 159 if (this->is_dir) 160 { 161 vector<File>::iterator here = this->children.begin(); 162 vector<File>::iterator end = this->children.end(); 163 164 while (here != end) 165 { ok = here->remove() && ok; 166 here ++; 167 } 168 169 ok = RemoveDirectory(this->path.c_str()) && ok; 170 } 171 else 172 { ok = DeleteFile(this->path.c_str()) != 0 ? true : false; 173 } 174 return ok; 175 } 140 bool File::remove(){ bool ok = true; if (this->is_dir) { vector<File>::iterator here = this->children.begin(); vector<File>::iterator end = this->children.end(); while (here != end) { ok = here->remove() && ok; here ++; } ok = RemoveDirectory(this->path.c_str()) && ok; } else { ok = DeleteFile(this->path.c_str()) != 0 ? true : false; } return ok;} 176 141 void File::copy(char *to) 177 142 { -
trunk/gsinstaller/gsManifest.cpp
r2534 r11663 324 324 if (actionName == "Manifest.CreateDir" || actionName == "CreateDir") 325 325 { 326 if (!RemoveDirectory(params[0].c_str())) 327 { 328 this->removeFailed.add(params[0]); 329 } 326 if (!RemoveDirectory(params[0].c_str())) { this->removeFailed.add(params[0]); } 330 327 return true; 331 328 } … … 336 333 if (!f.remove()) 337 334 { 338 this->removeFailed.add(params[0]); 339 } 335 this->removeFailed.add(params[0]); } 340 336 return true; 341 337 } -
trunk/gsinstaller/gsProfile.cpp
r2534 r11663 27 27 { if (actionName == "ProfileCreate") 28 28 { if (this->fileName == params[0]) 29 { DeleteFile(params[0].c_str()); 30 return true; 29 { DeleteFile(params[0].c_str()); return true; 31 30 } 32 31 } … … 100 99 { if (!WritePrivateProfileString( sectionName.c_str(), itemName.c_str(), 101 100 itemValue.c_str(), this->fileName.c_str())) 102 { DWORD error = GetLastError(); 103 /* char buffer[201]; 104 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL); 101 { DWORD error = GetLastError();/* char buffer[201]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL); 105 102 MessageBox(0, buffer, "Write error", MB_OK); 106 103 */ … … 115 112 { if (!WritePrivateProfileString( sectionName.c_str(), itemName.c_str(), 116 113 NULL, this->fileName.c_str())) 117 { DWORD error = GetLastError(); 118 if (error != 3) 119 { char buffer[201]; 120 121 MessageBox(0, "Failed", itemName.c_str(), MB_OK); 122 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL); 114 { DWORD error = GetLastError(); if (error != 3) { char buffer[201]; MessageBox(0, "Failed", itemName.c_str(), MB_OK); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL); 123 115 MessageBox(0, buffer, "Write error", MB_OK); 124 116 return false; 125 117 } 126 118 WritePrivateProfileString(NULL, NULL, NULL, this->fileName.c_str()); 127 MessageBox(0, this->fileName.c_str(), sectionName.c_str(), MB_OK); 128 } 119 MessageBox(0, this->fileName.c_str(), sectionName.c_str(), MB_OK); } 129 120 return true; 130 121 } -
trunk/gsinstaller/unInstall.cpp
r2532 r11663 28 28 FilePath p(this->logfileName); 29 29 FilePath *parent = p.parent(); 30 command.addParameter(parent->pathString()); 31 delete parent; 30 command.addParameter(parent->pathString()); delete parent; 32 31 33 32 if (this->modules["default"].begin()->command != "InstallRoot") … … 61 60 { string command; 62 61 stringArray params; 63 64 62 // don't try to open an non-existing log; this has serious 65 63 // repercussions with bad old VC++ … … 84 82 } 85 83 else 86 { unInstallCommand action(command, params); 87 88 this->storeCommand(action); 84 { unInstallCommand action(command, params); this->storeCommand(action); 89 85 } 90 86 } … … 109 105 110 106 bool installManager::storeCommand(unInstallCommand &command) 111 { 112 this->modules[this->currentModule].push_back(command); 113 114 this->changed = true; // set the "changed" flag 107 { this->modules[this->currentModule].push_back(command); this->changed = true; // set the "changed" flag 115 108 return true; 116 109 } … … 245 238 return command; 246 239 } 247 void installManager::abortLog() 248 { this->changed = false; 249 } 240 void installManager::abortLog(){ this->changed = false;} 250 241 bool installManager::recordLog() 251 242 { // just return if there are no changes to record
Note:
See TracChangeset
for help on using the changeset viewer.