在VS2012中创建的exe使用InstallShield无效

时间:2016-12-06 12:37:17

标签: c# visual-studio-2012 installshield


我这样做了100次,但这次它不起作用。我使用InstallShield限量版项目构建了安装程序,我在我的PC上安装了msi它运行正常。但是当我在客户端PC上安装它时,它会生成一个快捷方式图标,当我点击打开它似乎它试图打开但它没有。我禁用了防病毒,防火墙,但没有用。 这也是一台新PC,我正在尝试创建一个新的WINFORM。所以安装了flexera installSheild。

我根据@rabban查看了EventViewer的日志。它给.NET Runtime带来了错误 和日志说:

Application: Banquet.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at Banquet.CustDetails.InitializeComponent()
at Banquet.CustDetails..ctor()
at Banquet.Program.Main()

另外一个错误来源:应用程序错误和日志:

Faulting application name: Banquet.exe, version: 1.0.0.0, time stamp: 0x5846b76f
Faulting module name: KERNELBASE.dll, version: 6.2.9200.17366, time stamp: 0x554d16f6
Exception code: 0xe0434352 
Fault offset: 0x00010192
Faulting process id: 0x10a8
Faulting application start time: 0x01d25048c6a7898f
Faulting application path: C:\Program Files (x86)\KAEM\My Product Name\Banquet.exe
Faulting module path: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
Report Id: 048f9002-bc3c-11e6-be95-10604b723b92
Faulting package full name: 
Faulting package-relative application ID: 

1 个答案:

答案 0 :(得分:0)

您似乎尝试访问那些不存在的内容。在program.cs中放置一个try / catch来初始化表单,并在文本文件中编写带有所有内部异常和堆栈跟踪的异常,然后你知道缺少什么。

static class Program
{
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        try
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
        catch (Exception exception)
        {
            // the file will be written in your execution path.
            string path = "error.txt";

            // if you don't have the rights to write in the execution path, uncomment this line and comment the other path line.
            // the file will then be located at: C:\Users\YourUserName\AppData\Local\error.txt
            //string path = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\error.txt";
            if (File.Exists(path))
                File.Delete(path);

            var sb = new StringBuilder();
            while (exception != null)
            {
                sb.AppendLine(exception.ToString());
                sb.AppendLine(exception.Message);
                sb.AppendLine();

                exception = exception.InnerException;
            }

            File.WriteAllText(path, sb.ToString());

            throw;
        }
    }
}