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

后端 未结 8 976
南笙
南笙 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.

提交回复
热议问题