View Full Version : Non 12 specific question.. InstallClass

09-22-2011, 01:36 PM
Ok.. Ive search and tested and tried doing quite a few things. I dont have an option to use anything other than the standard installclass options due to our programmers sadly tying my hands as well as audits at client sites.

My issue is that the typical installation has us run a batch file after the MSI isntalls (prior to installshield). That batch file simply runs installutil.exe against our DLL. It does so in the installation directory which contains a config file with settings that it references. Moving this to an automated process in InstallShield is where I am running into a wall.
I have the component selected as .Net Installer Class "Yes" and it seems to attempt to run it under the windows\system32 folder which throws an error "Configuration file 'C:\Windows\system32\XXXXX.config' does not exist". So I thought I should pass through the argument on that dll of /targetdir="[INSTALLDIR]\". It doesnt seem to change a thing.

Is there some way to make it run in the target directory where the DLL is installed?

09-22-2011, 04:12 PM
The Current Directory gets changed when you 'Run as administrator' or when you run from a UNC drive. Put the following lines near the top of your bat file...
PUSHD %~dp0
to prove that the current directory is not what you were expecting. The PUSHD line will make it what you were expecting. You should also put a corresponding POPD at the end of the bat file. Some would argue that you don't need that, but if you ever call that bat file from another you will be in trouble.

Let us know if this does it for you.

09-22-2011, 04:16 PM
Well I am trying to avoid needing to run the bat file at all. Id rather have it all working through the installshield package.

So is there a different argument I should be using with the .Net Installer Class portion of the component?

Cary R
09-23-2011, 12:08 PM
Are you registering a .Net Service? If so, you don't actually have to call the installer class to get the service setup; you can treat it just like a regular Native C++ written service and register it using the Services view of the component.

09-26-2011, 09:29 AM
No... Ive gotten the service creation etc down pat... this one is a bit different.

Essentially through the user interview process, we ask for database servers and database names. THen through text replace, the answers are swapped in a config file. This config file contains an extremely large section of web service pointers. When Installutil is run on the DLL I am trying to install, it takes this web service address and then enters it into the database with location information of the dll and other things so that the company framework knows where the product was installed. It was designed pre-installshield so it may be something that we have to re-design. I just wish there was a way to literally tell the installerclass to run from the [INSTALLDIR] rather than the system32 folder.

09-28-2011, 01:07 PM
Ok, so we re-wrote some code so that we can pass the config file into the DLL and it runs... however we hit another snag on the same process.

Essentially as I have mentioned, the DLL reads information from a config file and transmits that information to a database table.

Now that we have the DLL reading the config file correctly, it is attempting to transmit that information to the database however it is erroring out with a "user without sifficient privledges" error. The logged in user that is kicking off the install, is an admin and has rights to the database... however the install process is using some other user account and I cannot seem to figure out where it is pulling it from or how to force it to use a specific account.

Any other ideas?