Change pre-defined message in Windows installer using VS 2010 - visual-studio-2010

I have looked at this question, but it is something different.
I need to change the message of MsiRMFilesInUse Dialog box.
Currently the message is "Do not close applications. (A reboot will be required.)"
I need to get it changed to "Do not close applications. (Application may not work)" .
The message comes when application is open, and user try to uninstall the app.
The only (but big) restriction is to do it in Visual Studio 2010 setup project. (Installshield/Wix are not allowed).
I have looked at custom action, not able to figure out how to change the message.
Another approach is to create a custom dialog box, but then i am not able to change the dialog box somehow. Also new dialog box has a very limited set of controls.

Per MsiRMFilesInUse Dialog (Windows)
The MsiRMFilesInUse Dialog box can be authored to display a list of
processes that are currently running files that need to be overwritten
or deleted by the installation. The user can select between options to
"Automatically close applications and restart them" or "Do not close
applications. (A reboot will be required.)" If the user selects the
"Automatically close applications and restart them" option, a push
button control on this dialog box can be authored to publish the
RMShutdownAndRestart control event and the Restart Manager can close
the applications and restart them at the end of the installation. This
can eliminate or reduce the need to restart the computer. For more
information, see System Reboots.
Notice the generous use of the word "can be authored". It is written this way because the perspective is of the Windows Installer SDK (Windows Platform). InstallShield (Basic MSI) and WiX (UI Extension) both author this table. Visual Studio Deployment Projects do not because Microsoft (DevDiv) never put the effort in to support it. You can't modify what isn't there.
Now if you are a Windows Installer expert ( which I doubt otherwise you wouldn't even be posting this question ) there are things that can be done. You can write postbuild commands to modify the built MSI to perform SQL updates and/or apply transforms to inject a custom authored dialog into your MSI after VS is done building it.
I've been down this road, I know how to do it. I also know how counterproductive it is as you'll find yourself doing it ALOT to make up for the short comings of the tool. At that point you understand why WiX / InstallShield is needed and move on.
And for the record, I once quit a very well paying job because VDPROJ is all the development managers would allow. I also returned a couple years later for even more $$$$ when they finally realized that they didn't know what they were talking about.
Good luck.

Related

Clear visual studio debugger's saved connections in attach to process dialog

I need to clear some old entries saved for Connection target dropdown list in Attach to Process dialog.
Some remote servers have been decommissioned. But their names are still listed on the top of Connection target list.
When I start the Debug menu command "Attach to process", it takes awhile trying to connect to an old server that is not connectable.
Google search doesn't return the answer of where the list is saved.
Hopefully someone can provide the answer.
After quite some digging I've found the answer you might be after (if you still need it), the web page you'll need is at Microsoft Learn.
If you want to dive straight in have a look in the Tools Menu under Options and then find Cross Platform and Connection Manager:
I'm using Visual Studio 2022 17.4.3 (current version as of Jan 2023) just in case other versions have a different layout.

How can I save code changes in debugging mode in vb6

When an app stops in debugging mode and I make changes to the code
Is there a way to save the code with the changes, without stop the app?
Although the VB6 IDE does not provide this natively, an add-in for the IDE called MZTools has been around for ages which adds this feature.
Personally I've used MZTools 3.0 for many years, and this works really well.
This is what its help system says:
Shortcut To Save File At Debug-Time
The Shortcut To Save File At Debug-Time feature allows you to define a keyboard shortcut (Options
window, Shortcuts tab) to save the selected file at debug-time. The
Visual Basic IDE does not allow to save files at debug-time, but often
it is useful to save the modifications that you have made to the
source code at debug-time.
Remarks:
This feature is not available in the VBA version of MZ-Tools. This
feature only works at debug-time. Since Visual Basic disables buttons
or menus of add-ins at debug-time, the only way to save a file at
those times is through a keyboard shortcut. The file must be
previously saved at design-time, that is, MZ-Tools does not prompt for
a name to save the file (it shows an error message instead).
This is the options window for how I have it configured locally:
Note that originally MZTools was free in version 3 and later they switched to a paid version; if I hadn't gotten v3 originally however it would be well worth paying for, not only for this feature.
The short answer is you can't.
If you make the project before the crash, maybe this piece of code can be found in a ".tmp" file. But searching in .tmps is often a waste of time.
I particularly always force myself to stop the debug and save my progress.
And I always use this setting which forces me to remember to save:

Create MSI and Enforce All Users with Visual Studio

I have created an installer using Visual Studio 2015 (with the Visual Studio installer addon). The goal is to always run the APP with the same local resources, regardless of who is logged on, therefore we target [CommonAppDataFolder] (C:\ProgramData... on Win10). The installer works just fine placing all shared resources where we want them. But the generated MSI provides the option to install as "everyone" or just the "just me"
We want to grey out the option to install as "just me".
Is there a way to do this from within Visual Studio as part of the build process for the MSI.
I see some solutions that involve running MSIEXEC with different parms eg, ALLUSERS, but I am wondering if there is a way to set this up to occur automatically in Visual Studio.
Thank you.
The project Properties window (NOT properties) can be shown by selecting the project in Solution Explorer, and then F4. You can set InstallAllUsers to True there.
The Properties window of the InstallFolder dialog has a settting InstallAllUsersVisible, so just set that to False.
I don't use that particular tool. There might be a better way to
achieve what you want than the below "hack". Adding since you got no other answers (yet).
UPDATE: Go with Phil's answer. I don't have the tool to check but it looks good. Leaving in this answer just for the record. Not recommended unless you have other things you want to change.
Post-Process MSI
Hiding Control: Not ideal, but if you don't mind post-processing the MSI (can be automated with MSI API coding) you could insert a row into the ControlCondition table to hide the whole dialog control in question.
Ad-hoc sample: Hiding the "Back" button from a setup's LicenseAgreementDlg - just add this row (I guess events defined elsewhere could show it again):
.
Dialog at runtime: Below is the actual dialog at runtime.
MSI API
To automate the above. Get hold of WiRunSQL.vbs - part of the Windows SDK - just search your SDK folder if you have Visual Studio installed. Also plenty of copies on github.
In a batch file:
cscript.exe "%~dp0"\WiRunSQL.vbs "MySetup.msi" "INSERT INTO `ControlCondition` (`Dialog_`, `Control_`, `Action`, `Condition`) VALUES ('LicenseAgreementDlg', 'Back', 'Hide', '1')"
pause
I honestly might hard code ALLUSERS=1 in the Property table as well.
Links:
SQL modification of MSI file
List tables in MSI file using VBScript
Windows Installer Scripting Examples

Stop Visual Studio asking for each project: has been modified outside the environment. Do you wish to reload?

Do you wish to reload the project? Where's the Reload All option.
Vote for this question and hopefully MS will implement a fix in VS2020.
With pleany of projects in a solution I for one dread doing an svn update.
This has been an issue from VS2003 but after a decade of clicking mindlessly on buttons it's getting on my wick.
Does anyone have a hack / registry entry / secret way of saying yes short of saying ignore (quick), closing and reloading the solution?
There are a couple of options you can tweak for this scenario. Both are under the Documents Options
Tools -> Options
Environment -> Documents
The first option is to just uncheck "Detect when files changed outside the environment". This will stop the reload dialog but will force you to manually reload.
The second option just below it is a bit better "Auto-load changes, if saved". This will just automatically load the changes without prompting you for every project.
Personally though I would go a slightly different route here. The problem is occuring because your managing your source code control outside of Visual Studio. If you switched to using an addin to manage within Visual Studio it would remove these problems altogether. For svn there are several free packages available including Ankhsvn which is fairly popular
http://msdn.microsoft.com/en-us/library/ms165643(VS.80).aspx
DetectFileChangesOutsideIDE
Get/Set (Boolean)
Determines whether the environment automatically reloads files opened in the IDE when the operating system notifies the IDE that the files have been modified on disk.
EDIT:
Some clarification, as that page isn't immediately obvious.
Tools Menu->Options -> Environment->Documents->Uncheck Detect when file is changed outside the Environment

Why does my VB6 IDE loses its buttons and menu items?

I still have to use the VB6 IDE.
Unfortunately every time I start the IDE one of the buttons of the toolbar disappears. Almost always it's the Run button which goes first. Sometimes also items from the menu bar or the context menus are missing.
I have to reset the toolbars almost every time I start the IDE (Which is quite often during a typical work day). Recently I bought an IDE plugin which modifies the menu bar and requires a restart after every reset of the menu bar. (Otherwise it would crash)
I could live with just the resetting, but the restart is really annoying.
Is there something I can do?
To solve this problem:
Unload all add-ins.
Right-click on a toolbar and select the Customize... menu.
For each toolbar click the Reset... button (6 times in total).
Reload the add-ins.
For me action 3 was enough.
cf. MZTools faq (thanks to Andrea Bonafini), but these steps are originally from MSDN
It sounds like you recently bought a bad add-in. Can you get your money back? Every time I've had problems with disappearing controls in the IDE it has been due to a bad add-in. You can find out which one it is by disabling them, one by one, each time using the IDE for a while, then re-enable it and disable the next one, until the problem stops.
I still use one problematic add-in. It exhibits behavior similar to yours in that it makes the run button disappear. I avoid the problem by only loading the add-in when I need it, use it (it formats code), then I immediately unload it. If you don't use the functionality of the add-in that often, this could be an acceptable workaround.
Yea, i have this same problem with one of the add-in. But if you reset it. Shut the IDE down and open it back up again without doing anything, the IDE shouuld be able to retain the previous clean setup.
It's just guest, but:
Each graphical element on IDE (like button) is kind of resource (i.e. GDI handle).
Maybe your VB app doesn't manage these resources good enough and after sometime VB IDE cannot redraw elements like buttons (run is used often).
Also, maybe some IDE add-in is in conflict with some other add-in/application and breaks something -- I have this problem with Clip-X and MZ-Tools.
I had a similar problem when I was setting up the IDE to use for the first time, though it may not be helpful if you've been using the same IDE for a while. When I first started using the IDE, I would modify the toolbars and then close the IDE. When prompted if I wanted to save the open file I always said No, since the file was just a dummy file I was using to open the IDE with. Turns out the IDE was saving the toolbar preferences with that file, so they never got saved.
Try opening a file, customizing the UI, saving the file, then closing without modifying the code. This was the solution for me.
I've tracked down the problem and as suggested it was an add-in.
The problem went away as soon as I disabled the Visual Basic 6 Resource Editor.
How to restore your VB6 IDE without reinstalling:
Run Regedit
Find the entry for Visual Basic 6.0
Export your settings in case things
go wrong
Delete the 'UI' setting
Run VB and you will have your popup
menus back
The 'Find' button disappeared from my VB6 toolbar forcing me to select the Edit menu to use Find. I had two add-ins enabled: vbCodePrint and ResourceEditor; so I did away with both of them, turned VB6 off and back on, then put both add-ins back in and my button returned.
If you're still using the VB6 IDE, and I do amongst others, then this problem is not likely to have gone away. I use VB6 in Windows 10, and the problem is still there. But it doesn't affect me anymore.
I have had this problem a few years into using VB5 and VB6. Today, if I start VB6 directly, it may work fine the first time, but buttons will go missing the second time -- ALWAYS.
My solution, which I developed from day one:
Do whatever needs to be done to restore all your buttons. Save the Visual Basic 6.0 registry settings to a file, as suggested previously, and only keep the UI entry. Sometimes, you have to exit VB6 for it to post changes to the registry. So if this doesn't work the first time, try exiting before saving the settings.
I use my own program to launch VB6, which automatically copies my VB6 registry backup back into the registry -- by calling "RegEdit.exe /S D:\VB\IDE_Fix.reg" -- before I launch the IDE . This works every single time, and requires no action on my part.
If you read this, that means you are a programmer. You can make this work by yourself.
Mike
Reinstall,clean registry and update with SPacks etc....

Resources