Results 1 to 7 of 7

Thread: Installerless install?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    BC, Canada
    Posts
    152

    Installerless install?

    Hi everyone,

    I have quite a problem at the moment. I've been asked to produce a database interface program. No problem there. It uses such controls as the DBGrid, DataEnvironment and DataReport. I can create a installer using the Package and Deployment Wizard (PDW) with no problems, and a test computer worked fine.

    However, I've been asked to, essentially, put the exe and related files in a networked folder so that people just have to run it, instead of explicitly installing it. I know this is pretty much impossible, unless people already have the files registered on their machine.

    A little note here: using PDW to install, then uninstalling the program still allows my program to be run from the networked folder on the test machine. It didn't work before the install.

    Any ideas here? I was thinking, if I have to do it the way I've been asked, I'd make the initial form run a silent install. However, it seems like I'd just be writing my own little installer.

    Any help/advice is appreciated. Please and thanx.

    Destined

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    create the installer package.. but don't include your actual exe... that way they will get the support files they need (dlls, ocxs, VB Runtimes) but they wont get a local copy of your exe... that you put on the shared drive and then everyone should be able to access it and have it work.. this is also good because if you make changes to your app you just have to replace the shared drive one instead of individually on a bunch of PCs...

    the reason it worked when you installed and then uninstalled is because the uninstall doesnt remove the ocxs and dlls that get registered on the system during the install

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    BC, Canada
    Posts
    152
    Thanx kleinma, I never did think of that. I guess it could be a "if this did not work, run this install file".

    A couple of more questions in general...

    1) Is it possible to just put the dependant files into the dir with the exe and have it work, or do they still need to be registered

    2) If they need to be registered, can I register a local copy then unregister it even if the file exists (and is registered) on the user's computer?

    Thanx.

    Destined

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by Destined Soul
    Thanx kleinma, I never did think of that. I guess it could be a "if this did not work, run this install file".

    A couple of more questions in general...

    1) Is it possible to just put the dependant files into the dir with the exe and have it work, or do they still need to be registered

    2) If they need to be registered, can I register a local copy then unregister it even if the file exists (and is registered) on the user's computer?

    Thanx.

    Destined
    yeah you can get creative in order to make things work for ya..

    for example.. i have some applications that sit on a shared drive... when you open up the master application it runs a check to see if the computer has the needed components.. and if it does, then it opens the desired application... if not it copies down and registers the needed files.. then launches the program... it even checks file versions in case i make an update to a DLL.. i can just change the version number of it.. and next time the user runs my app.. they will get the newest dll version and it will remove the old one

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    BC, Canada
    Posts
    152
    Originally posted by kleinma
    yeah you can get creative in order to make things work for ya..

    for example.. i have some applications that sit on a shared drive... when you open up the master application it runs a check to see if the computer has the needed components.. and if it does, then it opens the desired application... if not it copies down and registers the needed files.. then launches the program... it even checks file versions in case i make an update to a DLL.. i can just change the version number of it.. and next time the user runs my app.. they will get the newest dll version and it will remove the old one
    Actually, this is pretty much what I was thinking I'd have to do. I'm assuming there's some nice API to check a DLL's version? (I know there's one to register (and unregister) DLLs..)

    Not to bug you, but would you be able to post any of that code to check versions and register the files? (Or a link?)

    Thanx.

    Destined

    PS - That was a pretty fast reply.

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    i cant post the project because of company security reasons.. but i can give you some pieces to get you going..

    here is code you can put in a module to check file versions

    you just pass the file name to the GetFileVersion function

    VB Code:
    1. Option Explicit
    2.  
    3. Private Type VS_FIXEDFILEINFO
    4.    dwSignature As Long
    5.    dwStrucVersionl As Integer     '  e.g. = &h0000 = 0
    6.    dwStrucVersionh As Integer     '  e.g. = &h0042 = .42
    7.    dwFileVersionMSl As Integer    '  e.g. = &h0003 = 3
    8.    dwFileVersionMSh As Integer    '  e.g. = &h0075 = .75
    9.    dwFileVersionLSl As Integer    '  e.g. = &h0000 = 0
    10.    dwFileVersionLSh As Integer    '  e.g. = &h0031 = .31
    11.    dwProductVersionMSl As Integer '  e.g. = &h0003 = 3
    12.    dwProductVersionMSh As Integer '  e.g. = &h0010 = .1
    13.    dwProductVersionLSl As Integer '  e.g. = &h0000 = 0
    14.    dwProductVersionLSh As Integer '  e.g. = &h0031 = .31
    15.    dwFileFlagsMask As Long        '  = &h3F for version "0.42"
    16.    dwFileFlags As Long            '  e.g. VFF_DEBUG Or VFF_PRERELEASE
    17.    dwFileOS As Long               '  e.g. VOS_DOS_WINDOWS16
    18.    dwFileType As Long             '  e.g. VFT_DRIVER
    19.    dwFileSubtype As Long          '  e.g. VFT2_DRV_KEYBOARD
    20.    dwFileDateMS As Long           '  e.g. 0
    21.    dwFileDateLS As Long           '  e.g. 0
    22. End Type
    23. Private Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
    24. Private Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
    25. Private Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
    26. Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, ByVal Source As Long, ByVal length As Long)
    27.  
    28. Dim FileVer As String, ProdVer As String
    29. Public Function GetFileVersion(strFullFileName As String) As String
    30.     Dim rc As Long, lDummy As Long, sBuffer() As Byte
    31.     Dim lBufferLen As Long, lVerPointer As Long, udtVerBuffer As VS_FIXEDFILEINFO
    32.     Dim lVerbufferLen As Long
    33.    
    34.     '*** Get size ****
    35.     lBufferLen = GetFileVersionInfoSize(strFullFileName, lDummy)
    36.     If lBufferLen < 1 Then
    37.        MsgBox "No Version Info available!"
    38.        Exit Function
    39.     End If
    40.    
    41.     '**** Store info to udtVerBuffer struct ****
    42.     ReDim sBuffer(lBufferLen)
    43.     rc = GetFileVersionInfo(strFullFileName, 0&, lBufferLen, sBuffer(0))
    44.     rc = VerQueryValue(sBuffer(0), "\", lVerPointer, lVerbufferLen)
    45.     MoveMemory udtVerBuffer, lVerPointer, Len(udtVerBuffer)
    46.    
    47.     '**** Determine File Version number ****
    48.     FileVer = Format$(udtVerBuffer.dwFileVersionMSh) & "." & Format$(udtVerBuffer.dwFileVersionMSl) & "." & Format$(udtVerBuffer.dwFileVersionLSh) & "." & Format$(udtVerBuffer.dwFileVersionLSl)
    49.    
    50.     '**** Determine Product Version number ****
    51.     ProdVer = Format$(udtVerBuffer.dwProductVersionMSh) & "." & Format$(udtVerBuffer.dwProductVersionMSl) & "." & Format$(udtVerBuffer.dwProductVersionLSh) & "." & Format$(udtVerBuffer.dwProductVersionLSl)
    52.  
    53.     GetFileVersion = FileVer
    54. End Function

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    BC, Canada
    Posts
    152
    Thanx a bunch kleinma.

    I'll let you know how it goes once I get the rest of it working.

    Destined

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width