About Custom Actions RRS feed

  • Question

  • Hi,
    I have two questions about the Custom Actions.
    My sutiation is that ,i packed my resource to
    setup project(especially three files:Install.bat &Uninstall.bat &DoAction.exe
    Install.bat is to do some my-defined actions,
    Uninstall.bat is to do some reverse my-defined actions,
    DoAction.exe is to call the Install.bat(when do the insatll),while call the Uninstall.bat(when do the uninstall) 
    I added the DoAction.exe to both the "Install" node & "uninstall" node under the "Custom Actions" node,
    (surely it depends on different Arguments to call the install.bat or uninstall.bat)

    When i do the install,it seems that everything is okay,it first install all source files to the [TargetDir],then
    call the install.bat to do other custom actions(but it seems that there is two Process,one is for installer,
    another is for the Custom actions,and the phenomena is,when the install.bat is running,the Installer main
    process shows the " Install Successfully" state. actually,the effect what i want to show is ,the Installer Process
    waits untill the custom actions is finished.
    My call function is as follows: INSTANCE mhandle=ShellExecute(NULL,L"open",L"install.bat",NULL,Direcotry,SW_SHOWNORMAL);
    I know maybe i should pass the Main installer process handle to the ShellExecute,so that the new process are attached to the Install
    Process,but how can do that?

    Second question: When i do the uninstall,It seems that first call the Uninstall.bat,shows the command line window,
    but when the uninstall.bat is still running, the uninstall.bat files has been removed,so........ the window disappear immediately...

    Note:if i make a copy of uninstall.bat,uninstall_copy.bat,and call the uninstall_copy.bat,not the uninstall.bat
    it works file ,because the uninstall_copy.bat wouldn't be removed during the Uninstall. 

    So i think i should put my custom actions that call the uninstall.bat ahead,but what's the steps to make it via Orca?

    Best Regards

    Love is all~
    Tuesday, December 16, 2008 8:18 AM

All replies

  • I don't this is the install - I think the behavior of ShellExcute is that it launches the process and then immediately returns. It does not wait for the process to finish. You might be better off using CreaeProcess and waiting for the process to finish.

    Phil Wilson
    Tuesday, December 16, 2008 8:03 PM
  • Hi,Phil
    Thx for your info
    You are right,that's the problem of ShellExcute,which return the values immediately,caused the installfiles be removed
    before the custom actions finished.

    But i also want to know if i want to put my custom actions ahead of standard actions,e.g. Welcome Dialogue,
    How can i modify the msi with Orca?

    What's the steps for that? any doc or info for me?

    Best Regards
    Love is all~
    Thursday, December 18, 2008 2:44 AM