Solved

My .exe uses mswinsck.ocx and i need the program to install mswinsck.ocx if it's..

Posted on 2003-11-04
20
31,271 Views
Last Modified: 2013-11-13
My .exe uses mswinsck.ocx and i need the program to install mswinsck.ocx if it's not in the system folder allready.
I dont know much about this but i have a similar project i downloaded which uses a .res file and when the .exe is started for the 1st time it makes a .ocx and puts it in the system folder.
It's just i dont want to use the p&d w as i just want to be able to easily distibute this .exe to my friends.
I know its possible.
Thanks for your time,
Ian
I would really appreciate an example.
0
Comment
Question by:Ian Gough
20 Comments
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9680653
you can use microsofts package and deployment wizard to create an install file for your application, you can find it in the Micorsoft Visual Studio X Tools folder in your start menu, X being the version number to you studio.  If this doesnt work out for you, you can try setupfactory.
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9680688
Thanks, but i have allready stated i dont want to use a wizzard.
I want the .exe to do it.
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9680734
oops sorry, im thinking that you could possibly do this.

Unload the winsock from your program, then make a copy of it and put it in the same folder as your program, add the component back in but browse for it and enter the one in your folder.  Then when deploying add the winsock.ocx into a zip with your .exe.  I think that it should work.
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9680785
Thanks but its all got to be contained in 1 .exe!
No zip of nothing.  The example i have does this but i cant work out how to change it to use winsock.
It basically has a .res file contained in the .exe and it changes to .ocx and puts in it in the system folder the 1st time it's loaded.
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9680829
ok, another thing to look into would be user documents, you can put the .ocx into your app as a user doc by clicking the Add File, then checking the add as related doc checkbox in the dialog.  but after that i dont know.  Never really done this before but i am interested to see if you get it to work.
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681009
aha, here we go.

    b = LoadResData(101, "CUSTOM")
    F = FreeFile
    Open TPath$ For Binary As F
    Put #F, 1, b
    Close F

i looked into it and this is what i got, set TPath$ = to the windows system directory should look like "C:\Windows\System32\MSWinsck.ocx".  In loadresdata where it says 101, change that to the ID to the file you want to copy, that can be found in the properties of the .res file.  If the machines still have problems just shellexecute the Then just shell execute the  regsvr with the right command line proc to register the .ocx.  You should be set with that
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9681199
Thanks, i think were getting there.
Below is the example i was on about.
When u run it as a vbp it will say missing .ocx but you need to exit vb then re run it and do that a couple of time.  When you compile it you dont get that problem.  But need run it a couple of times as vbp 1st without saving.  (all in the readme)  Then complie.
Anyhow is it possible you can take the example below and change the vbdice.res to winsock (So it installs winsock instead)
Just change the frmmain to a blank form but keep the name as it is.

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=26573&lngWId=1

If it all works after testing i'd be more than happy to reward extra points.
Thanks Again
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681209
im on it, gimme a sec and ill get the code to you
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681302
ok i switched it over to do mswinsck.ocx but how do you want me to give you the code for it?
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9681404
Um?  Do you have a website you can upload it too?
Or can you send it to me via email?
Iangough7@aol.com
Thanks,
Ian,
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Accepted Solution

by:
NBrownoh earned 500 total points
ID: 9681462
ok its sent, like the email says, i tested it and it works perfectly.  if you wanna test it you can just change this:

In the module BasMAIN there is a routine called Main, in that routine there are 3 lines:
        If FileExists(sysDIR & "\MSWinsck.ocx") = True Then 'Yes it is

        GenFileFromRes 101, "CUSTOM", "OCX", , , sysDIR & "\MSWINSCK.ocx"
        ExecuteLink "REGSVR32.EXE", sysDIR & "\MSWINSCK.ocx /s"

just change those two 3 to this:
        If FileExists(sysDIR & "\MSWinsck.ocx") = True Then 'Yes it is

        GenFileFromRes 101, "CUSTOM", "OCX", , , sysDIR & "\MSWINSCKTEST.ocx"
        ExecuteLink "REGSVR32.EXE", sysDIR & "\MSWINSCKTEST.ocx /s"

and then run the program, youll see that it installs a MSWINSCKTEST.ocx into the system directory, and it is registered.  After that just switch it back and your good to go
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9681521
Thanks very much!
Works perfectly.
Thanks Again,
Ian
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681542
glad i can help, and thanks a million for all those extra points.  if you ever need anything again just let me know.
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9681574
Oh, I am sorry, i forgot about the extra points.
As promised.
How about i open up a new question and put 225 points in there?
Sorry Again,
Ian
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681616
you allready gave me 2000 expert points!
0
 
LVL 3

Expert Comment

by:NBrownoh
ID: 9681630
if you really want to, we can, but its up to you completely
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 9681671
Ok, Thanks then.
I'll let you know if i ever need anything again,
Ian
0
 

Expert Comment

by:bewildered
ID: 10194775
Hi,

I was wondering if Nathan could make available the code heemailed to iangough7?

I am writing a similar APP and i'm happy to open a new question with specifics, but thought as Nathan had worked his way thru the problem already ...
0
 
LVL 12

Author Comment

by:Ian Gough
ID: 10195342
Hi bewildered!!!
I have the code if you want it.  Just email me at iangough7@aol.com
Thanks,
Ian
0
 

Expert Comment

by:level118
ID: 10642551
hi guys, i'm interesting in something similar, i want to have one .exe too, but with vb runtime already compiled with the .exe (dll+ocx), i trayed the resurce file but it's not fiable as a solucion (the client machine where the .exe is executed could not have admin privilege to copy to sys dir or access the reg), so the only way is to have one .exe, i was looking for an app (fusionV2) that do the job, but i didn't found it since the website is moved, i tryed another app called (alloy), with two forms, with two winsock controls in each one, and the first open the 2nd, setting listening mode .... and conect the first winsock to the 2nd, compiling normaly (vb6) the .exe, and using alloy to identify the dependency files, so i can add them, but it's didn't works, anyone can help with another solucion please !!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now