COM DLL exception in application when it auto laun

2019-09-06 18:04发布

问题:

I'm using this solution to modify the MSI to include a checkbox for user to decide whether s/he wants to launch the application after setup exits.

Although everything works just fine, what I noticed was the application was not able to use any COM DLL's registered during the setup when it was auto launched. The app works perfectly when launched again from start menu.

I have tested it on Windows XP and Windows 7.

The COM DLL's have been marked as self registering dll's in the setup project.

回答1:

I got it work. The problem was that the target directory was not specified. The bug fix was mentioned in this question.

I changed one of the lines in script to:

sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '226', 'TARGETDIR', '[TARGETDIR]\\" + filename + " " + arguments + "')"; 


回答2:

It's hard to give an answer to such a specific question since I don't have your installer and application in a test lab to do some basic profiling and troubleshooting. However I will throw an idea at the wall and see if it sticks:

Is your working directory different between the shortcut and creating the process from the installer? Depending on how your COM was registered, this can make a difference.