Which Visual Studio $variable is the .exe? - visual-studio

Which Visual Studio (2010 (Professional (64-bit (on Windows 7 (Professional (64-bit)))))) points to the .exe name?
Some examples of variables are:
Variable Sample value
=================== =============================
$(TargetPath) C:\...\obj\Debug\Project1.exe
$(ItemPath) C:\...\Project1.csproj
$(SolutionFileName) Solution1.sln`
$(ProjectFileName) Project1.csproj
i need the executable, e.g.:
$(ExePath) C:\...\Bin\Debug\Project1.exe
Except $(ExePath) is something i just made up.
Note:
$(TargetPath) references the obj path. i need the target bin path

$(TargetPath) is the application to run eg. in the debugger

You can list all variable by go to project Properties/Build Events/ Edit Pre- or Post-build... and click on Macros >> button.
Specially for builded .exe you need $(TargetPath)

According to MSDN, it's $(TargetPath).

There is no official variable for the path to .exe in bin directory, but you can use
$(BinDir)$(TargetName)$(TargetExt)
to achieve the same effect.

Related

How do I create or modify a VB6 exe Version resource block to make it Squirrel-Aware

I have this crazy idea to take a large VB6 app we are continually migrating to .NET and use the Squirrel for Windows installer. It seems I need to make the VB6 app Squirrel-Aware as described here -- add VALUE "SquirrelAwareVersion", "1" to the Version resource block.
The problem is I'm very unfamiliar with rc files and there are only bits of documentation on the format, encodings, etc especially when working with VB6. I think I need a command line tool that can add this VALUE "SquirrelAwareVersion", "1" to the Version resource of an existing exe, OR figure out how to get VB6 to use a custom .res file with all the version data in it.
Most tools only seem to modify basic resource info like icons, manifests, and strings. I would need something capable of modifying or replacing this version data.
I've attempted to create a basic .rc. I make an empty file with the name MyApp.rc. Open the file with Visual Studio. Add a "Version" resource and attempt to compile it to .res with RC.exe but I get all sorts of errors from this file generated by Visual Studio. If I close and reopen the generated RC file, even Visual Studio can't open it. Could be an encoding problem? I'm not sure how else to create a valid RC file.
You can use Resource Hacker utility in CLI mode to replace whatever resources you need to in your final executable. It can even compile .rc files to .res file with something like this:
c:> ResourceHacker.exe -open Project1.rc -save Project1.res -action compile
Then use something like this on the command line to add new or replace existing resources from a .res file into your final executable:
c:> ResourceHacker.exe -open Project1.exe -save Project1.exe -action addoverwrite -resource Project1.res
Add -log NUL parameter to suppress console output if you need to.
Make a res file in VB6. VB6 only allows editing of certain things. Use ResHacker to add anything else you want to the Res file. VB6 add it's own version so you may need to do it to the exe file. http://www.angusj.com/resourcehacker/

Issue with dotNerInstaller Getting error "The installation package could not be opened. Verify..."

When I create exe within the C:\Program Files\dotNetInstaller\bin folder, and run it, it works perfect, install perfect, but when I try to install that exe from any other location/path, the error appears "The installation package could not be opened. Verify that the package exists and that you can access it. etc....."
I created an exe and moved to another XP system, on that system, it again gives me error ?
whats the solution ? Is there any admin rights issue ?
I have tried with both TRUE and FALSE of Administrator_Required option.
any idea how can I solve this issue ?
The issue is resolved now.
I should have written #CABPATH\ in the MSI->Package field. Before I was writing #TEMPPATH\
I think you can should add the location:
C:\Program Files\dotNetInstaller\bin
in the PATH environment variable. Follow the steps: Go to
My Computer->Right click->Properties->Advanced System Settings
->Click Environmental Variables. Now click PATH and then click EDIT.
In the variable value field, go to the end and append ';' (without quotes) and then add the above path.

WiX can'f find my file : unable to load file, error LGHT0103

I am using WiX 3.5 and making an installer. I have used heat.exe to bundle all the files.
It produced a WiX file. I referred in main wxs files as componentgroup ref. When I build my installer, it throws the following exception.
light.exe : error LGHT0103 : The system cannot find the file
'..........\target\tmp-release\jboss-eap-5.0\jboss-as\server\all\deploy\httpha-invoker.sar\invoker.war\WEB-INF\classes\org\jboss\invocation\http\servlet\ReadOnlyAccessFilter.class'
with type ''.
It is able load many files from this location, except the above file, even though the file is present.
Looks like you've hit the linker bug. As far as I can see, it was already reported to the WiX team, and was scheduled for v4.0. The comment to the issue states the path is more than 255 characters, so a possible workaround for you is to re-work the files/folders layout to avoid the paths of that length.
Hope this helps.
The answer of Ravz1234 works ! I used it with a environment variable e.g. env.SourcePath.
1) Set an environment variable to show on your Source Dir e.g. C:\SourceDir
2) On heat.exe add the argument -var env.SourcePath along with the other arguments
I used the variable for the directory, sys.SOURCEFILEDIR, and it worked well.

How to set a relative path in a Generic Test's(Visual Studio 2010) working directory and summary results file

How to set a relative path in a Generic Test's(Visual Studio 2010) working directory and summary results file ?
As far I looked there is no way to set these locations programmatically in Generic test because the generic test has only properties page and no page to write C# code.
I have a folder structure as follows
c:\Files\GenericTestFolder\generictest.sln
c:\Files\SummaryFiles\summary.xml
Now I need to set the working directory to the following (To run an external program)
c:\Files\
And the Summary Results file location to:
c:\Files\SummaryFiles\summary.xml
I tried the following options to set the location of working directory(WD) and summary file(SF) location :
setting WD to "..\" or ".\" or "\" -> all of these seem to set the directory to c:\, so this is not useful for me.
Using a visual studio's inbuilt environment variable like %TestDeploymentDirectory% don't seem to work with "..\" , i.e %TestDeploymentDirectory% ..\ does not translate to parent of %TestDeploymentDirectory% during runtime.
You can use %TestLocation%. Which represents the location of the .GenericTest file.
Source

.net 3.5 SP1 Bootstrapper not found for Setup

I am getting a warning when trying to include the .net 3.5 sp1 prerequisite for my setup project. The warning states Prerequisite could not found for bootstrapping.
Any suggestions?
Thanks
I followed the directions in 2.3.1.1 Enable Samesite for the .NET Framework 3.5 SP1 bootstrapper package and now everything works perfect.
Thanks
Ultimately, having had the same issue as the creator Ryan, I solved my delima by folling these steps:
Update the Package Data
Open the [Program Files]\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder or %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems
Edit the Product.xml file in Notepad.
Paste the following into the < PackageFiles > element:
<PackageFile Name="TOOLS\clwireg.exe"/>
<PackageFile Name="TOOLS\clwireg_x64.exe"/>
<PackageFile Name="TOOLS\clwireg_ia64.exe"/>
Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-x86-en-US.exe" and change the PublicKey value to: 3082010A0282010100A2DB0A8DCFC2C1499BCDAA3A34AD23596BDB6CBE2122B794C8EAAEBFC6D526C232118BBCDA5D2CFB36561E152BAE8F0DDD14A36E284C7F163F41AC8D40B146880DD98194AD9706D05744765CEAF1FC0EE27F74A333CB74E5EFE361A17E03B745FFD53E12D5B0CA5E0DD07BF2B7130DFC606A2885758CB7ADBC85E817B490BEF516B6625DED11DF3AEE215B8BAF8073C345E3958977609BE7AD77C1378D33142F13DB62C9AE1AA94F9867ADD420393071E08D6746E2C61CF40D5074412FE805246A216B49B092C4B239C742A56D5C184AAB8FD78E833E780A47D8A4B28423C3E2F27B66B14A74BD26414B9C6114604E30C882F3D00B707CEE554D77D2085576810203010001
Find the element for < PackageFile Name="dotNetFX30\XPSEPSC-amd64-en-US.exe" and change the PublicKey value to the same as in step 4 above
Save the product.xml file
Download and Extract the Core Installation Files
Navigate to the following URL: http://go.microsoft.com/fwlink?LinkID=118080
Download the dotNetFx35.exe file to your local disk.
Open a Command Prompt window and change to the directory to which you downloaded dotNetFx35.exe.
At the command prompt, type:
dotNetFx35.exe /x:.
This will extract the Framework files to a folder named “WCU” in the current directory.
Copy the contents of the WCU\dotNetFramework folder and paste them in the %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder (%ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems). Note: Do not copy the WCU\dotNetFramework folder itself. There should be 5 folders under the WCU folder, and each of these should now appear in the DotNetFx35SP1 folder. The folder structure should resemble the following:
o DotNetFx35SP1 (folder)
dotNetFX20 (folder
dotNetFX30 (folder)
dotNetFX35 (folder)
dotNetMSP (folder)
TOOLS folder)
en (or some other localized folder)
dotNetFx35setup.exe (file)
You may now delete the files and folders you downloaded and extracted in steps 2 and 4.
Found at Microsoft Solutions
For VS 2015, here is a very simple solution (including some Michael Eakins answer):
Download the installer here:
http://go.microsoft.com/fwlink?LinkID=118080
Extract / open with 7zip or Winrar and extract the contence to a folder
Copy/move everything under the extracted folder "wcu\dotNetFramework" path to:
C:\Program Files (x86)\Microsoft Visual Studio 4.0\SDK\Bootstrapper\Packages\DotNetFX35SP1
Publish in VS2015

Resources