Wednesday, September 29, 2010

longpathtoquote example code

#define plq       PROGRAMFILES^"notepad.exe"
#define pls      "C:\\Program Files\\notepad.exe"
 #define plr      "C:\\Program Files\\message.txt" 
  #define pld      "C:\\Program Files\\Setup1.BMP" 
   //#define plm       PROGRAMFILES^"orbp.rtf"
// Included header files ----------------------------------------------------
#include "ifx.h"
//---------------------------------------------------------------------------                                                                       
// OnFirstUIBefore
//
// First Install UI Sequence - Before Move Data
//
// The OnFirstUIBefore event is called by OnShowUI when the setup is
// running in first install mode. By default this event displays UI allowing
// the end user to specify installation parameters.
//
// Note: This event will not be called automatically in a
// program...endprogram style setup.
//---------------------------------------------------------------------------   
function OnFirstUIBefore()
    number  x,nResult, nLevel,nSize,nvType,nType, nSetupType,nvSize,nWait;
    string  szTitle, szKey,szMsg, szOpt1, szOpt2,svValue,szValue, szLicenseFile,svPath;
    string  szName, szCompany, szTargetPath, szDir, szFeatures, szTargetdir;
    BOOL    bLicenseAccepted;


begin   

   nSetupType = COMPLETE;
   szDir =PROGRAMFILES;
   szName = "";
    szCompany = "";
    bLicenseAccepted = FALSE; 
    svPath = pls;
   // svvpath=plr;
  //  svvpath=pld; 
     LongPathToQuote (svPath,TRUE);
     //LongPathToQuote (svvpath,TRUE);
    // LongPathToQuote (svvpath,TRUE); 
   RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
   RegDBCreateKeyEx ("SOFTWARE\\projects","");  
  
   RegDBSetKeyValueEx ("SOFTWARE\\projects",szName,REGDB_STRING,"Karnataka",nSize);
 
   RegDBGetKeyValueEx("SOFTWARE\\projects",szName,nvType,svValue,nvSize);
  //   MessageBox(PROGRAMFILES,INFORMATION);
            MessageBox(SUPPORTDIR,INFORMATION);
     
  //AddFolderIcon(FOLDER_DESKTOP,"projects",TARGETDIR^"notepad.exe","",TARGETDIR^"xyz.ico",0,"",REPLACE);
  //AddFolderIcon(FOLDER_STARTUP,"Projects",TARGETDIR^"notepad.exe","",TARGETDIR^"xyz.ico",0,"",REPLACE); 
   AddFolderIcon(FOLDER_STARTUP,"Shortcut for notepad",svPath ,"","C:\\Program Files\\xyz.ico",0,"",REPLACE);
    //AddFolderIcon(FOLDER_STARTUP,"Shortcut for notepad","C:\\Program Files\\Setup1.BMP","","",0,"",REPLACE);
   AddFolderIcon(FOLDER_DESKTOP,"Shortcut for notepad",svPath ,"",PROGRAMFILES ^"xyz.ico",0,"",REPLACE);
    //// AddFolderIcon(FOLDER_DESKTOP,"Shortcut  notepad",PROGRAMFILES^"message.txt","",PROGRAMFILES ^"xyz.ico",0,"",REPLACE);
   // MessageBox("value is:" +svValue,INFORMATION);
   MessageBox ("quoted path:" +svPath, INFORMATION);
  // MessageBox ("quoted path:" +svvPath, INFORMATION);                                                     
   /// MessageBox ("quoted path:" +svvPath, INFORMATION);
// Beginning of UI Sequence
Dlg_Start:
    nResult = 0;

Dlg_SdWelcome:
    szTitle = "world";
    szMsg = "god is almighty";
    //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
    nResult = SdWelcome( szTitle, szMsg);
    //}}IS_SCRIPT_TAG(Dlg_SdWelcome) 
      
   // if (nResult = BACK)  then
   
         Disable(BACKBUTTON);
       
   
Dlg_SdLicense2:
    szTitle = "my licence";
    szOpt1 = "";
   szOpt2 = "";
    //{{IS_SCRIPT_TAG(License_File_Path)
   szLicenseFile = SUPPORTDIR ^ "License.rtf";
     //szLicenseFile =  PROGRAMFILES ^ "mylicence1.rtf";
    //}}IS_SCRIPT_TAG(License_File_Path)

Friday, September 24, 2010

reading registry entry and setting registry data using installshield

 
   RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
   RegDBCreateKeyEx ("SOFTWARE\\projects", "" );  
  
   RegDBSetKeyValueEx ("SOFTWARE\\projects",szName,REGDB_STRING,"Karnataka",nSize);
 
    RegDBGetKeyValueEx("SOFTWARE\\projects",szName,nvType,svValue,nvSize);
 
    MessageBox("value is:"+svValue,INFORMATION);
   

Tuesday, September 21, 2010

installshield add shortcut to the desktop,startup,program script

function OnFirstUIBefore()
    number  nResult, nLevel, nSize, nSetupType,nvType,nvSize;
    string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile,szKey,szName,svValue,szNumName;
    string  szCompany, szTargetPath, szDir, szFeatures, szTargetdir,svNumValue;
    BOOL    bLicenseAccepted;
begin
  
    nSetupType = COMPLETE;
    szDir = TARGETDIR;
    szName = "";
    szCompany = "";
    bLicenseAccepted = FALSE;
   
    MessageBox("I am here",INFORMATION);
    AddFolderIcon(FOLDER_DESKTOP,"Shortcut for notepad","C:\\notepad.exe","","C:\\xyz.jpg",0,"",REPLACE);
    AddFolderIcon(FOLDER_STARTUP,"Shortcut for notepad","C:\\notepad.exe","","",0,"",REPLACE);
    AddFolderIcon(FOLDER_STARTMENU,"Shortcut for notepad","C:\\notepad.exe","","",0,"",REPLACE);
    AddFolderIcon(FOLDER_PROGRAMS,"Shortcut for notepad","C:\\notepad.exe","","",0,"",REPLACE);
 
    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
    //RegDBCreateKeyEx("SOFTWARE\\CreateKeyExample","");
    //nvType=123;
    RegDBGetKeyValueEx("SOFTWARE\\nijo","My Name",nvType,svValue,nvSize);
    MessageBox("Value is: "+svValue,INFORMATION);