How can I selectively delete a Start Menu folder with NSIS? - nsis

I am using NSIS to create install and uninstall wizards to my rather simple app for Windows.
The situation is, my NSIS script creates a shortcut to the app in the Start Menu folder for the installation wizard. So far no problem. Other apps (related with mine) install their shourcts in the same Start Menu Folder too.
The problem is in the uninstall process. I can delete my shortcuts without a problem but, what about of the folder in the Start Menu? I cannot delete it if there are apps alredy there but I would like it to be removed if the folder is empty.
How can I check using the NSIS script if the folder is empty and therefore condition if the deletion of the folder has to happen or not?
Although is not vital I don't like to have empty useless folders cluttering my Start Menu view.
Thank you very much in advance!
Julen.

RMDir "$SMPrograms\yourfolder" will only delete the folder if it is empty

Related

Visual Studio Installer, how can i select any folder using custom dialog

I have made a setup project using Visual Studio Installer. Now in this setup project I just want to have a custom dialog box which have one textbox and one button(BrowseButton), when I click this button a popup for selecting a folder in the target machine may appear.
In other words I want The "Browse For Folder button" or ""browser button" so that I may select any folder in the target machine. Once I select a folder the path should now come in the textbox. Because in the end I would like to save this path in the registry of the target machine.
I have Orca and I did tried to make this custom dialog using it but I am unable to do it.
There is only one browse dialog in those setups, and that's for the main application folder, so there isn't a way to do this. A custom action won't help because they all run after the files are installed.
I don't know why and where you need to browse to, but in most case there is a simple default location (such as an application data folder or a shared folder) that works fine. This really helps during upgrades when the upgrade install may need to do something with that variable location, and any apps will always know where it is. It's easier for the user too.

Custom installation installing empty folder.

i'm new to installshield and am learning how to use it on the fly, I have an installshiled 2011 project that upon a custom installation when i deselect a component from being installed, it is not installing the files, but the folder for those files is created empty, how can i prevent it from being created?!
Thanks in advance.
I solved this by going to Files and Folders under application data,
looks like some one checked the parent node under custom installation, when i checked only the child node it didn't create any unnecessary folders.

Removing extra files after uninstalling a clickonce application

I have a project that uses clickonce to generate the setup.exe. During the run time my program create some extra files like "Log" and "Attachments" inside the User Folder. However, those folders are not removed when I perform an uninstall of the clickonce application from the ARP. These remaining files are interfering the next install.
I know that click once does not support for adding custom action to install or uninstall. I am wondering if is there is a way that I can remove those extra file programmingly after performing uninstall?
One way I have tried was to create a cleanup script and added it as a bootstrapper package to pre-requisite of the click once project. That worked in a way that every time before a new product was installed, the previous dirty data had been removed. However, this messed up the upgrade case.
Any ideas on how to remove the extra files that left by clickonce uninstallation?
Thank you
JS
There is no way to do anything when uninstalling a ClickOnce application other than uninstall the ClickOnce application.
Have you considered putting the files in the ApplicationDeployment.CurrentDeployment.DataDirectory ? Then they will be removed when the application is unisntalled.
If the files are part of the project, you can set the type to Data in the Application Files dialog, and it will automatically place them in the data directory when deploying.
This solution works on multiple re-installations (clean), however it doesn't remove the data on last uninstall or until the next installation takes place.
Stil there is no custom action place on uninstall to remove the files beyond clickonce scope.
Leave a file in to ApplicationDeployment.CurrentDeployment.DataDirectory.
On startup, see if the file exists on conditions network deployed, firstrun (which resets on upgarde too).. success case, it is a first installation or upgrade. Failure case, the application is been uninstalled and installing again .. now you have a chance to clean up the application data.
If the data is sensitive, you may want to use other solution to remove files on uninstall ( as of now I don't see that Microsoft is given us an option)

How to remove a folder from a MonoTouch project?

In MonoDevelop I can right click a file in a MonoTouch project and select "Remove" and it then gives me an option of removing the file from the project. However, if I right click a folder, the only option available is "Delete" which brings up a confirmation box saying that the entire folder will be deleted. How do I remove a folder from a MonoTouch project? Does this functionality exist somewhere or has it not been built yet?
I think the easiest way to do this is to handle all the files outside of monodevelop. Just move it to wherever you like and then delete the folder from inside monodevelop.

HowTo create InstallShield MSI with no files needed locally?

Hello everyone and good day!
Question: I had create a Basic InstallShield Project in my MSVC2010, added some files and primary outputs and press build. Project compiled normally: there was created MSI, setup.exe, setup.ini and (WTF?!) local directory structure of files, which I'm trying to install (for example, "Program Files\My Company\app.exe, ..." files was copied there). I throught that this is not needed folder, so copied my setup files (MSI, setup.exe, setup.ini) to another folder and start installation. When process of installation come on to copy state, installer gave me the error, that no required files (app.exe,...) was found.
Does anybody solve this problem? I think this is the simple one.
Thanks!
You can achieve this by making some changes to the properties in solution explorer. This is so simple as you can compress all in single .exe file. Follow the given below step:
Right Click On Entire solution and Choose Properties as given below
Second step as you can see the dialog box. click on configuration Properties
Third Step
Last step
This is finest and easiest way to achieve the required task.
Answer was found by myself, but thank you all any way...
To create a self-extracted install file you need to open "Releases" tab in your InstallShield Basic project and right click on configuration click "Release WIzard...".
All what I need is at this figure:
Select Compressed from Compression option in properties view.
Simple use the "single image" build. Not cd nor dvd

Resources