1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
using System.Diagnostics;
using System.IO;
using DreamShield.Deployment.Assistants.DreamWizard;
using DreamShield.Deployment.Installers.DreamPlugins;
using DreamShield.Deployment.Installers.DreamWorker;
using DreamShield.Deployment.Miles;
using DreamShield.Deployment.Miles.Events;
using DreamShield.Extentions;
namespace RunTest
{
/// <summary>
/// Description of UserPlugin.
/// </summary>
[Extention(BaseDreamPluginContainer.DreamPluginExtentionGuid,
"{F445EB9A-92F8-43fe-9EE6-A12DB9D383DD}")
/* Le guid précédent doit être unique. Plusieurs outils existent pour créer des GUIDs uniques ...
* Il servira à l'installeur afin d'identifier de manière unique votre plugin */
]
public class Class1 : MilesRoot
{
protected override void OnServerInitialized()
{
base.OnServerInitialized();
EventsProvider_StdWizard wizardEvents = new EventsProvider_StdWizard(Server);
{
wizardEvents.WizardWorkerExecute_EndEvent += new EventsProvider_StdWizard.WizardWorker_Event(wizardEvents_WizardWorkerExecute_EndEvent);
}
Server.RegisterPlugin(wizardEvents);
}
void wizardEvents_WizardWorkerExecute_EndEvent(DreamWizardEngine engine, WorkerActionId actionId)
{
if (actionId == WorkerActionId.Install || actionId == WorkerActionId.Update)
{
if (engine.Installed)
{
/* on exécute TARGETDIR/MoMa/MoMa.exe */
Process.Start(engine.InstallerProvider.TargetDir +
Path.DirectorySeparatorChar +
"MoMa" +
Path.DirectorySeparatorChar +
"MoMa.exe");
}
}
}
}
} |
Partager