Added javascript install.WinReg object code for Windows platform only
git-svn-id: svn://10.0.0.236/trunk@31491 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -54,6 +54,10 @@
|
||||
#include "nsInstallPatch.h"
|
||||
#include "nsInstallUninstall.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
#include "nsWinReg.h"
|
||||
#endif
|
||||
|
||||
#ifdef XP_PC
|
||||
#define FILESEP "\\"
|
||||
#elif defined(XP_MAC)
|
||||
@@ -260,6 +264,30 @@ nsInstall::SetScriptObject(void *aScriptObject)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInstall::SaveWinRegPrototype(void *aScriptObject)
|
||||
{
|
||||
mWinRegObject = (JSObject*) aScriptObject;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInstall::SaveWinProfilePrototype(void *aScriptObject)
|
||||
{
|
||||
mWinProfileObject = (JSObject*) aScriptObject;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
nsInstall::RetrieveWinRegPrototype()
|
||||
{
|
||||
return mWinRegObject;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
nsInstall::RetrieveWinProfilePrototype()
|
||||
{
|
||||
return mWinProfileObject;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstall::GetUserPackageName(nsString& aUserPackageName)
|
||||
{
|
||||
@@ -2313,12 +2341,33 @@ nsInstall::GetLastError(PRInt32* aReturn)
|
||||
PRInt32
|
||||
nsInstall::GetWinProfile(const nsString& aFolder, const nsString& aFile, PRInt32* aReturn)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
#endif /* XP_WIN */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
nsInstall::GetWinRegistry(PRInt32* aReturn)
|
||||
nsInstall::GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aReturn)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
JSObject* winRegObject;
|
||||
nsWinReg* nativeWinRegObject = new nsWinReg(this);
|
||||
JSObject* winRegPrototype = this->RetrieveWinRegPrototype();
|
||||
|
||||
winRegObject = JS_NewObject(jscontext, WinRegClass, winRegPrototype, NULL);
|
||||
if(winRegObject == NULL)
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
JS_SetPrivate(jscontext, winRegObject, nativeWinRegObject);
|
||||
|
||||
*aReturn = OBJECT_TO_JSVAL(winRegObject);
|
||||
#else
|
||||
*aReturn = JSVAL_NULL;
|
||||
#endif /* XP_WIN */
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user