none
Could not find InstallState

    Question

  • I add a custom action to the Commit node of Setup project.
    The custom action is a .dll.
    But when I execute the install project, it result in an error message at the
    end of installation:
    Could not find files 'C:\WinProg\CutomAction.InstallState'

    Where c:\WinProg is the target folder.

     

    How can I do?



     

    Tuesday, March 14, 2006 9:28 PM

All replies

  • I think that in your install method, you need to use the "statesaver" object and save the output.
    Wednesday, March 15, 2006 6:01 AM
    Moderator
  • Thank,

    I am a hand about setup project.

    Could you give me an example?

     

     David Guyer MS wrote:
    I think that in your install method, you need to use the "statesaver" object and save the output.

    Wednesday, March 15, 2006 8:37 PM
  • Thursday, March 16, 2006 4:58 AM
    Moderator
  • Thanks,

    I have read the article, but I still can't figure out how to use the "statesaver" object and save the output.
     

    Thursday, March 16, 2006 6:41 AM
  • Did you make the call to MyBase.Install(stateSaver) ?

     

    Have you hooked up the Install custom action to the Install node in the custom actions editor?

     

    Friday, March 17, 2006 6:27 AM
    Moderator
  •  David Guyer MS wrote:

    Did you make the call to MyBase.Install(stateSaver) ?

     Have you hooked up the Install custom action to the Install node in the custom actions editor?

     

     

    Yes, I have done the two steps you mentioned above.

    Sunday, March 19, 2006 6:45 AM
  • Were you able to fix this problem? I am facing the same thing and need help
    Thursday, June 15, 2006 7:15 PM
  • Not Yet
    Friday, June 16, 2006 2:38 AM
  • Have you also added the custom action (project output) to the Commit, Rollback, and Uninstall nodes?

    If you have, please describe or paste your custom action code... we'll see what it looks like.

     

    Friday, June 16, 2006 4:41 AM
    Moderator
  • Check this

    http://dotnetjunkies.com/WebLog/saarc/comments/23340.aspx

    I had the same problem (Custom Action in Commit) and it helped.

    Google rulez =)

    Tuesday, June 27, 2006 12:27 PM
  • All you need to do, set the "InstallerClass" property of your custom application to false.

    Friday, June 15, 2007 5:30 PM
  • When i set the "InstallerClass" property to false, then rebuild, it gave me this error

    Error 1 Unspecified module entry point for custom action '....\customaction.dll'. ...

    Friday, June 22, 2007 5:25 PM
  • You need InstallerClass true if it really is a Installer class call, not a vbscript or C++ Dll call (which is why you get that error message trying to locate an entry point).

    So assuming you have an Installer class custom action call, your missing installstate file is probably because you have a missing custom action. The installstate file holds state from install to commit, so I believe the install custom action creates it. If you haven't got an install custom action that's probably the issue. You don't need to write code, just let the base Install method get called.  I think you might also see this in situations where the user isn't privileged and doesn't have access to the directory containing the file.

    Friday, June 22, 2007 5:52 PM
    Moderator
  • In case if some one is still looking for the answer to this let me post what I found out. I was also getting the error "Could not find file xyz.installstate".

     

    To avoid this problem try to attach the same custom action to "Install" that you have attached to "commit". Unfortunately I do not know why that works but when I carefully looked at the walkthroughs it looks like that is what is suggested to be done.

     

    Once I attached the same custom action to "Install" that I had done to "Commit" my problem was solved.

     

    Hope this helps.

     

    --Aalok.

     

    • Proposed as answer by zhackwyatt Wednesday, April 21, 2010 9:48 PM
    Sunday, August 05, 2007 5:24 PM
  • Hi,

    Yes, adding Custom Action to the both Install and Commit nodes of Custom Actions Editor will solve this problom.

    Just one note !!!, pay attention, your Action should Override Commit Method if you want to run your custom action in Commit, then adding this Custom Action to the Install node will have no effect!

     

     be relax

     

     

    Wednesday, October 24, 2007 10:05 AM
  • Thanks Aalok.  I had the same experience as you and putting my custom action in both the Install and Commit resolved it.

    Maybe the moderator of this forum has something to say about why this magically fixes the problem.
    Friday, February 29, 2008 8:59 PM
  • There's no magic. The installstate file is what (as the name implies) carries state through the stages of the execution, install, rollback, commit, uninstall. It's the base.Install () method that creates it. It's just a case of understanding that what you should really do ALL THE TIME is add your installer class custom actions to all the custom action types, even if you don't need to override any of the methods.

     

    Friday, February 29, 2008 9:21 PM
    Moderator
  • Well not magic perhaps but it seems non-inuitive to do it this way at the very least.
    Friday, February 29, 2008 9:34 PM
  • I want the custom action to be the running of the application just installed. However, when I do this as described here, the setup program does not exit until the application is unloaded. How do I tell the setup to not wait for the custom action to complete? I thought maybe the InstallerClass property might regulate this, but it appears to have no impact on this issue at all.

    Tuesday, March 18, 2008 2:41 PM
  •  

    thank U very much U R the MAN
    Thursday, April 10, 2008 1:55 AM
  • I had the same problem.

     

    But my problem, at least apparently, was because I named my custom installer class Install. The same as the name of the method Installer.Install().

     

    So, collaterally, I couldn't even override the Install method. Not to say that none of my custom actions woulnd't get executed.

     

    Once I renamed my custom Installer class to InstallApp, all worked fine, but I needed about an hour or so to figure it out.

     

    Hope this helps someone, sometime...

    Wednesday, July 23, 2008 6:48 AM
  • Well I had same problem and the solution is quite simple.
    If you follow the walktrough on web page :

    http://msdn.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

    everything will pass smooth. In first pass I also got same message but
    when I look walktrough very carefully  I noticed attribute on Commit method
    and I probably didn't saw first time because VB syntax.

    Import namespace
    using System.Security.Permissions;

    and put this attribute on Commit method
    [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]

    Also in Custom Action editor when you add primary output in Commit node, just do same in Install node,

    Cheers !

    Wednesday, September 24, 2008 9:20 AM
  • Try opening custom actions, viewing the properties of your custom action and changing the "InstallerClass" from "True" to "False".

    Fixed it for me.
    Monday, October 20, 2008 5:11 PM
  • I know the thread is old but I still got snagged on this one.

    The Install Custom action appears to create the InstallState file while the Commit action reads the file. If you don't setup and call the Install Custom action, you will never get past the Commit if it is also calling the same CustomInstaller.

    Even after adding the attribute below on the Commit method, I was still getting rolled back with the failure. [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]

    Bottom line.... Make sure you call the CustomerInstaller in the Install custom actions and last but not least, in the overridden Install & Commit methods you need to call the base class.

     

    • Proposed as answer by ebarben Tuesday, April 27, 2010 8:19 PM
    Tuesday, April 27, 2010 8:10 PM
  • I had this problem as well. I tried everything listed in this thread but failed. The problem occurred when I tried to pass the selected install path to my installer class. To do this I set the CustomActionData of my Commit Custom Action to /DIR=[TARGETDIR]. This introduced the issue. To fix this I had to

    a) Change the value of my CustomActionData property to /DIR="[TARGETDIR]\" (Seems there is some kind of problem with property values which end in \)

    b) Set the CustomActionData property at ALL stages of the setupprocess, that is Install, Commit, Rollback and Uninstall

     

    This solved the problem for me. It was annoying and I hope this helps someone else!

    • Edited by Daniel Kling Tuesday, September 28, 2010 1:47 PM Lost a "-thingy...
    Tuesday, September 28, 2010 1:46 PM