views:

20

answers:

2

Hello

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?

A: 

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
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
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
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
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
no9
A: 

Ok i found the problem in .DEF file

I forgot to export the exit function :S

no9

related questions