platform/wm/rhodes/AppManager.cpp in rhodes-1.2.2 vs platform/wm/rhodes/AppManager.cpp in rhodes-1.4.0
- old
+ new
@@ -3,11 +3,11 @@
#include "AppManager.h"
#ifdef ENABLE_DYNAMIC_RHOBUNDLE
#include "rho/net/NetRequest.h"
-#include "HttpServer.h"
+#include "common/RhodesApp.h"
#include "unzip.h"
#include "ext/rho/rhoruby.h"
#include "common/AutoPointer.h"
@@ -50,24 +50,25 @@
if ( szUrl )
{
//get zip file with rhodes
//DWORD dwDataSize = 0;
rho::net::CNetRequest request;
- NetResponse(resp, request.pullData(szUrl));
+ NetResponse(resp, request.pullData(szUrl, null));
DWORD dwDataSize = resp.getDataSize();
//char* zipData = request.doRequest( L"GET",const_cast<char*>(szUrl),NULL,0,NULL,0,false,true,false,&dwDataSize);
const char* zipData = resp.getCharData();
if ( zipData && dwDataSize > 0 )
{
- LPWSTR rootw = wce_mbtowc(RhoGetRootPath());
-
+ LPWSTR rootw = wce_mbtowc(rho_native_rhopath());
+ rootw[wcslen(rootw)-1] = '\\';
bool ret = false;
if (wcslen(rootw)<MAX_PATH) {
TCHAR name[MAX_PATH+2];
wsprintf(name,L"%sapps%c",rootw,'\0');
if( RemoveFolder(name) ) {
wsprintf(name,L"%slib%c",rootw,'\0');
+
ret = RemoveFolder(name);
}
}
//TODO: Add error handling to unzip code
@@ -76,10 +77,10 @@
// Open zip file
HZIP hz = OpenZip(const_cast<char*>(zipData), dwDataSize, szZipPassword);
if ( hz ) {
//Stop HTTP Server
- CHttpServer::Instance()->FreezeThread();
+ RHODESAPP().stopApp();
// Set base for unziping
SetUnzipBaseDir(hz, rootw);
// Get info about the zip
\ No newline at end of file