Hi,
My AI version is 6.6. I met a problem that I can’t move DoAction Event up.
Do you have any method to move DoAction Event up?
(The first two events EndDialog and SpawnDialog can’t be moved down neither.)
Code: Select all
EndDialog Return OutOfDiskSpace <> 1 AND (PROCESS <> "RUNNING")
Sorry, I can't quite agree with you. I have done a test. I added two UI Custon Action:DetectAIRunningOrNot & ShowMsgIfRunning.cosmin wrote:Hi,
Please note that the DoAction control event doesn't necessarily have to be the first control event in the list. Even if it is the third control event, it will still be executed before the "EndDialog" control events which continue the installation. Therefore, you can leave the DoAction control event where it is now.
To make sure that the installation will not continue if the process if running, you can use the property set in the custom action in the conditions of the rest of control events. For example:Regards,Code: Select all
EndDialog Return OutOfDiskSpace <> 1 AND (PROCESS <> "RUNNING")
Cosmin
Code: Select all
Dim objWMIService, objProcess, colProcess
Dim strComputer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process")
Session.Property("PROCESS")="NOT RUNNING"
For Each objProcess in colProcess
if objProcess.Name = "AdvancedInstaller.exe" then
Session.Property("PROCESS")="RUNNING"
End If
Next
Code: Select all
MsgBox Session.Property("PROCESS")
Please note that the condition you added to the first control event should be added to the rest of the predefined control events. I gave only the first control as an example so you can see how to set the condition. Please add the (PROCESS <> "RUNNING") condition to the rest of predefined control events and let me know if the installation still continues.when I click the button on the message box, the installation continues even if the process is running.
Yes, it is. However, the NewDialog (EndDialog) and SpawnDialog control events are treated a bit differently. The ControlEvent Table article in the MSDN states:I think first we should make an agreement that the execution sequence is related with the list sequence.
I moved the DoAction control events before the EndDialog ones (I edited the AIP) and I attached the project to this post. This should fix all the problems related to the execution order.The only way is moving the Detect Evevt before EndDialog Event.
First I changed the default conditions of the predefined control events so they can be added in the AIP file (otherwise they were retrieved from a resource file). After that, I opened the AIP with a text editor and in the "caphyon.advinst.msicomp.MsiControlEventComponent" component I modified the Ordering attributes of the control events. If the ordering is correct and two control events do not have the same order, the project will be modified successfully.how do you make it?
The largest value means the highest order number. For example, the last event in the list has the highest order number (the first event has the lowest one).And I can't quite understand what means the largest value.