0

In my setup.dll i have the folowing:

#include "stdafx.h"
#include "ce_setup.h"

TCHAR Message[] = _T("TERMS & CONDITIONS\r\n ")
    _T("Do you agree to terms? \r\n");

codeINSTALL_INIT Install_Init
(    
    HWND hwndParent,
    BOOL fFirstCall,
    BOOL fPreviouslyInstalled,
    LPCTSTR pszInstallDir 
)
{
if (!fFirstCall || ::MessageBoxW(0, Message, _T("RmapGeneric"), MB_YESNO) == IDYES)
          return codeINSTALL_INIT_CONTINUE;
      else
          return codeINSTALL_INIT_CANCEL;
}

codeINSTALL_EXIT Install_Exit
(
    HWND    hwndParent,
    LPCTSTR pszInstallDir,
    WORD    cFailedDirs,
    WORD    cFailedFiles,
    WORD    cFailedRegKeys,
    WORD    cFailedRegVals,
    WORD    cFailedShortcuts
)
{
    PROCESS_INFORMATION pi = {0};
    codeINSTALL_EXIT cie = codeINSTALL_EXIT_DONE;
    TCHAR szPath[MAX_PATH];
    _tcscpy(szPath, pszInstallDir);
    _tcscat(szPath, _T("\\"));
    _tcscat(szPath, _T("Application.exe"));
    MessageBox(GetForegroundWindow(), szPath, L"status", MB_OK);
    if (!CreateProcess(szPath, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, &pi))
    {
        MessageBox(GetForegroundWindow(), szPath, L"failed", MB_OK);
        cie = codeINSTALL_EXIT_UNINSTALL;
    }
    return cie;
}

While the first function works, the Install_Exit does not. All i want is that after the installation the application automaticly starts.

Any suggestions what am i doing wrong?

ctacke
  • 66,480
  • 18
  • 94
  • 155
no9
  • 6,424
  • 25
  • 76
  • 115

2 Answers2

0

There's nothing completely obvious as to what's wrong. Are you certain that the target executable is in that folder? Have you called GetLastError to see why it's failing?

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • my next question was, how to debug this code to see whats wrong. This is my first mobile app setup, so i really never did this before. – no9 Jul 07 '10 at 06:01
  • since i put the same code in the exit function as it is in the init function im guessing the exit function never gets called? – no9 Jul 07 '10 at 06:20
  • i have additional question: Is there some example, how can i in any of this functions check for the .NET CF framework installation on the device. Ofcorse the best solution would be to include the net cf cab in the installation process, but i know that i cannot nest .cab files. So a simple check with a message box would work for me ... – no9 Jul 07 '10 at 06:42
  • your code is called by wceload.exe, so there's no way to debug it live (with breakpoints, etc). You have to use messageboxes or a log file. – ctacke Jul 07 '10 at 14:00
0

Ok i found the problem in .DEF file

I forgot to export the exit function :S

no9
  • 6,424
  • 25
  • 76
  • 115