Discussion:
Systemsteuerung.Software: Anwendung hat kein Icon
(zu alt für eine Antwort)
Alberto Luca
2010-01-08 19:25:21 UTC
Permalink
Hallo NewsGroup,

ich habe eine Windows-Application, welche ich mittels ClickOnce
veröffentliche.
Die Software ist unter Systemsteuerung.Software aufgelistet, jedoch mit dem
normalen Standard-Icon.
Meine Anwendung hat jedoch ein individuelles Icon.

Woran kann's liegen, dass unter Systemsteuerung.Software diese Icon nicht
angezeigt wird?

Besten Dank vorab!
Ciao, Alberto
Frank Dzaebel
2010-01-08 20:34:46 UTC
Permalink
Hallo Alberto,
ClickOnce ... Meine Anwendung hat jedoch ein individuelles Icon.
Woran kann's liegen, dass unter Systemsteuerung.Software diese Icon
nicht angezeigt wird?
Weil hier by Design immer das Standard-ClickOnce Icon angezeigt wird.
Es soll hier laut Microsoft keinen Weg in VS 2008 und auch nicht in
VS 2010 geben (wenn ich das richtig verstehe) :

[Default Icon of ClickOnce setup]
http://social.msdn.microsoft.com/Forums/en/officedevelopmentprerelease/thread/48bb7876-5e2d-496d-8322-0d453c305309
___________

Ggf. ist aber folgender Workaround für Dich eine Möglichkeit.
Rufe zum Beispiel: ClickOnceIconAktualisieren() am Anfang der App auf:

/// <summary>
/// Ersetzt das Icon zur Deinstallation in der
/// Systemsteuerung mit dem Applikations-Icon
/// </summary>
static void ClickOnceIconAktualisieren()
{
const string displayIcon = "DisplayIcon";
try
{
if (ApplicationDeployment.IsNetworkDeployed &&
ApplicationDeployment.CurrentDeployment != null &&
ApplicationDeployment.CurrentDeployment.IsFirstRun)
{
string pkToken = PublicKeyToken();
using (RegistryKey keyToken = ProgrammRegistrierungsGruppe(pkToken))
{
string pfadIcon = string.Format("{0},0", Assembly.
GetExecutingAssembly().Location);
if (pfadIcon != keyToken.GetValue(displayIcon) as string)
keyToken.SetValue(displayIcon, pfadIcon);
}
}
}
catch (Exception exp)
{
Trace.Write("Das Icon kann nicht " +
"aktualisiert werden: " + exp.Message);
}
}

private static string PublicKeyToken()
{
ApplicationSecurityInfo asi = new ApplicationSecurityInfo(
AppDomain.CurrentDomain.ActivationContext);
byte[] keyTokenBytes = asi.ApplicationId.PublicKeyToken;
StringBuilder keyToken = new StringBuilder();
for (int i = 0; i < keyTokenBytes.GetLength(0); i++)
keyToken.Append(string.Format("{0:x}", keyTokenBytes[i]));
return keyToken.ToString();
}

private static RegistryKey ProgrammRegistrierungsGruppe(
string PublicKeyToken)
{
const string uninstall = "UninstallString";
string suchKeyToken = "PublicKeyToken=" + PublicKeyToken;
using (RegistryKey schlüssel = Registry.CurrentUser.
OpenSubKey("Software\\Microsoft\\Windows\\" +
"CurrentVersion\\Uninstall", false))
{
if (schlüssel != null)
{
string[] subKeyNamen = schlüssel.GetSubKeyNames();

foreach (string subKeyName in subKeyNamen)
{
RegistryKey appSchlüssel = schlüssel.OpenSubKey(subKeyName, true);
if (appSchlüssel != null)
{
string key = (string)appSchlüssel.GetValue(uninstall);
if (key.Contains(suchKeyToken)) return appSchlüssel;
appSchlüssel.Close();
}
}
}
throw new ApplicationException("Applikation nicht gefunden");
}
}


