Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

using rundll32 in an installer .... Installshield works ... Visual Studio .NET msi does not

Posted on 2005-04-26
2
Medium Priority
?
684 Views
Last Modified: 2007-12-19
I am trying to create a shortcut in my app folder to a CPL (control panel object.)

I have used Installshield and used to following to add a shortcut to allow me to run the shortcut to the CPL.

AddFolderIcon(SHELL_OBJECT_FOLDER,
                "<my application name>",
                "rundll32.exe shell32.dll,Control_RunDLL \""+TARGETDIR+"\\<cpl file>.cpl\"",
                TARGETDIR,
                TARGETDIR+"\\<cpl file>.cpl", // Icon executable
                0,
                "",
                REPLACE);

This works ok and allows me to add a shortcut in XP / 2K.

Now I am migrating to .NET and using the "Setup Wizard" in .NET 2003.

I want to do the same as above and I have tried creating a shortcut to my cpl (with the arguements "shell32.dll,Control_RunDLL [TARGETDIR]UDMCPL.cpl" , but it asks for the rundll32.exe file. Now obviously if I try and run the cpl shortcut on any OS other than the one I am developing on then is get an error

"The procedure entry point ActivateActCtx could not be located in the dynamic link library KERNEL32.dll".

Can't switch between rundll32. OS specific.

So how do I create a shortcut to the CPL in the same way as Installshield so that it will work on 2K as well as XP?

I don't want to copy the rundll32.exe, but create a shortcut on the desktop. Any way to script it?

G.
0
Comment
Question by:jeffreyg
2 Comments
 

Author Comment

by:jeffreyg
ID: 13867741
I managed to get it working with a hack.

Created a batch file (runCPL.bat) that ran my cpl, but this also popped up a dos box ..... not very nice.

rundll32.exe shell32.dll,Control_RunDLL ".\<cpl file>.cpl"

So I used a vbs to hide the dos box.

const blindscript = "runCPL.bat"
dim scriptobject, alienobject
set alienobject = CreateObject("Scripting.FileSystemObject")
set scriptobject = WScript.CreateObject("Wscript.Shell")
if not alienobject.FileExists(blindscript) then
 MsgBox "No script exists in that location!", vbOkOnly + vbCritical, "Error"
 WScript.Quit
end if
scriptobject.run blindscript, 0

I call the vbs and it works. Not the neatest though. I would rather not have these two files floating around but if no-one comes up with any ideas then this will have to do.

G.
0
 
LVL 2

Accepted Solution

by:
Lunchy earned 0 total points
ID: 13890842
Closed, 125 points refunded.
Lunchy
Friendly Neighbourhood Community Support Admin
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

569 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