Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 21

Thread: Executable in visual basic?

  1. #1

    Executable in visual basic?

    I'm looking to make the rollout of some required software in my company easier:

    What i'd like is an executable (or batch , i don't know) that copies this file -mscal.ocx- from inside itself (if that's possible) to "c:\windows" and then runs the command "regsvr32 c:\windows\mscal.ocx".

    for starters, is this possible?
    and if so how do I do this? (i have access to the visual basic suite)

    thnx!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    This is normally the sort of thing that you would do within the installer, package mscal.ocx in the installation file, and script it to be registered.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    i didn't know that that feature existed.

    After asking our ops dept i was told that it would be preferable to have this program as an exe instead of an installer , since my version of VB6 is *cough* not so very legal. And distributing a installer which can only be made through the VBsuite would put the company at risk.

    they suggested zipping the file in an exe and script the command.


    no clue how to do that though?

    [edit: never mind the less than legal version: i found we have a license for VB 2005.

    about scripting that commant, are there any specifics or is the installer compiler self explanatory?]
    Last edited by andrewvanmar; 08-16-2007 at 05:42 AM.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Your ops department are talking out of ther a##*s!

    Even if your VB6 version is not so legal, there is nothing in the exe created from same that would give the game awaya (although of course that does not mean I am condoning what you are doing).

    And I was not talking about creating an installer through VB, quite the opposite. I was talking about using a proprietary installer such as MS's MSI, Wise, etc., and your ops department should have said the same thing. These products are specifically built for deploying applications, including DLLs, OCXs, etc., across a department, organisation, even across a market.

    Zipping the file is a poor substitute for a proper installer.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    BTW, anyone can have a licens for VB 2005, it's free!

    But it is VB.Net, not standard VB.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    Heh, yeah talking out of their...erhm.... @$$€$ is one of their specialties. But since I know zilch about this stuff I tend to take what they say at face value (which is most often a mistake ;-) )

    I found disks for vb 2005. It's not regular VB?

    What's the downside to zipping it into an exe like you said againt using something like msi?

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    VB2005 is the express version of VS2005's VB, which is all dotNet.

    Well it won't register the OCX on the target machine, won't even put it in the correct directory as far as I can see. So work will need to be done after the zip file is loaded, which a self-extracting installer will do in one fell swoop.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    Hmmm yeah i see the problem.

    I found a installer program called advanced installer, and trying to see if it can do what I want. not easy.

    but since this has gone beyond the realm of VB i'll mark this as solved

  9. #9
    Oh what I do need though, is the VB code to run the regsvr command. I think I can manage the rest.

  10. #10
    I found this:
    Shell "c:\myfolder\myprogram.exe"
    This apparantly call the windows run command, but now to make it run the regsvr thing....
    Last edited by Aussiebear; 04-24-2023 at 01:38 AM. Reason: Adjusted the code tags

  11. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    No you don't the installer should do that.

    I use Inno Setup, advanced, market leader, and free.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  12. #12
    I'll try your program, that way if I run into a snag then'you'll know the program

  13. #13
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Indeed!

    I am no expert, but I do use it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  14. #14
    Hmm, made three versions ( two with my other program, and the one with yours, now to try it at home where I haven't registered the OCX yet,k see which one actually works ;-)

  15. #15
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    use in a batchfile 'cmd regsvr32 c:\windows\mscal.ocx' after you have copied the .ocx file to the system. If you can use usb sticks you can create an autostarter for the usb that will run that batchfile to install to the proper directory. You'll probably need some %variable% for the usb rootdrive. I use pstarter (for a non u3-compatible usb stick). If interested I'll take a closer look at those rootvariables you could use for knowing the used driveletter of the usb stick.

  16. #16
    @XLD:
    I tried all versions, but the installers don't automatically register the ocx. I thik i would like to try entering the command through visual basic, since the program specifically allows for it. Would you help me with the code?

    @Charlize: This batch file would contain the ocx file to copy? No I won't be able to use usb stick, i'd be zipping it, and mailing it to the offices abroad. No clue how to make a batch file though.

  17. #17
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    What Inno script did you use, it should register it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  18. #18
    ; Script generated by the Inno Setup Script Wizard.
    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
    #define MyAppName "MSCAL"
    #define MyAppVerName "Mscal"
    #define MyAppPublisher "linxtelecom"
    [Setup]
    AppName={#MyAppName}
    AppVerName={#MyAppVerName}
    AppPublisher={#MyAppPublisher}
    DefaultDirName=C:\windows\{#MyAppName}
    DisableDirPage=yes
    DefaultGroupName={#MyAppName}
    AllowNoIcons=yes
    OutputBaseFilename=setup
    Compression=lzma
    SolidCompression=yes
    [Languages]
    Name: "english"; MessagesFile: "compiler:Default.isl"
    [Files]
    Source: "C:\WINDOWS\MSCAL\MSCAL.OCX"; DestDir: "{app}"; Flags: ignoreversion
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
    This one.
    But you can leave it, I fixed the other one, it works now Thanks for helping !
    Last edited by Aussiebear; 04-24-2023 at 01:40 AM. Reason: Adjusted the code tags

  19. #19
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You are not registering, and did you read the note that the wizrd throws out

    [Files] 
    Source: "C:\WINDOWS\MSCAL\MSCAL.OCX"; DestDir: "{app}"; Flags: regserver 
    ; NOTE: Don 't use "Flags: ignoreversion" on any shared system files
    Last edited by Aussiebear; 04-24-2023 at 01:40 AM. Reason: Adjusted the code tags
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  20. #20
    I saw nothing in the wizard about registering actually, nor a message that referred to registering???

Posting Permissions

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