ciao Frank
--
Dipl.Inf. Frank Dzaebel [MCP/MVP C#]
http://Dzaebel.NET
Alberto Luca
2010-01-09 14:10:05 UTC
Permalink
Hallo Frank,
Post by Frank Dzaebel
ClickOnce ... Meine Anwendung hat jedoch ein individuelles Icon.
Woran kann's liegen, dass unter Systemsteuerung.Software diese Icon nicht
angezeigt wird?
Weil hier by Design immer das Standard-ClickOnce Icon angezeigt wird.
Es soll hier laut Microsoft keinen Weg in VS 2008 und auch nicht in
besten Dank für Deine Antwort.

Wenn das nicht vorgesehen ist, OK.

Ciao, Alberto
unknown
2010-06-11 16:32:32 UTC
Permalink
Hallo,

im Setupprojekt ist unter den Eigenschaften 'AddRemoveProgramsIcon', dort kannst du das Icon f?r den Eintrag zum deinstallieren der Anwendung angeben.

Gru?,
Fazoletti



Alberto Luca wrote:

Hallo Frank,besten Dank f?
09-Jan-10

Hallo Frank

besten Dank f?r Deine Antwort

Wenn das nicht vorgesehen ist, OK

Ciao, Alberto

Previous Posts In This Thread:

On Friday, January 08, 2010 2:25 PM
Alberto Luca wrote:

Systemsteuerung.Software: Anwendung hat kein Icon
Hallo NewsGroup

ich habe eine Windows-Application, welche ich mittels ClickOnc
ver?ffentliche
Die Software ist unter Systemsteuerung.Software aufgelistet, jedoch mit de
normalen Standard-Icon
Meine Anwendung hat jedoch ein individuelles Icon

Woran kann's liegen, dass unter Systemsteuerung.Software diese Icon nich
angezeigt wird

Besten Dank vorab
Ciao, Alberto

On Friday, January 08, 2010 3:34 PM
Frank Dzaebel wrote:

Hallo Alberto,Weil hier by Design immer das Standard-ClickOnce Icon angezeigt
Hallo Alberto

Weil hier by Design immer das Standard-ClickOnce Icon angezeigt wird
Es soll hier laut Microsoft keinen Weg in VS 2008 und auch nicht i
VS 2010 geben (wenn ich das richtig verstehe)

[Default Icon of ClickOnce setup
http://social.msdn.microsoft.com/Forums/en/officedevelopmentprerelease/thread/48bb7876-5e2d-496d-8322-0d453c30530
__________

Ggf. ist aber folgender Workaround f?r Dich eine M?glichkeit
Rufe zum Beispiel: ClickOnceIconAktualisieren() am Anfang der App auf

/// <summary
/// Ersetzt das Icon zur Deinstallation in de
/// Systemsteuerung mit dem Applikations-Ico
/// </summary
static void ClickOnceIconAktualisieren(

const string displayIcon = "DisplayIcon"
tr

if (ApplicationDeployment.IsNetworkDeployed &
ApplicationDeployment.CurrentDeployment != null &
ApplicationDeployment.CurrentDeployment.IsFirstRun

string pkToken = PublicKeyToken()
using (RegistryKey keyToken = ProgrammRegistrierungsGruppe(pkToken)

string pfadIcon = string.Format("{0},0", Assembly
GetExecutingAssembly().Location)
if (pfadIcon != keyToken.GetValue(displayIcon) as string
keyToken.SetValue(displayIcon, pfadIcon)



catch (Exception exp

Trace.Write("Das Icon kann nicht "
"aktualisiert werden: " + exp.Message)



private static string PublicKeyToken(

ApplicationSecurityInfo asi = new ApplicationSecurityInfo
AppDomain.CurrentDomain.ActivationContext)
byte[] keyTokenBytes = asi.ApplicationId.PublicKeyToken
StringBuilder keyToken = new StringBuilder()
for (int i = 0; i < keyTokenBytes.GetLength(0); i++
keyToken.Append(string.Format("{0:x}", keyTokenBytes[i]))
return keyToken.ToString()


private static RegistryKey ProgrammRegistrierungsGruppe
string PublicKeyToken

const string uninstall = "UninstallString"
string suchKeyToken = "PublicKeyToken=" + PublicKeyToken
using (RegistryKey schl?ssel = Registry.CurrentUser
OpenSubKey("Software\\Microsoft\\Windows\\"
"CurrentVersion\\Uninstall", false)

if (schl?ssel != null

string[] subKeyNamen = schl?ssel.GetSubKeyNames()

foreach (string subKeyName in subKeyNamen

RegistryKey appSchl?ssel = schl?ssel.OpenSubKey(subKeyName, true)
if (appSchl?ssel != null

string key = (string)appSchl?ssel.GetValue(uninstall)
if (key.Contains(suchKeyToken)) return appSchl?ssel
appSchl?ssel.Close()



throw new ApplicationException("Applikation nicht gefunden")



ciao Fran
-
Dipl.Inf. Frank Dzaebel [MCP/MVP C#
http://Dzaebel.NET

On Saturday, January 09, 2010 9:10 AM
Alberto Luca wrote:

Hallo Frank,besten Dank f?
Hallo Frank

besten Dank f?r Deine Antwort

Wenn das nicht vorgesehen ist, OK

Ciao, Alberto


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk Orchestration And Web Services.
http://www.eggheadcafe.com/tutorials/aspnet/62ffe57e-2853-4188-b14d-9fcbec171393/biztalk-orchestration-and.aspx
FrankDzaebel
2010-06-11 18:26:52 UTC
Permalink
Hallo,
Post by unknown
im Setupprojekt ist unter den
Eigenschaften 'AddRemoveProgramsIcon' [...]
es geht nicht um ein Setup-Projekt, sondern
um ClickOnce-Bereitstellung.


ciao Frank
--
Dipl.Inf. Frank Dzaebel [MCP/MVP C#]
http://Dzaebel.NET

Loading...