I've created a Windows Service (in C#) using Visual Studio, and also created an installer (.msi file), but was getting several errors when trying to run the installer. They didn't tell me what the error was, but kind of pointed to it. Here they are, so hopefully some Googler some day will find them and it will help solve their problem. My solution is after that.
One error message: "...does not exist. If this parameter is used as an installer option, the format must be /key=[value]"
Another error message: "Error 1001. Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\windows\system32\Files\HP\MirthDirWatchSetup\' or one of its dependencies. The system cannot find the file specified."
Inside the custom actions for the installer, I had CustomActionData set to the following: /Param1="[EDITA1]" /Param2="[EDITA2]" /targetdir="[TARGETDIR]\".
Note 1: If any of the parameters (including TARGETDIR) has spaces, you need those quotes.
Note 2: If any of these parameters are PATHS - which TARGETDIR is - you need that slash after the closing bracket.
My problem was that Param1 was also a path, and I didn't know that ALL paths need that slash after the bracket. I had thought it was just TARGETDIR. So the lesson learned here is that when you're creating parameters, if any of them are a path, you need that trailing slash. This may apply to any parameter that has a slash in it, too, but I'm not going to test it now. I just spent all day figuring this out. I've put enough of the keywords in here; here's to hoping the next person with this problem finds this post!
Subscribe to:
Post Comments (Atom)
You don't always need a slash with TargetDir. If you included a trailing slash in the default value, assuming the default is kept (or at least its format by the user), the slash will already be there.
ReplyDeleteI got the error above because one of my parameters was a password, and I typed it incorrectly.
ReplyDelete