mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-04 00:54:54 -06:00
Merge continued
git-svn-id: svn://ultimatepp.org/upp/trunk@10263 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
adf46bd64e
commit
2e4b276e07
3860 changed files with 1161787 additions and 438 deletions
65
uppdev/E011/uninstall.cpp
Normal file
65
uppdev/E011/uninstall.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
#include "e011.h"
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
||||
String GetShellFolder(const char *name, HKEY type) {
|
||||
return GetWinRegString(name, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", type);
|
||||
}
|
||||
|
||||
void DelKey(const char *dir, const char *key) {
|
||||
HKEY hkey;
|
||||
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, dir, 0, KEY_READ, &hkey) != ERROR_SUCCESS)
|
||||
return;
|
||||
RegDeleteKey(hkey, key);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
void RemoveWindowsItems() {
|
||||
DeleteFolderDeep(AppendFileName(GetShellFolder("Common Programs", HKEY_LOCAL_MACHINE), "\\Contalitri E011"));
|
||||
DeleteFile(AppendFileName(GetShellFolder("Desktop", HKEY_CURRENT_USER), "Contalitri E011.lnk"));
|
||||
|
||||
DelKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\E011", "DisplayName");
|
||||
DelKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\E011", "UninstallString");
|
||||
DelKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", "E011");
|
||||
}
|
||||
|
||||
void Uninstall() {
|
||||
SetLanguage(LNGFromText("IT-IT"));
|
||||
SetDefaultCharset(CHARSET_WIN1252);
|
||||
Draw::SetStdFont(ScreenSans(11));
|
||||
|
||||
String path = GetExeFilePath();
|
||||
String bat = AppendFileName(GetShellFolder("Desktop", HKEY_CURRENT_USER), "ERemove.bat");
|
||||
String dir = GetFileFolder(path);
|
||||
if(!PromptYesNo("[*3 Desideri veramente rimuovere il tool del Contalitri E011 dal computer ?&&]"
|
||||
"Saranno rimossi tutti i file e le cartelle.")) return;
|
||||
DeleteFolderDeep(dir);
|
||||
RemoveWindowsItems();
|
||||
SaveFile(bat,
|
||||
":Repeat\r\n"
|
||||
"del \"" + path + "\"\r\n"
|
||||
"if exist \"" + path + "\" goto Repeat\r\n"
|
||||
"del \"" + GetExeDirFile("e011.log") + "\"\r\n"
|
||||
"rmdir \"" + dir + "\"\r\n"
|
||||
"del \"" + bat + "\"\r\n"
|
||||
);
|
||||
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;
|
||||
si.wShowWindow = SW_HIDE;
|
||||
char h[512];
|
||||
strcpy(h, bat);
|
||||
if(!CreateProcess(NULL, h, NULL, NULL, FALSE, IDLE_PRIORITY_CLASS, NULL, GetShellFolder("Desktop", HKEY_CURRENT_USER), &si, &pi))
|
||||
Exclamation("Rimozione incompleta ... Impossibile cancellare alcuni file.");
|
||||
else
|
||||
Exclamation("Rimozione terminata con successo.");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void Uninstall() {}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue