Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InstallShield confusion! 1

Status
Not open for further replies.

amwprogg

Programmer
Jul 8, 2005
52
GB
I have just developed an application and am using InstallShield to create a CD-ROM for distribution. I've never used this software before (I haven't used FoxPro for very long either) - I've put all the files I need in one source directory and the build runs ok but when I test the distribution it says "Install was interrupted during execution. Try again later." - am I missing something? I've tried a few combos of the setup but to no avail. Also the disk image folders seem to end up NOT in the target areas I specify.
Any help or advice would be appreciated.
AMW.
 
Interesting concept Bill. Right now I have a 2 step process that I would like to make into one step, so I will look to see if this will help with the version 7 and 9 of installshield.

Lee, I have a prg called SENDNEW that I run after I change the program and need a new version for my retail customers. This prg builds the EXE, copies all the files to a directory where they will go on the customers machine, and then empties the DBF files and adds back required default information.

My next step is to start installshield and hit the F7 key to build.

It took me some time to get the hang of installshield also, but once I did it has been great.

If you exhaust all other possiblilities you can post your settings in the program and we might be able to help.


Don Higgins
 
Hi Don

Thank you for your response.

I recently started thread1251-1147630 and at one point thought it was ok. However, I'm still looking into the minor problem which I hope to resolve soon.

What I will do is post back when I've had a chance to try it again, hopefully sometime over the next few days.

Regards
Lee

Visual FoxPro Versions: 6 & 9
Operating System: Windows XP
 
Someone mentioned using SendKeys or the F7 shortcut... I hadn't thought of this before. I've revised my routine so that it should work with any version of ISE that supports F7:
Code:
***********************************************************
* Program : relRunAndBuildISE.PRG                         *
* Author  : William GC Steinford                          *
* Date    : Nov 2002                                      *
* Updated : Nov 2005 -- Use F7 instead of Click           *
***********************************************************
PROCEDURE relRunAndBuildISE
LPARAMETERS tcIseFile

* Adjust this for the path to your ISE installation:
lcISE_Prog = "c:\Program Files\InstallShield\Express\IsIDE.exe"

DECLARE INTEGER CreateProcess IN kernel32; 
    INTEGER  lpApplicationName, ;
    STRING  @ lpCommandLine, ; 
    INTEGER  lpProcessAttributes,; 
    INTEGER  lpThreadAttributes,; 
    INTEGER  bInheritHandles,; 
    INTEGER  dwCreationFlags,; 
    INTEGER  lpEnvironment,; 
    STRING   lpCurrentDirectory,; 
    STRING   lpStartupInfo,; 
    STRING @ lpProcessInformation 

DECLARE LONG    WaitForSingleObject in win32api  INTEGER hHandle, LONG dwMilliseconds
DECLARE INTEGER GetExitCodeProcess  in win32api  INTEGER hProcess, INTEGER @ nExitCode

#DEFINE SW_SHOW      5
#DEFINE STILL_ACTIVE 0x103

DECLARE INTEGER FindWindow in win32api as apiFindWindow ;
      INTEGER nClass, STRING cName
DECLARE INTEGER FindWindowEx IN WIN32API as apiFindWindowEx ;
        INTEGER hwndParent, ;
        integer hwndChildAfter, ;
        string @ lpszClass, ;
        string @ lpszWindow
Declare INTEGER SendMessage in user32 as apiSendMessage ;
        INTEGER hWnd, ;
        INTEGER nMsg, ;
        INTEGER nParam1, ;
        INTEGER nParam2
        

LOCAL lcStartInfo, lcProcessInfo, lcCmd, lhProcess, lnExitCode, ;
      llBuilt
lcStartInfo  = GetStartupInfo()
lcProcessInfo = repl( chr(0), 12 )

*!*	typedef struct _PROCESS_INFORMATION { HANDLE hProcess
*!*	                                      HANDLE hThread 
*!*	                                      DWORD dwProcessId 
*!*	                                      DWORD dwThreadId   } PROCESS_INFORMATION

* MSDN Notes: If both AppName and CmdLine are provided, then they are both treated as *lp
*             (ie: Pointer to Pointer to String, instead of just lp: Pointer to String)
*   When I specify both, it seems that appname works but commandline doesn't.
* MSDN Notes also: If one is null (AppName or CmdLine) then both are expected to be
*             given in the other parameter.
*   So that's what we do.  And it works.

lcCmd = ["]+lcISE_Prog+[" "]+tcIseFile+["]
if 0=CreateProcess( 0, @lcCmd, 0,0,0,0,0,0, ;
                    lcStartInfo, @lcProcessInfo )
  *?"Could not create process"                    
  RETURN -1
ENDIF

lhProcess  = Buf2dword( left( lcProcessInfo, 4 ) )
lnExitCode = STILL_ACTIVE
lnRes      = 1
llBuilt    = .f.
do while lnExitCode=STILL_ACTIVE or lnRes=0

  WaitForSingleObject(lhProcess, 500) && wait 1/2 second
  
  IF NOT llBuilt
    * Locate the ISE window
    lnISE      = apifindwindow(0,JUSTSTEM(tcIseFile)+' - InstallShield Express')
    
    IF lnIse>0 && Found
      llBuilt = .t.
      
      * Send the F7 keystroke message:
      apiSendMessage(lnISE,0x07e8,0,0)
    ENDIF
  ENDIF
  
  * Find out if Installshield has been exited.
  lnExitCode = -2
  lnRes = GetExitCodeProcess(lhProcess, @lnExitCode) && non-zero means success.
  if lnExitCode=STILL_ACTIVE 
    if InKey()=27 && user in VFP pressed ESC: Stop waiting
      RETURN -3
    endif
  endif
enddo
RETURN iif(lnRes=0,-2,lnExitCode)
ENDPROC

PROCEDURE  getStartupInfo 
* creates the STARTUP structure to specify main window 
* properties if a new window is created for a new process 

*| typedef struct _STARTUPINFO {  
*|     DWORD   cb;                4 
*|     LPTSTR  lpReserved;        4 
*|     LPTSTR  lpDesktop;         4 
*|     LPTSTR  lpTitle;           4 
*|     DWORD   dwX;               4 
*|     DWORD   dwY;               4 
*|     DWORD   dwXSize;           4 
*|     DWORD   dwYSize;           4 
*|     DWORD   dwXCountChars;     4 
*|     DWORD   dwYCountChars;     4 
*|     DWORD   dwFillAttribute;   4 
*|     DWORD   dwFlags;           4 
*|     WORD    wShowWindow;       2 
*|     WORD    cbReserved2;       2 
*|     LPBYTE  lpReserved2;       4 
*|     HANDLE  hStdInput;         4 
*|     HANDLE  hStdOutput;        4 
*|     HANDLE  hStdError;         4 
*| } STARTUPINFO, *LPSTARTUPINFO; total: 68 bytes 

#DEFINE STARTF_USESHOWWINDOW   1 
#DEFINE SW_SHOWMAXIMIZED       3 

RETURN  num2dword(68) +; 
    num2dword(0) + num2dword(0) + num2dword(0) +; 
    num2dword(0) + num2dword(0) + num2dword(0) + num2dword(0) +; 
    num2dword(0) + num2dword(0) + num2dword(0) +; 
    num2dword(STARTF_USESHOWWINDOW) +; 
    num2word(SW_SHOWMAXIMIZED) +; 
    num2word(0) + num2dword(0) +; 
    num2dword(0) + num2dword(0) + num2dword(0) 

FUNCTION num2word (lnValue) 
  RETURN Chr(MOD(m.lnValue,256)) + CHR(INT(m.lnValue/256)) 
ENDFUNC  
FUNCTION buf2word (lcBuffer) 
  RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ; 
         Asc(SUBSTR(lcBuffer, 2,1)) * 256 
ENDFUNC  
FUNCTION num2dword (lnValue) 
#DEFINE m0       256 
#DEFINE m1     65536 
#DEFINE m2  16777216 
  LOCAL b0, b1, b2, b3 
  b3 = Int(lnValue/m2) 
  b2 = Int((lnValue - b3*m2)/m1) 
  b1 = Int((lnValue - b3*m2 - b2*m1)/m0) 
  b0 = Mod(lnValue, m0) 
  RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3) 
ENDFUNC  
FUNCTION  buf2dword(lcBuffer)  
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;  
       Asc(SUBSTR(lcBuffer, 2,1)) * 256 +;  
       Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +;  
       Asc(SUBSTR(lcBuffer, 4,1)) * 16777216  
ENDFUNC

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top