te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>wix - Launch application after installation does not work Wixv4 - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wix - Launch application after installation does not work Wixv4 - Stack Overflow

programmeradmin3浏览0评论

I am trying to launch my installed app after the installation is completed. I followed what is suggested here: / Only to find that the complete example does not work. It misses the Condition tag and it references a BinaryKey in the custom action that is not valid. On stack I found this How to launch application after installation (WIX toolset v4) but doing it that way does not launch the (WinForm) app either.

I am using WixToolset.Sdk/5.0.2 and the nuget packages version 5.02. My installer works with the WixUI_InstallDir gui and installs the app and the icons as expected. If I fire up the installed app manually it works just fine.

Being new to all of this I am lost on what to do to actually get it to launch after the install is finished.

I am trying to launch my installed app after the installation is completed. I followed what is suggested here: https://docs.firegiant/wix3/howtos/ui_and_localization/run_program_after_install/ Only to find that the complete example does not work. It misses the Condition tag and it references a BinaryKey in the custom action that is not valid. On stack I found this How to launch application after installation (WIX toolset v4) but doing it that way does not launch the (WinForm) app either.

I am using WixToolset.Sdk/5.0.2 and the nuget packages version 5.02. My installer works with the WixUI_InstallDir gui and installs the app and the icons as expected. If I fire up the installed app manually it works just fine.

Being new to all of this I am lost on what to do to actually get it to launch after the install is finished.

Share Improve this question asked Feb 17 at 13:29 RudiBoyRudiBoy 801 silver badge7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

After reading this post Wix - How to run exe files after installation from installed directory?. I noticed what I was doing wrong. Unaware of the significance of the # character, I simply use the SourceFileId. I later found that my code worked fine if I entered the installpath\filename as a string.

This is the working code:

    <UI Id="UI">
        <ui:WixUI Id="WixUI_InstallDir" InstallDirectory="INSTALLFOLDER" />
        <!-- Shows launch application on last screen -->
        <Publish Dialog="ExitDialog"
            Control="Finish"
            Event="DoAction"
            Value="LaunchApplication"
            Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed"/>
        <!-- Set our executable (its ID) as custom action target -->
        <Property Id="WixShellExecTarget" Value="[#SourceFileId]"/>
    </UI>
    <!--Set some properties for the GUI-->
    <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="!(loc.DialogOptionalText)" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.DialogOptionalCheckBoxText)" />
    <!-- Checkbox checked by default -->
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />
    
    <!-- Run custom action -->
    <CustomAction Id="LaunchApplication"
        BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)"
        DllEntry="WixShellExec"
        Impersonate="yes" />

The app fires up fine even if the install path is changed in the dialog.

发布评论

评论列表(0)

  1. 暂无评论