文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>给Windows Installer添加Custom Action

给Windows Installer添加Custom Action

时间:2010-10-08  来源:lbsx

Windows Installer的Custom Action可以是exe, dll, vbs或js文件。

通过这个Custom Action,只要有足够的权限,基本上想做什么就做什么。

用C++编写Custom Action的例子(省略建各种工程的步骤):

1.C++代码。其中可以通过MsiDoAction调用一些别的Action。目前并没有了解。

 1 #include <windows.h>
 2 #include <Msiquery.h>
 3 #include <stdio.h>
 4 #pragma comment(lib, "msi.lib")
 5 
 6 int main(int argc, char *argv[])
 7 {
 8     printf("This is a custom action");
 9     getchar();
10     //MsiDoAction();
11     return ERROR_SUCCESS;
12 }
13 

2.在布置项目的File System View中新建一个文件夹,并将此exe添加到该文件夹中。

3.在Custom Actions View中添加Custom Action,选择该exe。

也可以将这多个项目集中到一个解决方案中,通过添加项目的Primary Output来进行添加。

参考:

Visual Studio Setup - projects and custom actions 

Walkthrough: Creating a Custom Action
Custom Actions

相关阅读 更多 +
排行榜 更多 +
无限Fps

无限Fps

飞行射击 下载
幸存者时间僵尸

幸存者时间僵尸

飞行射击 下载
金属兄弟Metal Brother

金属兄弟Metal Brother

冒险解谜 下载