CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 1999
    Location
    UK
    Posts
    44

    Setup - I need to modify system.ini and force a reboot

    I am trying to use the P&D Wizard to produce an install disk set for my application. As part of the install process, I need to add 6 lines to the 386Enh section of system.ini to install a third-party comms driver used by my code and then force/recommend a reboot before my program can be run.

    I will be installing to either Win95/98 or WinNT.

    I realise I will probably have to modify something in the SETUP1 project.

    This is the information I need to add:
    [386Enh]
    device=C:\commdrv\wcsccdrv.386
    WCSCMaxPorts=2
    WCSCInBufLen=4096
    WCSCOutBufLen=2048
    WCSCInBufHigh=4000
    WCSCInBufLow=250

    Is it possible to place this information in the registry instead?

    Thanks for any help...

    Mark
    Regards

    Mark Rivers-Moore

  2. #2
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    Re: Setup - I need to modify system.ini and force a reboot

    Use the WritePrivateProfileString function.

    Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As Any, ByVal lsString As Any, ByVal lplFilename As String) As Long

    Dim ret As Long
    lpAppName = "[386Enh]"
    lpKeyName = "WCSCMaxPorts"
    lpString = "2"
    lpFileName = "system.ini"

    ret = WritePrivateProfileString(lpAppName, lpKeyName, lpString, lpFileName)

    [email protected]
    http://vbcode.webhostme.com/

  3. #3
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Setup - I need to modify system.ini and force a reboot

    To write to registry use

    SaveSetting "AppName", "SectionName", "KeyName", "SettingName"


    and to read from registry use
    x = GetSetting("AppName", "SectionName", "KeyName", "DefaultValue")



    where you can use text1.text = x to display string from registry you have just read


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

Featured