Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Programmatic ocx registration under Windows 7

08 Sep 2010   #1
Virginia

Windows 7 32 professional
 
 
Programmatic ocx registration under Windows 7

I have a complex program as demo for my large application, which at the beginning is capable to programmatic register OCXs and launches another executable using programmatic command prompt. It works well under Windows XP but under Windows 7 runs properly only if I run it under administrator. If I donít run as administrator the only thing that I see is that the OCXs are not registered (one of the ocx is for showing images).
I would like to know if there is any way to programmatically register components as administrative rights (eventually additional parameter when I register components in command prompt).
With other words I would like the user of this demo to double click in the application and to be able to run everything as in Windows Xp, not launching application by right click choosing running it in certain way.


My System SpecsSystem Spec
.

09 Sep 2010   #2
MilesAhead

Windows 7 32 bit
 
 

You could check into Inno Setup. You can have it register ocx files on install and unregister on uninstall just by using the "regserver" keyword. Also you can set the minimum install privilege to Administrator. The register and unregister of ocx should be done during install. Running a program that registers ocx without the user knowing it could be construed as malware these days. Better to just explain up front that the installer will register the ocx but the uninstall will automatically unregister and delete it.

You might also look into making a restore point before the install to reassure the customer they can get their system back to the state before it ever saw your demo.

edit: btw Inno Setup is free even for commercial use, and open source. I've used it for several years. In addition to the built in script mechanism, it does interpreted subset of Pascal so you can do things like check if certain registry settings exists or if files already exist on the system etc... there's easy detection if your program has already been installed using Inno Setup. Makes it easy to prompt the user during uninstall if they want to remove all registry settings or just remove files etc..

It's a mature and robust set up tool for Windows.
My System SpecsSystem Spec
09 Sep 2010   #3
Virginia

Windows 7 32 professional
 
 

Thank you for answer,
I can not use any shell installer because customer should launch demo from CD and running everything from CD. It is true that my demo copyes components and database into local hard drive for registration and saving configuration then in the exit unregister and delete everything.
Similar as any installer silently register components I would like doing myself programmatically when administrator is logged on that computer.
I am waiting for suggestion.
Virginia
My System SpecsSystem Spec
.


09 Sep 2010   #4
MilesAhead

Windows 7 32 bit
 
 

See the COM functions DllRegisterServer and DllUnregisterServer
My System SpecsSystem Spec
Reply

 Programmatic ocx registration under Windows 7




Thread Tools





Similar help and support threads
Thread Forum
Windows 7 no registration problem
I bought a new motherboard, CPU, etc. from a local computer superstore 2 years ago and struck up a conversation with the service tech - when I mentioned that I was still using Win XP he kindly burnt me a copy of Win 7 Home Premium that he said was meant for multi computer use and needed no...
Windows Updates & Activation
Windows registration information...
i have Student MS account and download a version of Windows7 Pro. and installed it own my Laptop...there is one key provided by MS can i use the same key on my another system(s)?
General Discussion
Installing Windows 7 from registration key
I bought a Asus Intel i5 computer that only comes with a registration key. How do I get it installed on the computer?
General Discussion
Windows registration info
Hi what info is asked when registering for Windows again. Username, first name, second name ect.. Can anyone provide me with a list.
Windows Updates & Activation
programmatic way with BAT file determining if elevated command prompt
Is there any programmatic way within a BATch file of determining whether it has been started from an elevated command prompt (run as Administrator) or a normal command prompt? I note the difference between the Current Directory at start of the BATch file, but wonder if there is a better way. ...
General Discussion
Registration question regarding Windows 7
I'm wondering if anyone knows an answer to regarding the registration of Windows 7 when it's finally released October 22nd. I built a new PC and was going to install a copy of Windows XP Pro and then upgrade to Windows 7 Business Pro when it came out. In fact I have already pre-purchased my...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 15:25.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App