示例#1
0
void InstallStrategy(char *alias,char *classes)

{ struct Strategy *ptr;
  char ebuff[CF_EXPANDSIZE];
 
 Debug1("InstallStrategy(%s,%s)\n",alias,classes);
 
 if (! IsInstallable(classes))
    {
    Debug1("Not installing Strategy no match\n");
    return;
    }
 
 ExpandVarstring(alias,ebuff,"");
 
 if ((ptr = (struct Strategy *)malloc(sizeof(struct Strategy))) == NULL)
    {
    FatalError("Memory Allocation failed for InstallStrategy() #1");
    }
 
 if ((ptr->name = strdup(ebuff)) == NULL)
    {
    FatalError("Memory Allocation failed in InstallStrategy");
    }

 ExpandVarstring(classes,ebuff,"");

 if ((ptr->classes = strdup(ebuff)) == NULL)
    {
    FatalError("Memory Allocation failed in InstallStrategy");
    }
 
 if (VSTRATEGYLISTTOP == NULL)                 /* First element in the list */
    {
    VSTRATEGYLIST = ptr;
    }
 else
    {
    VSTRATEGYLISTTOP->next = ptr;
    }
 
 ptr->next = NULL;
 ptr->type = 'r';
 ptr->done = 'n';
 ptr->strategies = NULL;

 VSTRATEGYLISTTOP = ptr;
}
示例#2
0
bool
Application::InstallWithError (MoonError *error, bool user_initiated, bool unattended)
{
	MoonInstallerService *installer = Runtime::GetInstallerService ();
	Deployment *deployment = Deployment::GetCurrent ();

	// application manifest must allow out-of-browser support
	OutOfBrowserSettings *settings = deployment->GetOutOfBrowserSettings ();
	if (!settings) {
		// FIXME - this fix a crasher but is not complete wrt MSDN
		return false;
	}

	if (!IsInstallable ()) {
		MoonError::FillIn (error, MoonError::INVALID_OPERATION, "Applications may only be installed from http, https or file URLs");
		return false;
	}
	
	if (GetInstallState () == InstallStateInstalled || IsRunningOutOfBrowser ()) {
		MoonError::FillIn (error, MoonError::INVALID_OPERATION, "Application is already installed");
		return false;
	}

	// the dialog is displayed only if the action leading to this call was initiated directly from the user
	if (!unattended && !user_initiated && !deployment->GetSurface ()->IsUserInitiatedEvent ())
		return false;
	
	SetInstallState (InstallStateInstalling);
	
	if (installer->Install (deployment, unattended)) {
		SetInstallState (InstallStateInstalled);
		return true;
	}
	
	SetInstallState (InstallStateInstallFailed);
	
	return false;
}
示例#3
0
VOID
UndoPublicDevmodeOptions(
    PUIDATA pUiData
    )

/*++

Routine Description:

    Ignore printer feature selections which correspond to public devmode fields.
    Also get rid of selections for installable printer features.

Arguments:

    pUiData - Points to our UIDATA structure

Return Value:

    NONE

--*/

{
    PMPD        pmpd = pUiData->pmpd;
    PBYTE       pOptions = pUiData->devmode.dmPrivate.options;
    PFEATURE    pFeature;
    DWORD       index;

    for (index=0; index < pmpd->cFeatures; index++) {

        pFeature = FindIndexedFeature(pmpd, index);

        if (IsInstallable(pFeature) || PublicFeatureIndex(pFeature->groupId))
            pOptions[index] = SELIDX_ANY;
    }
}