Results 1 to 7 of 7

Thread: Installation

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    55

    Post

    i want to make an installation for my program.
    can anybody suggest me how to do it??
    i thought at first to do it with vb but the installation will need vb dll and i want the installation to be a stand-alone.
    if it's possible to make it with vb without using vb dll please tell me how, if not i need suggestions how to make the installation

  2. #2
    Member
    Join Date
    Jun 2000
    Location
    North of France
    Posts
    49

    Lightbulb

    Hi brucelee,

    I had the same idea few days ago. VB installation needs dll because it contain graphical effect, installation to the registry,...

    Can you tell me what excatly your app contain?

    [Edited by (B2F)Tom on 07-07-2000 at 08:48 AM]

  3. #3
    Hyperactive Member mikef's Avatar
    Join Date
    Jun 2000
    Location
    Beach bound...
    Posts
    510
    I always write my setup programs with the setup wizard. It is VERY VERY easy and creates a standalone .EXE named SETUP.EXE It also ensures that ALL needed files for your program are included. Try it and see:

    C:\Program Files\Devstudio\VB\setupkit\kitfil32\setupwiz.exe

    There are many options and if you have WinZip Self-Extractor for software installs....you can create a self-extracting .EXE that will auto-run your setup.exe and display custom messages and what not. Other than that spend the big bucks and buy InstallShield or you could try to write one yourself....but good luck!

    Hope this helps.....

    ...later

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    55

    Reply to (B2F)Tom

    i need my installation to unzip some files to a specific path, copy the vb dll and register it, also register some other dll's, access the registry and add some values, and eventually run the program..

  5. #5
    Member
    Join Date
    Jun 2000
    Location
    North of France
    Posts
    49

    Arrow

    Cause of you have to Unzip files, I don't think you can use the VB Setup Wizards, unless modify the source code of this wizard.

    So I think you can do your own install.exe in several times:

    1st: Call the shell function (which doesn't need dll) to unzip your files. Winzip allow you to put your compressed files where you want.

    2nd: with the CopyFile method, copy your dll into the specific directory

    3rd: unfortunatly, if you want to register your app in the Windows registry, you'll have to use DLL. If you let me few minutes, i'll refound the name of the dll and the name of the functions you need.

  6. #6
    Member
    Join Date
    Jun 2000
    Location
    North of France
    Posts
    49

    Arrow

    Code:
    Attribute VB_Name = "Registry"
    ' {group:DJAddIn}
    '
    ' Description:
    ' This is a fairly general implementation of an
    '  interface to the Win32 registry.
    '
    ' Remarks:
    ' This is a fairly general implementation of an
    '  interface to the Win32 registry.
    
    Option Explicit
    
    ' These are documented in the Win32 Docs...
    
    ' {secret}
    Public Const HKEY_CLASSES_ROOT = &H80000000
    ' {secret}
    Public Const HKEY_LOCAL_MACHINE = &H80000002
    
    Private Const ERROR_SUCCESS = 0&
    Private Const ERROR_NO_MORE_ITEMS = 259&
    
    Private Const REG_SZ = 1
    Private Const REG_BINARY = 3
    Private Const REG_DWORD = 4
    
    Private Declare Function OSRegOpenKey Lib "advapi32" Alias "RegOpenKeyA" _
      (ByVal hkey As Long, ByVal lpszSubKey As String, phkResult As Long) As Long
    Private Declare Function OSRegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" _
      (ByVal hkey As Long, ByVal lpszValueName As String, ByVal dwReserved As Long, _
       lpdwType As Long, lpbData As Any, cbData As Long) As Long
    Private Declare Function OSRegCloseKey Lib "advapi32" Alias "RegCloseKey" _
      (ByVal hkey As Long) As Long
    Private Declare Function OSRegEnumKey Lib "advapi32" Alias "RegEnumKeyA" _
      (ByVal hkey As Long, ByVal iSubKey As Long, _
       ByVal lpszName As String, ByVal cchName As Long) As Long
    Private Declare Function OSRegEnumValue Lib "advapi32" Alias "RegEnumValueA" _
      (ByVal hkey As Long, ByVal iSubKey As Long, ByVal valueName As String, vnLen As Long, _
       ByVal reserved As Long, dtype As Long, lpbData As Any, dataSize As Long) As Long
    
    ' Description: Opens a key in the registry.
    '
    ' Arguments:
    '  hkey - An open registry key (as returned by this
    '         call, that is) or one of HKEY_LOCAL_MACHINE
    '         et. al.
    '  relKeyName - A path to the subkey (of hkey) to open.
    '
    ' Results:
    '  The newly opened key or 0 if an error happened.
    Public Function OpenKey(ByVal hkey As Long, ByVal relKeyName As String) As Long
      Dim key As Long
      Dim rc As Long
    
      rc = OSRegOpenKey(hkey, relKeyName, key)
      If (rc = ERROR_SUCCESS) Then
        OpenKey = key
      Else
        OpenKey = 0
      End If
    End Function
    
    
    ' Description: This fetches a value from the registry.
    '
    ' Remarks:
    ' Note: The caller is responsible for making sure
    '       that result is of the expected type.
    '
    ' Arguments:
    '   hkey - the key which the value comes from.
    '   valName - the value to get
    '   value - a variant that will be filled by
    '           whatever value was in the registry.
    '
    ' Returns:
    '   *True* on success, *False* otherwise.
    Public Function QueryValue(ByVal hkey As Long, ByVal valName As String, value) As Boolean
      Dim rc As Long
      Dim t As Long
      Dim dataLen As Long
      Dim data As String
      Dim l As Long
    
      rc = OSRegQueryValueEx(hkey, valName, 0&, t, ByVal 0&, dataLen)
      QueryValue = False
      If rc <> ERROR_SUCCESS Then
        Debug.Print "Registry.QueryValue: Failed to get type"
        Exit Function
      End If
      
      Select Case t
      Case REG_SZ
        data = String(dataLen, " ")
        rc = OSRegQueryValueEx(hkey, valName, 0&, 0&, ByVal data, dataLen)
        If rc = ERROR_SUCCESS Then
          value = StripTerminator(data)
        Else
          Debug.Print "Registry.QueryValue: Failed to get string value"
          Exit Function
        End If
      Case REG_DWORD
        dataLen = 4
        rc = OSRegQueryValueEx(hkey, valName, 0&, 0&, l, dataLen)
        If rc = ERROR_SUCCESS Then
          value = l
        Else
          Debug.Print "Registry.QueryValue: Failed to get DWORD value"
          Exit Function
        End If
        
      Case Else
        Debug.Print "Registry.QueryValue: Can't figure out the type"
        Exit Function
      End Select
      QueryValue = True
    End Function
    
    ' Description: Closes a registry key
    '
    ' Arguments:
    '   hkey - The handle of the key
    '
    ' Remarks:
    '   This closes the registry key, hkey.  It should be a value
    '     returned by OpenKey.
    Public Sub CloseKey(ByVal hkey)
      OSRegCloseKey (hkey)
    End Sub
    
    ' Description: Gets rid of a bogus trailing null character
    '
    ' Arguments:
    '  strString - The string containing the bogus character
    '
    ' Return Value:
    '  The string with the null removed.
    '
    ' Remarks:
    '  I haven't the slightest why this should be ncessary, but
    '  the example I saw did it, so what the heck.
    Private Function StripTerminator(ByVal strString As String) As String
        Dim intZeroPos As Integer
    
        intZeroPos = InStr(strString, Chr$(0))
        If intZeroPos > 0 Then
            StripTerminator = Left$(strString, intZeroPos - 1)
        Else
            StripTerminator = strString
        End If
    End Function

  7. #7
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    You can also try INF-TOOL. It too allows you to create a single self-extracting .exe file that can registry all your components and open your app after your installation if you so desire.


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