Custom Action - Error 1001: Could not find file myApp.InstallState

后端 未结 8 731
南笙
南笙 2021-02-01 15:22

I have tried to create a custom action for a Visual Studio Installer project to modify the permissions for a config file.

The Installer.cs is as follows:



        
相关标签:
8条回答
  • 2021-02-01 16:15

    create your post install executable as you would a console app ex: "mypostinstallapp.exe".

    install the "mypostinstallapp.exe" with your msi product. maybe put it with the Application Folder or a shared folder if you want to use it with multiple installs.

    in the custom actions (rightclick the msi project and view custom actions) and add an action in the Commit section. assuming you want it to run towards the end.

    then select your "mypostinstallapp.exe" from the actions view and in its properties set InstallerClass False.

    what I do in "mypostinstallapp.exe" is look for a cmd file and run it as a process.

    so i can add stuff to the cmd file and try to forget about the custom action process.

    0 讨论(0)
  • 2021-02-01 16:16

    I had this problem when I didn't specify a custom action in my installer project for all four overrides (Install, Uninstall, Commit, and Rollback). As soon as I specified my project output as the custom action for all four, the issue went away.

    The only overrides in my installer class that did anything were Commit and Uninstall; I think that Install was in charge of creating the InstallState file in the first place, and since it was never called the InstallState file was never created.

    0 讨论(0)
提交回复
热议问题