安装后打开应用程序不能安装“每个人”

时间:2017-04-07 09:59:40

标签: c# setup-project

我正在使用安装项目,我已经创建了一个安装程序类:

GET /es-main/Project,ProjectStage,Task,TaskComment,TicketComment,Client,User,Attachment/_search 
Array
(
    [query] => Array
        (
            [query_string] => Array
                (
                    [query] => *a*
                    [analyzer] => hunspell_cs
                    [fields] => Array
                        (
                            [0] => name
                            [1] => description
                            [2] => tags.name
                            [3] => text
                            [4] => email
                            [5] => filename
                        )

                )

        )
    [from] => 0
    [size] => 10
    [sort] => Array
        (
            [_type] => ASC
            [_score] => DESC
        )

    [aggs] => Array
        (
            [CountByType] => Array
                (
                    [terms] => Array
                        (
                            [field] => _type
                        )

                )

        )

)

我正在将提交自定义操作的CustomActionData设置为:

using System;
using System.ComponentModel;
using System.Runtime.Remoting.Contexts;

namespace Client.Common
{
    [RunInstaller(true)]
    public class Installer : System.Configuration.Install.Installer
    {
        public Installer()
        {

        }

        public override void Commit(System.Collections.IDictionary savedState)
        {
            try
            {
                base.Commit(savedState);



                System.Diagnostics.Process.Start(Context.Parameters["TARGETDIR"] + "Client.UI.exe");

                base.Dispose();
            }
            catch (Exception ex)
            {

            }
        }
    }
}

当我运行MSI为“Just Me”安装时,它工作正常,它打开了exe,但是当我安装“Everyone”时,它不会运行exe。

我是否遗漏了一些东西,以便为“每个人”发生这种情况?

1 个答案:

答案 0 :(得分:0)

当您将其安装为Just me时,自定义操作将使用安装用户的凭据运行,该用户是当前交互式登录用户,因此就像从资源管理器或快捷方式运行应用程序一样。 / p>

在Everyone安装中运行自定义操作时,它将使用本地系统帐户的凭据运行。这可能导致任何数量的潜在问题或崩溃。例如,出于安全原因,不允许系统帐户向交互式用户的桌面显示UI;如果您尝试访问用户个人资料位置(桌面,用户的数据文件夹等),您可能会崩溃,因为系统帐户没有这些;系统帐户没有网络权限,因此使用网络将导致问题。如果不确切知道您的代码尝试做什么,那么就无法说出哪些可能是问题。