Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-11-04
20
Medium Priority
?
31,318 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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
 
LVL 3

Accepted Solution

by:
NBrownoh earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

927 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