talal
asked on
Outlook Add On
I am working on an outlook add on.
When i completed it;
It works fine in the developmenet environment but when i run the installer in an end user environment it does not even load.
Any ideas?
I would even consider contracting someone to finish it off if it will not cost me lots.
It is very furstrating and I need this to work asap.
Any feed back is highly appreciated.
When i completed it;
It works fine in the developmenet environment but when i run the installer in an end user environment it does not even load.
Any ideas?
I would even consider contracting someone to finish it off if it will not cost me lots.
It is very furstrating and I need this to work asap.
Any feed back is highly appreciated.
ASKER
Hello Clever;
Sowwi for the late response but i wanted to give some time for others to response. But unfortunately no one else replied.
I have narrowed it down to the security settings of .net 2.0 (Code Security Access)
To be quite honest i am new to all this .net 2.0 and this is a big frustration to me.
How can i do it right?
What is the proper was to make the installer that adds the security access policies?
I found the following online and i added it to my project. But i may have done something wrong or missed something:
any help?
//------------------------ ---------- ---------- ---------- ---------- -------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//------------------------ ---------- ---------- ---------- ---------- -------
using System;
using System.Collections.Generic ;
using System.ComponentModel;
using System.Configuration.Insta ll;
using System.Diagnostics;
using System.IO;
namespace CustomActions
{
[RunInstaller(true)]
[System.Security.Permissio ns.Permiss ionSetAttr ibute(Syst em.Securit y.Permissi ons.Securi tyAction.D emand, Name = "FullTrust")]
public sealed partial class SetSecurity : Installer
{
public SetSecurity()
{
InitializeComponent();
}
public override void Install(System.Collections .IDictiona ry stateSaver)
{
// Call the base implementation.
base.Install(stateSaver);
string allUsersString = this.Context.Parameters["a llUsers"];
string solutionCodeGroupName = this.Context.Parameters["s olutionCod eGroupName "];
string solutionCodeGroupDescripti on = this.Context.Parameters["s olutionCod eGroupDesc ription"];
string targetDir = this.Context.Parameters["t argetDir"] ;
string assemblyName = this.Context.Parameters["a ssemblyNam e"];
string assemblyCodeGroupName = this.Context.Parameters["a ssemblyCod eGroupName "];
string assemblyCodeGroupDescripti on = this.Context.Parameters["a ssemblyCod eGroupDesc ription"];
// Note that a code group with solutionCodeGroupName name is created in the
// Install method and removed in the Rollback and Uninstall methods.
// The solutionCodeGroupName must be a unique name to ensure that the
// correct code group is removed during Rollback and Uninstall.
if (String.IsNullOrEmpty(solu tionCodeGr oupName))
throw new InstallException("Cannot set the security policy. The specified solution code group name is not valid.");
if (String.IsNullOrEmpty(solu tionCodeGr oupDescrip tion))
throw new InstallException("Cannot set the security policy. The specified solution code group description is not valid.");
if (String.IsNullOrEmpty(targ etDir))
throw new InstallException("Cannot set the security policy. The specified target directory is not valid.");
if (String.IsNullOrEmpty(asse mblyName))
throw new InstallException("Cannot set the security policy. The specified assembly name is not valid.");
if (String.IsNullOrEmpty(asse mblyCodeGr oupName))
throw new InstallException("Cannot set the security policy. The specified assembly code group name is not valid.");
if (String.IsNullOrEmpty(asse mblyCodeGr oupDescrip tion))
throw new InstallException("Cannot set the security policy. The specified assembly code group description is not valid.");
if (stateSaver == null)
throw new ArgumentNullException("sta teSaver");
try
{
bool allUsers = String.Equals(allUsersStri ng, "1");
string assemblyPath = Path.Combine(targetDir, assemblyName);
// Note that Install method may be invoked during Repair mode and the code group
// may already exist.
// To prevent adding of another code group, remove the code group if it exists.
try
{
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
CaspolSecurityPolicyCreato r.RemoveSe curityPoli cy(allUser s, solutionCodeGroupName);
}
catch {}
CaspolSecurityPolicyCreato r.AddSecur ityPolicy(
allUsers,
solutionCodeGroupName,
solutionCodeGroupDescripti on,
assemblyPath,
assemblyCodeGroupName,
assemblyCodeGroupDescripti on);
stateSaver.Add("allUsers", allUsers);
}
catch (Exception ex)
{
throw new InstallException("Cannot set the security policy.", ex);
}
}
public override void Rollback(System.Collection s.IDiction ary savedState)
{
// Call the base implementation.
base.Rollback(savedState);
// Check whether the "allUsers" property is saved.
// If it is not set, the Install method did not set the security policy.
if ((savedState == null) || (savedState["allUsers"] == null))
return;
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
string solutionCodeGroupName = this.Context.Parameters["s olutionCod eGroupName "];
if (String.IsNullOrEmpty(solu tionCodeGr oupName))
throw new InstallException("Cannot remove the security policy. The specified solution code group name is not valid.");
try
{
bool allUsers = (bool) savedState["allUsers"];
CaspolSecurityPolicyCreato r.RemoveSe curityPoli cy(allUser s, solutionCodeGroupName);
}
catch (Exception ex)
{
throw new InstallException("Cannot remove the security policy.", ex);
}
}
public override void Uninstall(System.Collectio ns.IDictio nary savedState)
{
// Call the base implementation.
base.Uninstall(savedState) ;
// Check whether the "allUsers" property is saved.
// If it is not set, the Install method did not set the security policy.
if ((savedState == null) || (savedState["allUsers"] == null))
return;
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
string solutionCodeGroupName = this.Context.Parameters["s olutionCod eGroupName "];
if (String.IsNullOrEmpty(solu tionCodeGr oupName))
throw new InstallException("Cannot remove the security policy. The specified solution code group name is not valid.");
try
{
bool allUsers = (bool)savedState["allUsers "];
CaspolSecurityPolicyCreato r.RemoveSe curityPoli cy(allUser s, solutionCodeGroupName);
}
catch (Exception ex)
{
// Note that throwing an exception might stop the uninstall process.
// To inform the user and stop the uninstall process, throw an exception.
// To continue the uninstall, do not throw the exception.
throw new InstallException("Cannot remove the security policy.", ex);
}
}
}
}
Sowwi for the late response but i wanted to give some time for others to response. But unfortunately no one else replied.
I have narrowed it down to the security settings of .net 2.0 (Code Security Access)
To be quite honest i am new to all this .net 2.0 and this is a big frustration to me.
How can i do it right?
What is the proper was to make the installer that adds the security access policies?
I found the following online and i added it to my project. But i may have done something wrong or missed something:
any help?
//------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//------------------------
using System;
using System.Collections.Generic
using System.ComponentModel;
using System.Configuration.Insta
using System.Diagnostics;
using System.IO;
namespace CustomActions
{
[RunInstaller(true)]
[System.Security.Permissio
public sealed partial class SetSecurity : Installer
{
public SetSecurity()
{
InitializeComponent();
}
public override void Install(System.Collections
{
// Call the base implementation.
base.Install(stateSaver);
string allUsersString = this.Context.Parameters["a
string solutionCodeGroupName = this.Context.Parameters["s
string solutionCodeGroupDescripti
string targetDir = this.Context.Parameters["t
string assemblyName = this.Context.Parameters["a
string assemblyCodeGroupName = this.Context.Parameters["a
string assemblyCodeGroupDescripti
// Note that a code group with solutionCodeGroupName name is created in the
// Install method and removed in the Rollback and Uninstall methods.
// The solutionCodeGroupName must be a unique name to ensure that the
// correct code group is removed during Rollback and Uninstall.
if (String.IsNullOrEmpty(solu
throw new InstallException("Cannot set the security policy. The specified solution code group name is not valid.");
if (String.IsNullOrEmpty(solu
throw new InstallException("Cannot set the security policy. The specified solution code group description is not valid.");
if (String.IsNullOrEmpty(targ
throw new InstallException("Cannot set the security policy. The specified target directory is not valid.");
if (String.IsNullOrEmpty(asse
throw new InstallException("Cannot set the security policy. The specified assembly name is not valid.");
if (String.IsNullOrEmpty(asse
throw new InstallException("Cannot set the security policy. The specified assembly code group name is not valid.");
if (String.IsNullOrEmpty(asse
throw new InstallException("Cannot set the security policy. The specified assembly code group description is not valid.");
if (stateSaver == null)
throw new ArgumentNullException("sta
try
{
bool allUsers = String.Equals(allUsersStri
string assemblyPath = Path.Combine(targetDir, assemblyName);
// Note that Install method may be invoked during Repair mode and the code group
// may already exist.
// To prevent adding of another code group, remove the code group if it exists.
try
{
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
CaspolSecurityPolicyCreato
}
catch {}
CaspolSecurityPolicyCreato
allUsers,
solutionCodeGroupName,
solutionCodeGroupDescripti
assemblyPath,
assemblyCodeGroupName,
assemblyCodeGroupDescripti
stateSaver.Add("allUsers",
}
catch (Exception ex)
{
throw new InstallException("Cannot set the security policy.", ex);
}
}
public override void Rollback(System.Collection
{
// Call the base implementation.
base.Rollback(savedState);
// Check whether the "allUsers" property is saved.
// If it is not set, the Install method did not set the security policy.
if ((savedState == null) || (savedState["allUsers"] == null))
return;
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
string solutionCodeGroupName = this.Context.Parameters["s
if (String.IsNullOrEmpty(solu
throw new InstallException("Cannot remove the security policy. The specified solution code group name is not valid.");
try
{
bool allUsers = (bool) savedState["allUsers"];
CaspolSecurityPolicyCreato
}
catch (Exception ex)
{
throw new InstallException("Cannot remove the security policy.", ex);
}
}
public override void Uninstall(System.Collectio
{
// Call the base implementation.
base.Uninstall(savedState)
// Check whether the "allUsers" property is saved.
// If it is not set, the Install method did not set the security policy.
if ((savedState == null) || (savedState["allUsers"] == null))
return;
// The solutionCodeGroupName must be a unique name; otherwise, the method might delete wrong code group.
string solutionCodeGroupName = this.Context.Parameters["s
if (String.IsNullOrEmpty(solu
throw new InstallException("Cannot remove the security policy. The specified solution code group name is not valid.");
try
{
bool allUsers = (bool)savedState["allUsers
CaspolSecurityPolicyCreato
}
catch (Exception ex)
{
// Note that throwing an exception might stop the uninstall process.
// To inform the user and stop the uninstall process, throw an exception.
// To continue the uninstall, do not throw the exception.
throw new InstallException("Cannot remove the security policy.", ex);
}
}
}
}
ASKER
Ok i will try to make the question more specific.
Could someone help (step by step or VSTO complete sample) on how to install an OUTLOOK Addon and grant trust? (Even manually).
If you can have a simple HELLO WORLD sample and create an installer that would handle this that would be good enough
I am willing to give more points if i could because this has taken longer than i can wait.
Thanks again.
Could someone help (step by step or VSTO complete sample) on how to install an OUTLOOK Addon and grant trust? (Even manually).
If you can have a simple HELLO WORLD sample and create an installer that would handle this that would be good enough
I am willing to give more points if i could because this has taken longer than i can wait.
Thanks again.
ASKER
I have fixed it!.
It was exactly what i suspected. The Security Access policy for .net 2.0
I got a book, learned more about it and tried few stuff and voily!.
I am glad that this is fixed. It was bothering me so much.
Clever_Bob: Thanks for your response. But i was hoping someone would point me to specifics.
I wonder if i can get the points back
:(
It was exactly what i suspected. The Security Access policy for .net 2.0
I got a book, learned more about it and tried few stuff and voily!.
I am glad that this is fixed. It was bothering me so much.
Clever_Bob: Thanks for your response. But i was hoping someone would point me to specifics.
I wonder if i can get the points back
:(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1) The only reason that your version would work in Dev but not in your production environment is that you have some dependancy files that are not in your package - probably an Outlook integration Object. Although, if your App doesn't even load, perhaps you don't have the VB runtime (if you are you writing in VB!)
2) www.rentacoder.com/ - you'll find thousands of reasonably priced coders to complete your project right away.