开发者

Visual studio 2010 setup project [ProductName]

开发者 https://www.devze.com 2023-04-05 21:04 出处:网络
C#, Visual studio 2010 I have an application project and a Setup project connected to the application.

C#, Visual studio 2010

I have an application project and a Setup project connected to the application. In the Setup projects property I have setthe ProductName property to MyApp.

I have two links (Setup project) in the applications folder, one for starting the project and one for uninstalling

I am using the technique of creating a uninstaller link in the applications folder by starting my application with a flag and the applications Product code like this --uninstall [ProductCode]

  1. I can not use [ProductName] as the name of the link to start the application, why is that? If I do, the Setup project will create a link in the application folder under the start menu with the name [ProductName] instead of "MyApp".

  2. How do I localize the "remove link", today I name the uninstaller link to "Remove MyApp"? I was hoping that is was possible to do something like this "strings.Remove [P开发者_开发知识库roductName]"

  3. Is it possible to connect the Setup project with my MyApp project in such way that the Setup project gets the application name, version number etc. from the MyApp project instead. Like this Setup property ProjectName = MyApp.properties.Application.AssemblyName

/Stefan


I see ,thanks for your answear

Why aren't you using msiexec.exe command line

I am using the msiexec, I am invoking it in my application App class like this

            sComLine = CommandLine.CL.get("uninstall"); // Check command line if the --uninstall [ProductCode] is given
            if (sComLine != null)
            {
                string path = Environment.GetFolderPath(Environment.SpecialFolder.System);
                System.Diagnostics.ProcessStartInfo uninstallProcess = new System.Diagnostics.ProcessStartInfo(path + System.IO.Path.DirectorySeparatorChar + "msiexec.exe", "/x " + sComLine);
                System.Diagnostics.Process.Start(uninstallProcess);
                System.Windows.Application.Current.Shutdown();
            }


I am using the technique of creating a uninstaller link in the applications folder by starting my application with a flag and the applications Product code like this --uninstall [ProductCode]

Why aren't you using msiexec.exe command line? Perhaps this thread will help:

In a Visual Studio setup project, How do I generate an uninstall script?

I can not use [ProductName] as the name of the link to start the application, why is that? If I do, the Setup project will create a link in the application folder under the start menu with the name [ProductName] instead of "MyApp".

Shortcuts names do not support installer properties. This is a limitation in Windows Installer. So the name must be a hard-coded value.

How do I localize the "remove link"

This is not supported by Visual Studio. It can be done only in a setup authoring tool which offers localization support.

Is it possible to connect the Setup project with my MyApp project in such way that the Setup project gets the application name, version number etc. from the MyApp project instead.

No, this is not supported by Visual Studio. As a side note, your application version may not always be the same as your package version. It's usually best to keep them separate.

0

精彩评论

暂无评论...
验证码 换一张
取 消