1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Stucking problem.

Discussion in 'Windows XP' started by sdanda, Oct 25, 2007.

Thread Status:
Not open for further replies.
  1. sdanda

    sdanda Thread Starter

    Joined:
    Oct 1, 2007
    Messages:
    27
    Hai,
    I am working on Instalscript projects using IS12..For installation of microloader software,I am using this Installscript projects..During the installation of the microloader, it stucks at adding dialog boxes(for 10 minutes nearly),then it shows the Reboot the system dialog box.Adding Shortcuts Dialog box code is added in OnFirstUIafter() function.OnFirstUIafter() function is called after the file transfers.




    This is the code I wrote in OnFirstUIAfter()
    function OnFirstUIAfter()

    NUMBER opt1,opt2,nvResult;
    NUMBER nResult;
    STRING szKey, szEnv,svResult;
    POINTER pEnv;
    HWND hMain;
    string targetDir;
    string exePath;
    string targetDirExe;
    string szCommandLine,docsPath, targetDirDocs;
    NUMBER nvCheck1,nvCheck2,nvCheck3,launch;
    string applicationPath,fileName,szCmdLine;
    number reboot;
    string szTitle,szMsg;
    string szSetupPath,szKeyVersion;
    number i;
    string str,path,unInstallString,dll,total;

    begin
    ProcessAfterDataMove();

    GetSystemInfo (OS, nvResult, svResult);
    hMain = GetWindowHandle(HWND_INSTALL);
    SetForegroundWindow(hMain);
    if (SetDialogTitle(DLG_ASK_OPTIONS,"Add MicroLoader icons")<0) then
    MessageBox("Change Dialog title failed",SEVERE);
    abort;
    endif;

    nvCheck1 = TRUE;
    nvCheck2 = TRUE;
    nvCheck3 = TRUE;
    Disable (BACKBUTTON);
    AskOptions( NONEXCLUSIVE, " ", "Add MicroLoader to Desktop.", nvCheck1 , "Add MicroLoader to Start menu.", nvCheck2,"Add MicroLoader to quick launch", nvCheck3);

    targetDir = TARGETDIR;
    exePath = "MicroLoader.exe";
    targetDirExe=targetDir ^ exePath;
    szCommandLine = targetDirExe;
    LongPathToQuote(szCommandLine, TRUE);

    if( nvCheck1 == TRUE ) then

    AddFolderIcon(FOLDER_DESKTOP, "MicroLoader", szCommandLine,"","",0,"",REPLACE);
    endif;

    if(nvCheck2 == TRUE) then
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader","MicroLoader", szCommandLine,"","",0,"",REPLACE);

    docsPath = "Microloader Quick Start Guide.doc";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Quickstart Guide", szCommandLine,"","",0,"",REPLACE);

    docsPath = "Microloader Release Notes.doc";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Release Notes", szCommandLine,"","",0,"",REPLACE);

    docsPath = "MICROLOADER.HLP";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Help File", szCommandLine,"","",0,"",REPLACE);

    if(ComponentIsItemSelected (MEDIA, "Documentation")) then

    docsPath = "Documentation\\MicroLoader FAQs.doc";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader\\Docs" , "FAQs", szCommandLine,"","",0,"",REPLACE);


    docsPath = "Documentation\\Microloader User Manual.doc";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader\\Docs" , "User Manual", szCommandLine,"","",0,"",REPLACE);

    docsPath = "Documentation\\DSP Download Readme.doc";
    targetDirDocs = targetDir ^ docsPath;
    szCommandLine = targetDirDocs;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader\\Docs" , "DSP Download Readme", szCommandLine,"","",0,"",REPLACE);

    endif;
    endif;
    if(nvCheck3 == TRUE) then
    targetDir = TARGETDIR;
    exePath = "MicroLoader.exe";
    targetDirExe=targetDir ^ exePath;
    szCommandLine = targetDirExe;
    LongPathToQuote(szCommandLine, TRUE);
    AddFolderIcon(FOLDER_APPDATA^"Microsoft\\Internet Explorer\\Quick Launch" , "MicroLoader", szCommandLine,"","",0,"",REPLACE);
    endif;

    //AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Uninstall MicroLoader v1.64.4", UNINSTALL_STRING, DISK1TARGET,DISK1TARGET^"wizard.ico",0,"",REPLACE);


    ShowObjWizardPages(NEXT);
    opt1= FALSE;
    // Get the handle of the main installation window.
    Disable(STATUSEX);
    hMain = GetWindowHandle(HWND_INSTALL);
    // Bring the main installation window to the foreground.
    SetForegroundWindow(hMain);
    if(ALLUSERS) then
    szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
    else
    szKey = "Environment";
    RegDBSetDefaultRoot(HKEY_CURRENT_USER);
    endif;


    RegDBCreateKeyEx(szKey,"");
    nResult = RegDBSetKeyValueEx(szKey, "ULOADER_PATH", REGDB_STRING, TARGETDIR, -1);
    if (nResult < 0) then
    MessageBox("Failed to Set Environment Variable", WARNING);
    else
    // Flush the NT registry to all applications.
    szEnv = "Environment";
    pEnv = &szEnv;
    SendMessage (HWND_BROADCAST, WM_WININICHANGE, 0, pEnv );
    endif;


    //szKeyVersion = "\\Software\\Analog Devices Inc\\MicroLoader\\2.0";
    szKeyVersion = "\\Software\\Analog Devices Inc\\MicroLoader\\"^microLoaderVerNumber;
    //LongPathToQuote(szKeyVersion,TRUE);
    //if(RegDBSetKeyValueEx("\\Software\\Analog Devices Inc\\MicroLoader\\1.64.4","Host Version",REGDB_STRING, "1.64.4",-1)<0) then
    //if(RegDBSetKeyValueEx(szKeyVersion,"Host Version",REGDB_STRING, "2.0",-1)<0) then
    if(RegDBSetKeyValueEx(szKeyVersion,"Host Version",REGDB_STRING, microLoaderVerNumber,-1)<0) then
    MessageBox("Host version in the registry fail",SEVERE);
    endif;
    if(RegDBSetKeyValueEx(szKeyVersion,"Target Version",REGDB_STRING, microLoaderVerNumber,-1)<0) then
    MessageBox("Target version in the registry fail",SEVERE);
    endif;
    if(RegDBSetKeyValueEx(szKeyVersion,"Installer Version",REGDB_STRING, "1.0",-1)<0) then
    MessageBox("Installer version in the registry fail",SEVERE);
    endif;



    //szSetupPath = DISK1TARGET + "\\setup.exe";
    //LongPathToQuote(szSetupPath,TRUE);
    //AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Uninstall or Modify MicroLoader", szSetupPath, DISK1TARGET,DISK1TARGET^"wizard.ico",0,"",REPLACE);
    //LongPathToQuote(UNINSTALL_STRING,FALSE);
    //path = "C:\\Program Files\\InstallShield Installation Information\\{07DB6FE4-C635-48CB-9B7D-3D83512DF6F9}\\setup.exe";
    path = DISK1TARGET+"\\setup.exe";
    LongPathToQuote(path,TRUE);
    //dll = "RunDll32 C:\\PROGRA~1\\COMMON~1\\INSTAL~1\\PROFES~1\\RunTime\\0701\\Intel32\\Ctor.dll,LaunchSetup ";
    //LongPathToQuote(dll,TRUE);
    total = path+" -runfromtemp";
    //unInstallString = "LaunchSetup "+path;
    i = AddFolderIcon(FOLDER_PROGRAMS^"MicroLoader" , "Uninstall or Modify MicroLoader", total, DISK1TARGET,DISK1TARGET^"wizard.ico",0,"",REPLACE);
    if(i<0) then
    str = FormatMessage(i);
    MessageBox(str,INFORMATION);
    endif;


    szTitle = "Reboot";
    szMsg = "";
    reboot = SdFinishReboot (szTitle, szMsg, SYS_BOOTMACHINE, "", 0);
    BATCH_INSTALL = -1;
    //SprintfBox(INFORMATION,"BATCH_INSTALL","%d",BATCH_INSTALL);

    end;



    In this after adding Icons to the desktop I added registery keys of the microloader to the Registery editor..Is it takes so muct time..Can anyone tell me what is the reason for stucking?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/643226

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice