Max Destiny
asked on
Install Problem
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration.Insta ll;
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
object b = new object();
string key = "MP3 PLayer";
string value = @"Video_Player.exe";
Int32 capacity = 10;
IDictionary dict = new System.Collections.Generic .Dictionar y<string, string>(capacity,null);
if (dict.Values.Count < capacity)
{
dict.Add(key, value);
Installer ins = new Installer();
ins.Uninstall(dict);
InstallContext con = new InstallContext(null, null);
con.LogMessage(ins.HelpTex t);
}
if (dict.Values.Count >= capacity)
{
dict.Clear();
}
}
}
}
It says System.ArgumentException wtf?
why is that?
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration.Insta
namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
object b = new object();
string key = "MP3 PLayer";
string value = @"Video_Player.exe";
Int32 capacity = 10;
IDictionary dict = new System.Collections.Generic
if (dict.Values.Count < capacity)
{
dict.Add(key, value);
Installer ins = new Installer();
ins.Uninstall(dict);
InstallContext con = new InstallContext(null, null);
con.LogMessage(ins.HelpTex
}
if (dict.Values.Count >= capacity)
{
dict.Clear();
}
}
}
}
It says System.ArgumentException wtf?
why is that?
Your question is, "Install Problem", what does that mean? Does it mean that you developed a program and works on the development machine but does not work on the machine you are installing it on? Please post more details.
ASKER
it doesn't work on the machine I'm installing it on
Is there an exception message being displayed?
ASKER
yep System.Argument.Exception
You state in the original question, "It says System.ArgumentException wtf? why is that?", there is no way to know why? Have you looked at your system error log?
ASKER
???
ASKER
ive looked at InstallException but couldn't find a thing
Then there is no way anyone can tell you why it is not installing.
ASKER
I may have found smth
savedState dictionary contains data which may have already been destroyed
can u help me
because I found that odd too
savedState dictionary contains data which may have already been destroyed
can u help me
because I found that odd too
The run time exception is occurring when this line of code gets executed, " ins.Uninstall ( dict );", the documentation for Installer.Uninstall states the following,
An IDictionary that contains the state of the computer after the installation was completeit looks like you are trying to uninstall something that has yet to be installed.
ASKER
now I downloaded WhatsUp to do it and here it comes(the problem)
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Configuration.Insta ll;
using System.Web.Caching;
using System.Media;
namespace ConsoleApp7
{
class Program
{
static void Main(string[] args)
{
bool IsInstalled = true;
bool IsUninstalled = false;
Installer ins = new Installer();
string key = "firstkey";
string value = @"WhatsUp.exe";
string capacity = "10";
IDictionary dict = new System.Collections.Generic .Dictionar y<string, string>(Convert.ToInt32(ca pacity),nu ll);
if (dict.Values.Count < Convert.ToInt32(capacity)& &IsInstall ed)
{
dict.Add(key, value);
ins.Uninstall(dict);
IsUninstalled = true;
}
else
{
dict.Clear();
}
if (!IsUninstalled)
{
try
{
}
catch (InstallException exc)
{
string[] errors = { exc.Message, exc.Source };
System.Collections.Generic .List<stri ng> errorlist = new System.Collections.Generic .List<stri ng>();
foreach (var item in errors)
{
errorlist.Add(item);
foreach (var item2 in errorlist)
{
if (item2 == null)
{
Console.WriteLine("Error") ;
}
else
{
Console.WriteLine(item2);
}
}
}
}
}
}
}
}
same as old.System.ArgumentExcepti on
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Configuration.Insta
using System.Web.Caching;
using System.Media;
namespace ConsoleApp7
{
class Program
{
static void Main(string[] args)
{
bool IsInstalled = true;
bool IsUninstalled = false;
Installer ins = new Installer();
string key = "firstkey";
string value = @"WhatsUp.exe";
string capacity = "10";
IDictionary dict = new System.Collections.Generic
if (dict.Values.Count < Convert.ToInt32(capacity)&
{
dict.Add(key, value);
ins.Uninstall(dict);
IsUninstalled = true;
}
else
{
dict.Clear();
}
if (!IsUninstalled)
{
try
{
}
catch (InstallException exc)
{
string[] errors = { exc.Message, exc.Source };
System.Collections.Generic
foreach (var item in errors)
{
errorlist.Add(item);
foreach (var item2 in errorlist)
{
if (item2 == null)
{
Console.WriteLine("Error")
}
else
{
Console.WriteLine(item2);
}
}
}
}
}
}
}
}
same as old.System.ArgumentExcepti
ASKER
and inside try loop an ins.Install(dict) but same problem appearing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.