Custom Tasks for Setup and Deployment project decide based on user input and put files in system32 folder
-
Friday, May 18, 2012 4:37 AM
I have two files and ESSETL1.ini and ESSETL2.ini in two folders in my installation project
- Based on the user Radio button click
- I want to put ESSETL.ini in Environment.SystemDirectory(system32) folder is it possible..?if yes please help me with the installation project...
$Kracker
- Edited by SKracker Friday, May 18, 2012 4:38 AM Corrrectness
All Replies
-
Friday, May 18, 2012 9:15 AM
You can do this stuff in custom action ask user for his choice and and just copy the file at the whatever path you want.
For adding custom action to set up project here is some useful links.
http://www.c-sharpcorner.com/UploadFile/mgold/CustomInstallMG11102005235312PM/CustomInstallMG.aspx
http://www.eggheadcafe.com/tutorials/csharp/dcc5ab62-b875-4852-9e34-8bc2794e4fb8/c--create-setup-project-which-also-include-multiple-applications-in-one-setup.aspx
Best Regards Sanjay Pant [Metadesign Solutions]
-
Wednesday, May 23, 2012 9:31 AMModerator
Hi Skracker,
How is it going with Sanjay's suggestion?
Yes, you can.
First, create the Special Folder "System Folder" in the File System, and then add these two files in the Folder. To 64-bit installer, the special folder should be System Folder(64-bit). For more details, see http://msdn.microsoft.com/en-us/library/cd7a85k9(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/s2esdf4x.aspx
Second, set the Radio button condition for the two files, see http://msdn.microsoft.com/en-us/library/9x23561f(v=vs.100).aspx.
If there is anything unclear, please let us know.
Best Regards,
Bob Wu [MSFT]
MSDN Community Support | Feedback to us
- Edited by Bob Wu-MTMicrosoft Contingent Staff, Moderator Wednesday, May 23, 2012 9:32 AM add Special Folders link
-
Thursday, May 24, 2012 7:27 PMModerator
There's an example here, just using the buttons and the properties and no need for code:
http://msdn.microsoft.com/en-us/library/taa17f7s
Phil Wilson
-
Friday, May 25, 2012 12:51 PM
Installer is working great but the problem is how to make the file to be saved in the windows/system32?
Can we do like this in my installer class..?
public override void Install( System.Collections.IDictionary stateSaver ) { base.Install( stateSaver ); File.Copy(File.GetCurrentDirectory+"\\ESSETL1.ini",Environment.SystemDirectory+"\\ESSETL.ini"); }
but where will be the File.GetCurrentDirectory be pointing to..?
$Kracker
-
Friday, May 25, 2012 6:48 PMModerator
I'll repeat that you don't need code to do this - just look at the link I gave you. It's a complex mess to use code because you're running as a call from an msiexec.exe process. Also, when you build the setup project all your files are inside the MSI file, that's the default. Where do you think you are copying it from?
In the File System View in the IDE of the setup project, Right click on File System on Target Machine, then Add Special Folder, then add System Folder. Put your file in there, and have a condition on it based on the property of the RadioButton as in the RadioButtons example in the link I posted.
Phil Wilson
- Marked As Answer by SKracker Saturday, May 26, 2012 9:46 AM
-
Saturday, May 26, 2012 9:46 AM
Is what i wanted i was into complete complicated process of overriding the installation processIn the File System View in the IDE of the setup project, Right click on File System on Target Machine, then Add Special Folder, then add System Folder. Put your file in there, and have a condition on it based on the property of the RadioButton as in the RadioButtons example in the link I posted.
Phil Wilson
$Kracker


