Page 1 of 1
Hangs at Apply Uninstall Progress says: Windows Installer
Posted: Fri Mar 13, 2009 8:27 am
by tj
This setup has worked well until some recent changes. I must have unknowingly changed something that affected the uninstall process but I can't seem to track it down.
Now, when I try to uninstall the product, setup gets stuck or hangs right at the Apply Uninstall line. The progress text actually says "Windows Installer" so I'm assuming that we have handed off the installation at that point. I get no error and the setup never comes back. I let the uninstall run all night and it never came back.
I am trying to step through so I can watch LASTERROR but it never comes back from Windows Installer. Does anyone have any troubleshooting tips for me?
Again, this uninstall was working just fine before a recent round of changes so I'm fairly confident in the order of "Apply" calls and the general logic of the setup. Is it possible that I've corrupted the Windows Installer database with the addition of my last component?
btw - I'm using a VM machine to test so I'm assured that my test platform is clean and identical every time I test the installation.
Posted: Fri Mar 13, 2009 10:44 am
by tj
Just to add more detail to this...
When the setup is hung at the Windows Installer, Task Manager shows the setup at 50% CPU. It's really busy doing something but it never comes back. I don't know how but it's almost like it's in a loop.
I've gone back to backups of earlier version of this setup and I don't see any difference in the maintenance REMOVE logic. As far as I can tell, the only thing that has changed is the front side of the installation.
Posted: Sat Mar 14, 2009 7:54 am
by MichaelNesmith
InstallAware waits for the Windows Installer mutex to become available at that progress line.
Therefore, if it is waiting there, some background MSI installer is doing something; although it wouldn't take 100% CPU (of one core) doing this so maybe something else really is broken in your setup.
Posted: Sat Mar 14, 2009 10:04 am
by tj
I tracked down the section of code that is causing this last night. It appears to be in a section where I'm loading values from a custom encrypted config file. I use this to store sensitive connection credentials. I load the values back in whenever there is a maintenance item so they can retain their previous choices.
I really don't understand, yet, what is causing this but I'll follow up with another post when I have pin pointed what the issues is. If I can reproduce it, I'll send this to you in a small app.
Pinpointed the line that causes this issue
Posted: Sat Mar 14, 2009 10:20 pm
by tj
We have created our own utilities dll to encrypt credentials. If I exclude the line that calls this dll, the uninstall/repair works. This include script is called about 20 times in a row to load the encrypted credentials. I'm still trying to determine if there's a specific value that is causing the issue. We ran into a length issue (for a list of email addresses) using string parameters. I think using allocated string buffer resolved that issue for us. Thus, I changed all of parameters to allocated string buffers. I'm wondering if this isn't part of the problem?
Here's the call to our dll.
Code: Select all
~InstallAware Clipboard Data~
~Call DLL Function~
~{0F88785A-D96C-463B-98D6-2F61C117B574}~
~$INSTALLUTILITIESPATH$\\InstallUtilities.dll,ReadConfigFileAppSettings,void,RESULT,"allocated string buffer (MAX_PATH length)",$SETUPCONFIGPATH$,"allocated string buffer (MAX_PATH length)",$ConfigValue$,$~
~mIDEFunc.dll\\mEXEFunc.dll~
I'll follow up with more details if I am able to track down the exact value.
Posted: Sun Mar 15, 2009 7:41 am
by MichaelNesmith
Passing incorrect parameters, too long values, etc. can corrupt the stack, and lead to all kinds of funny, seemingly random behavior.
You should also post your DLL function header so we can see if it aligns with what you've declared in the plug-in.
DLL Function Header
Posted: Sun Mar 15, 2009 8:24 am
by tj
Here's the whole read function. The strange thing is that the dll call seems to work perfectly. It loads all of the values and, as far as I can tell, the values all look good.
__declspec(dllexport) void __stdcall ReadConfigFileAppSettings(const char * targetConfig, char * key_value)
{
try
{
System::Configuration::Configuration ^appconfig;
System::Configuration::ExeConfigurationFileMap ^ mapConfig = gcnew System::Configuration::ExeConfigurationFileMap();
mapConfig->ExeConfigFilename = gcnew System::String(targetConfig);
appconfig = System::Configuration::ConfigurationManager::OpenMappedExeConfiguration(mapConfig,System::Configuration::ConfigurationUserLevel::None);
System::String ^key = gcnew System::String(key_value);
System::String ^value = nullptr;
if(appconfig->AppSettings->Settings[key] != nullptr)
{
value = appconfig->AppSettings->Settings[key]->Value;
}
else
{
value = "";
}
System::String ^gckey_value = /*key + "[ValSplit]" + */value;
char* str2 = (char*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(gckey_value).ToPointer();
memset(key_value,0,gckey_value->Length+1);
strcpy(key_value,str2);
System::Runtime::InteropServices::Marshal::FreeHGlobal((System::IntPtr)str2);
}
catch(System::Exception ^ex)
{
strcpy(key_value,"");
}
return;
}
Posted: Sun Mar 15, 2009 12:19 pm
by MichaelNesmith
Set the first parameter to pointer to string and see if that helps.
Underscore in a parameter was the cause
Posted: Sun Mar 15, 2009 12:58 pm
by tj
Finally tracked this down to an "_" underscore in one of the parameters we were passing to the dll. I'm not sure why that caused a problem but I simply removed the underscore and Windows Installer was happy again. I'm a little confused because I'm pretty sure this value wasn't being sent to anything that would be prepared for Windows Installer but I'd rather not speculate the cause.
If you'd like to track that down to something specific, I'll work to send you the utility when I have more time. Right now, we are scrambling to get this next release built.
Thanks for your help through the weekend! Much appreciated.
Re: Hangs at Apply Uninstall Progress says: Windows Installe
Posted: Sat Feb 01, 2014 1:27 am
by etedali
Hello,
I want to encrypt my app.config but I don't know how can i do it,can anyone help me?
Re: Hangs at Apply Uninstall Progress says: Windows Installe
Posted: Sun Feb 02, 2014 2:36 am
by etedali
Hi tj
Can you help me how you can encrypt app.config?do you write dll in c++?thanks for your help
Re: Hangs at Apply Uninstall Progress says: Windows Installe
Posted: Mon Feb 03, 2014 11:39 am
by FrancescoT
Dear User,
You can only use C++ (native) DLLs.
Regards