-
-
Save mesarvagya/82de65408d5f7fddf681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.Deployment.WindowsInstaller; | |
namespace SetupCAInstallFolder | |
{ | |
public class CustomActions | |
{ | |
[CustomAction] | |
public static ActionResult InstallFolderFinder(Session session) | |
{ | |
session.Log("Here is the SetupCAInstallFolder"); | |
string path = session.CustomActionData["INSTALLEDPATH"]; | |
session.Log("Original Installed Path is " + path); | |
path = path.Replace(@"\", @"\\"); | |
session.Log("New Installed Path is " + path); | |
try | |
{ | |
System.IO.Directory.CreateDirectory("C:\\tempdir"); | |
} | |
catch (Exception e) | |
{ | |
session.Log(e.ToString()); | |
} | |
System.IO.File.WriteAllText("C:\\tempdir\\" + "installed.txt", path); | |
session.Log("Written in the file OK"); | |
return ActionResult.Success; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment