Programmatic ocx registration under Windows 7

Virginia

New member
Local time
4:46 AM
Messages
2
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 Computer My Computer

At a glance

Windows 7 32 professional
OS
Windows 7 32 professional
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 Computer My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
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 Computer My Computer

At a glance

Windows 7 32 professional
OS
Windows 7 32 professional
See the COM functions DllRegisterServer and DllUnregisterServer
 

My Computer My Computer

At a glance

Windows 7 32 bitAMD 5200+ dual core2 GBNVidia GeForce 6150SE 128 MB
Computer Manufacturer/Model Number
HP Media Center
OS
Windows 7 32 bit
CPU
AMD 5200+ dual core
Memory
2 GB
Graphics Card(s)
NVidia GeForce 6150SE 128 MB
Monitor(s) Displays
CRT
Screen Resolution
1280x1024
Hard Drives
500 GB Sata internal :

SIIG USB 3.0 docking stations w/WD Caviar Black 6 Gb/s drives
Keyboard
PS/2
Mouse
PS/2 Wheel Mouse
Other Info
SIIG USB 3.0 PCIexpress card.
Back
Top