Ok, found the problems. I had some typeo's in the file names. Now it gets
through the install process but will not install on the phone. The phone is
connected..It starts the CEAppMgr.exe, but nothing gets installed at that
point. My ini file is correct. here is the ini. I have verified the cab file
is in the right directory.
Any Ideas?
[CEAppManager]
Version = 1.0
Component = GroceryList35
[GroceryList35]
Description = Grocery List For Mobile Phone
CabFiles = GroceryList35Cab.CAB
"mws" <> wrote in message
news:OAIpu$...
> The code below gives Error 1001 OnafterInstall -> Object reference not set
> to an instance of an object. AnyIdeas why?
>
> Thanks
>
> namespace CustomInstallLibCS
> {
> [RunInstaller(true)]
> public partial class CustomInstaller : Installer
> {
> public CustomInstaller()
> {
> InitializeComponent();
> }
> protected override void OnAfterInstall(IDictionary savedState)
> {
> string programName = "\"" + CEAppMgrExe + "\"";
> string programArg = "\"" + IniFilePath + "\"";
>
> //Messagebox.show(programName + " " + programArg);
>
>
> Process.Start(programName, programArg);
> base.OnAfterInstall(savedState);
> }
>
> const string _ceAppMgrRegistryPath =
> @"software\Microsoft\CurrentVersion\App Paths\CEAppMgr.exe";
> const string _iniFileName = "GroceryList35Cab.cab";
> const string _filePrefix = @"file:\";
>
>
> string CEAppMgrExe
> {
> get
> {
> RegistryKey subkey = null;
> string exePath = null;
> try
> {
> subkey =
> Registry.LocalMachine.OpenSubKey(_ceAppMgrRegistry Path);
> exePath = (string) subkey.GetValue("");
> }
> finally
> {
> if (subkey != null)
> subkey.Close();
> }
> return exePath;
>
> }
> }
>
> string IniFilePath
> {
> get
> {
> string installfolder =
> Path.GetDirectoryName(Assembly.GetExecutingAssembl y().GetName().CodeBase);
> string iniFilePath = Path.Combine(installfolder,
> _iniFileName);
>
> if (iniFilePath.StartsWith(_filePrefix))
> {
> int index = _filePrefix.Length;
> iniFilePath = iniFilePath.Substring(index);
>
> }
> return iniFilePath;
> }
>
> }
>
|