Results 1 to 8 of 8

Thread: inno include .exe with vb6 app

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    71

    inno include .exe with vb6 app

    Not sure of the forum rules.... but can I ask a question about inno setup compiler as it pertains to this question??

    the question would be on what screen during the wizard would I add the reg.exe file that is location on my hard drive in c:\admintools\reg\ and where do I declare in inno that that file needs to be installed in the c:\winnt\system32 computer of the person installing the software.....

    newbie to both inno and vb6 so any simple steps would be appreciated

    thanks

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    71

    Re: inno include .exe with vb6 app

    I figured out the problem and used inno for attaching .exe file

    change the code to the following



    Code:
    Private Sub cmdCitrixKey_Click()
        Dim sysDir As String
        
        sysDir = Environ$("windir")
        
        Shell sysDir & "\reg delete HKLM\Software\Microsoft\MSLicensing\test2 /force", vbNormalFocus
        Shell sysDir & "\reg delete HKLM\Software\Microsoft\MSLicensing\test1 /force", vbNormalFocus
    
    End Sub
    The app does the job but I know I can improve on the code since when I run the app two cmd windows popup and close right away. How can I run just one shell function?? to do the job that the two shell functions are doing. I want to clean the code up if I can..

  3. #3
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    Re: inno include .exe with vb6 app

    VB Code:
    1. Private Sub cmdCitrixKey_Click()
    2.     Dim sysDir As String
    3.     sysDir = Environ$("windir")
    4.     Shell sysDir & "\reg delete HKLM\Software\Microsoft\MSLicensing\test2 /force", vbHide
    5.     Shell sysDir & "\reg delete HKLM\Software\Microsoft\MSLicensing\test1 /force", vbHide
    6. End Sub

    Try that, almost the same code, but, uses VbHide.
    Zeegnahtuer?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: inno include .exe with vb6 app

    This is just a curiousity question, but why would you need to distribute reg.exe?

    Isn't that something that should already be installed on your target machines?

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: inno include .exe with vb6 app

    you know you can use API functions to interact with the registry directly from VB code.. no need to include reg.exe, no need to shell to an external app..

    its really much nicer and cleaner that way, and you can do things like verify that the action completed properly

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: inno include .exe with vb6 app

    here is a module you can plop into your VB6 app, and use its functions to interact with the registry

    [EDIT]: I uploaded the bas file instead of posting the code (was too big )
    Attached Files Attached Files

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2005
    Posts
    71

    Re: inno include .exe with vb6 app

    Hack, the reg.exe is a microsoft resource kit tool that does not come installed on the clients.

    kleinma
    you know you can use API functions to interact with the registry directly from VB code.. no need to include reg.exe, no need to shell to an external app..
    I have never used API before.. just a newbie trying to learn.... I will have to find a site to explain API functions to me...

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: inno include .exe with vb6 app

    no you won't.. because the bas module I posted is basically a wrapper... it handles all the API stuff for you so you don't have to. You just call the public functions in that module as if you wrote them yourself.. it has easy functions to work with to read and write keys

    for example if you put that module in your app, and called it modReg, you would access it from your code like
    VB Code:
    1. modReg.SaveSettingString(HKEY_LOCAL_MACHINE, "SOFTWARE\MyComp\MyApp\", "MyKey","MyValue")

    this would save a string in the HKEY LOCAL MACHINE part of the registry, in the software node, and MyComp and MyApp could be substituted to suite your needs. MyKey is the registry key name, and of course MyValue is the string value of MyKey

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