简体   繁体   中英

folder path input in installer c# visual studio 2010

What i need is the user to be able pick not only the installation path, but also a path where they want to put configuration files for my program.

At the moment i have a setup project in the same solution as the actual program (the program is an outlook 2010 add-in, but dont think that matters). I tried to work with custom actions using a class library but that doesnt seem to work out. I have tried using different project types as Installer Class for the custom action, but none of them worked. I have a Windows Form with a button on it that should open a FolderBrowserDialog and put whatever folder the user chooses into a textbox. but whenever i try to do folderBrowserDialog.ShowDialog() the form freezes completely. The FolderBrowserDialog never shows at all.

Any help much appreciated :)

greets

Since you said "any help" would be appreciated:

You're using a tool that is horrible. Microsoft removed it from VS2012 and there are 5K+ votes on user voice saying to bring it back because it "worked just fine". Frankly, that represents 5K developers who hardly know anything about Windows Installer.

The tool abstracts and seals away so much Windows Installer technology that it fails to expose, besides a great many other things, the ability to customize the Installation User Interface Sequence in the way that you need and would be otherwise possible.

So instead you are forced to use InstallUtil custom actions to present UI in the InstallExecuteSequence where no UI is supposed to be shown. This violates several tenants of Windows Installer design and if this was an application you were talking about you'd likely never consider doing it.

If you want to do it right you only have 2 choices. Postbuild manipulate the MSI to inject what Setup and Deployment cannot (like manipulating IL in a built DLL because C# doesn't support something that the CLS does) or switch to a tool such as Windows Installer XML or InstallShield Professional that handles it properly in the first place.

I'm sure I will now be downvoted by a percentage of those 5K developers but I don't care. I've been developing installers for 17 years and I'm the top contributor on installer related tags and I know what I speak isn't merely opinion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM