|
Hello everyone, first code project post for me.
In .NET, all classes seem to export by default, is there a way to explicitly mark a class so that it is not exported, i.e. make it invisible to
anyone who uses the assembly? I've got a couple of classes that are only used internally in my class library that the user shouldn't have to know about.
Any suggestions?
-Mathias
|
|
|
|
|
|
Thanks a lot!
Note to Managed C++ developers:
In Visual Studio 2003 there is no '__internal' keyword equivalent to C#'s 'internal', instead one is supposed to use 'private public:' access modifiers (!?). This should be fixed in Visual Studio 2005.
|
|
|
|
|
I'm trying to create an installer that will prompt the user for a username and password that they want to save. Unfortunately none of the templated dialogs that are in the user interface portion of the installer setup have a password field and their properties can't be edited to have them.
Does anyone know how I would go about adding this functionality to the installer? I've read all about custom actions and what's available there, but unless I'm wrong, these aren't there as prompts to the user and only execute during/after the installation process. I'm also using C# if that makes a difference.
Any help would be greatly appreciated.
Thanks,
Luke
|
|
|
|
|
|
I am using the Visual Studio 2003 Setup Wizard in the Setup and Deployment Project. I create a Setup for windows applciation. The generated output is a .msi file which I want to be able to distribute.
When I try to install a new version of my application over an existing one I get the following warning.
"Another version of this product is already installed.
Installation of this version cannot continue. To
configure or remove the existing version of this product,
use Add/Remove Programs on the Control Panel."
In the Deployment Project
DetectNewerInstalledVersion = True
RemovePreviousVersions = True
One strange thing is that if I Right Click on the Deployment Project and choose Install I do not have any problems - all installations are OK. It is only when I double click on the generated .msi file that the problem occurs.
I do not know if there is any use of it but I have Windows Installer 3.1 (the latest vesion I think)
Does anyone have any suggestions?
Thanks,
|
|
|
|
|
The setup.exe file is the file that will check for the previous versions ,click it and it will work as well.
|
|
|
|
|
LongHC wrote:
The setup.exe file is the file that will check for the previous versions ,click it and it will work as well
My distribution does not have the setup.exe file it only has a single .msi file.
|
|
|
|
|
You can force a reinstall over an existing installation by doing the following:
Make sure that all newer files have a higher version number than the existing files.
Run the msi with the following command line parameters:
msiexec /i [Fully qualified path to your new msi] REINSTALL=ALL REINSTALLMODE=vomus
You can modify the bootstrapper exe to run the install with the above command line.
There are a couple of limitations to this method:
This forces your new msi to run in reinstall mode, and overwrites all existing files where the version has changed. If older files exist that are no longer needed, this method does not account for removing them, and in fact you will still need to add the unneeded files to your new msi because they need to be present so that they are entered in the uninstall log. Otherwise if your user does a complete uninstall, old files not installed by your new msi will be left on the target machine. Ditto for all other resources like registry entries, etc.
If your new install needs to get user input from dialogs, you may run into problems.
An alternative to forcing a reinstall is to modify the bootstrapper to first run the existing msi in Unistall mode, then launch your new setup. You can get the parameters needed to run an uninstall from the registry.
Finally, Windows Installer does support "true" product upgrades, which are not the same as simply trying to force a reinstall over an existing product. But if your original setup was not correctly authored with an UpgradeCode, among other things, then this will not work. Describing how to author msi's to support future upgrades, and how to author the associated upgrade msi's is beyond the scope of anything I could answer on this forum.
Robert
|
|
|
|
|
Robert,
There seems to be a lot of good informaiton there but is beyond my understanding.
Could you point me to a tutorial/info on the installer process as used by Visual Studio. (e.g. what is the bootstrapper, how do you author installer scripts, how to access the registry setting, what other installation options do I have?)
Does this all have to be done from within Visual Studio.
Thanks,
Liam
|
|
|
|
|
|
OK, the typical installation process involves first running a program called Setup.exe, AKA the bootstrapper. The bootstrapper is a program written in C++ so that it has minimalk external dependencies and should run on any system that has Windows installed.
What the bootstrapper does is to check to see if the .NET Framework is installed. If not, it installs the framework so that the target machine is now ready to run your MSI setup package. Once the bootstrapper has prepared the target machine it launches your MSI.
The source code for the bootstrapper is available, so you can modify it to run additional actions before your MSI is launched. In this case that would be probably uninstalling the existing application if it exists.
To unistall the existing application and then install your new application, you would perform the following steps:
1) Search the registry to verify the app is already installed. MSI packages are identified by a GUID known as the ProductCode. You have to determine the ProductCode for your app. If the app is installed, there will be an entry in:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
Example. ProductCode is {FB6E8318-B7EA-4392-A7DD-D33295D158B7}. If the product is installed, you will find a registry entry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FB6E8318-B7EA-4392-A7DD-D33295D158B7}
2) If the app is installed, uninstall it by running the command line:
MsiExec.exe /qb- /X[Your ProductCode]
Example:
MsiExec.exe /qb- /X{FB6E8318-B7EA-4392-A7DD-D33295D158B7}
MsiExec will return a success code = 0 when the uninstall is complete.
3) Launch your new install after msiexec has returned a success code for the uninstall.
Now, you have a couple of options on how to proceed:
1) If you are comfortable programming in C++ you can modify the bootstrapper directly to perform the above sequence.
2) If you are not adept at C++ programming, you can get by with minimal modifications to the bootstrapper. Simply change it to run a custom exe file instead of the setup msi at the end of the bootstrapper sequence. Since the NET framework will be installed by the bootstrapper, you can create a custom exe as a NET application that checks the registry, launches the uninstall, and finally runs your new setup.
To get started, you need to download the bootstrapper sample project and figure out how to proceed from there. Information about the bootstrapping process, as well as the setup.exe source code can be obtained from:
http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/dotnetframedepguid.asp[^]
Robert
|
|
|
|
|
:(Sorry im reali new at this....i doing a project on .Net compact framwork.
can someone tell me how can i combine two image so tat i get a onmouseup and down?
im using C#....
Help
|
|
|
|
|
I have written an application in c# and need to be able to print sticky address labels, the 21 to a page variety. Is there a correct way to do this, or is it best just to write the code to calculate the layout of the text. If this is the case is there info on the layout of these labels i can use, ie margins and label sizes to use when drawing the text
|
|
|
|
|
When using User Controls in a .NET Windows Forms app, the designer sometimes "activates" controls within a User Control when in design-mode, but only when the User Control have been placed within a container control (like a Panel or Groupbox).
Look at this zipped AVI movie which demonstrates the problem :
http://www.bean.dk/uctest/UCTest.avi.zip
The full source code for the example can be found here :
http://www.bean.dk/uctest/UCTest.source.zip
This would normally only be a minor thing since the bug only occurs at design-time, but I'm using .NET's designer in my own app. so the users can design forms themselves.
Is there a workaround to avoid controls within a User Control to be "activated" when the user clicks on them design-time ?
Thanks in advance,
/Bean
|
|
|
|
|
|
|
*triple bump*
I can't be the only one with this problem ?
|
|
|
|
|
Hi,
I have heard that MSAA can be used to capture the menu operation . There are several events related to Menu Operation . I want to know which event is fired when the user press save on notepad. For menu selection and popup of menu there are events EVENT_SYSTEM_MENU_START and EVENT_SYSTEM_MENUPOPUPSTART called. But what about the actual click.
Regards,
Sunil Virmani
|
|
|
|
|
hi list,
i'm new to .NET programming ( coming from Delphi ).
I'd like how can i test programs written fro Framework 1.1 with Framework 2.0 ( as it seemms i can't use VS2003 ).
Thanks and rgds.
Paolo
Paolo Fenelli
|
|
|
|
|
|
Hello Senthil,
thanks for reply, ...i'll try.
But i don't understand why Framework 2.0 is not accessible trought VS2003. Maybe there is not "transportability" from 1.2 to 2.0?
And what about VS2005. Will it work with Framework 2.0?
However many thanks.
Paolo
Paolo Fenelli
|
|
|
|
|
Paolopf wrote:
And what about VS2005. Will it work with Framework 2.0?
.NET 2.0 is designed with vs2005,you can develop .NET 2.0 from its SDK tools or ,you can FORNOW try the FREE express beta editions to DEVELOP WITH IT .NET 2.0 Applications.
|
|
|
|
|
Thanks for reply
Paolo Fenelli
|
|
|
|
|
OK, recently I have been getting a SEHException from a WinForm in c#. I searched everywhere and have found solutions that "worked." I tried them all, but none worked. I tried moving the EnableVisualStyles and DoEvents around, removing one or the other, etc. I also didn't want a manifest. I just figured out a way to solve this. It was a very hard problem to track down, because it isn't a result of your code.
My scenario was that an option from a combo box that called an external dll to launch a Showdialog. This seems to be the source of the error, so I tried to find a way to fix it while keeping the XP visual style.
What I did was add a timer into my application. It has a very small interval so there is no lag. When the user clicks on the combo box and the option that bring up the dialog, it starts the timer. That way, the showdialog is not called from inside the combo box. When the timer gets a tick, it stops itself and launches the window. I use a private string incase I need to do this with more functions.
There you go, the code runs from a function that isn't hooked to a control. SetVisualStyles CAN work!
Matt
|
|
|
|