Open readme.txt at end of installatin failed in WiX

夙愿已清 提交于 2019-12-10 18:31:15

问题


We would like to open a notepad file at end of the installation. Hence I copied a readme.txt and placed under some local drive during installation then tried to open from that location. But, it is giving "The system cannot find the path specified" issue. However, it was working when I gave the local hard coded path as like "d:\readme.txt".

<Directory Id='ProgramFilesFolder' Name='PFiles'>
   <Directory Id='INSTALLDIR' Name='SimpleMvvmToolkit_2012'>          
   </Directory>
</Directory>


<Property Id='NOTEPAD'>Notepad.exe</Property>
<CustomAction Id='LaunchFile' Property='NOTEPAD' ExeCommand='[INSTALLDIR]Readme.txt'
              Return='asyncNoWait' />

<InstallExecuteSequence>
   <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

Somewhere I did mistake but I couldn't find out exactly.


回答1:


There is a topic in the WiX SDK called How To: Run the Installed Application After Setup that could be used to launch the readme.txt if you just wanted to do that.

If you really don't want that user experience, I would recommend using the WixShellExec custom action to launch the readme.txt instead of trying to launch Notepad.exe. That way the readme.txt will open in the user's default .txt editor. You can do that by:

<Property Id="WixShellExecTarget" Value="[#FileIdForReadMe.txt]" />
<CustomAction Id="LaunchFile" 
    BinaryKey="WixCA" 
    DllEntry="WixShellExec"
    Impersonate="yes" />

<InstallExecuteSequence>
   <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>


来源:https://stackoverflow.com/questions/16205360/open-readme-txt-at-end-of-installatin-failed-in-wix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!