Visual Studio Post Build Run Exe not running - visual-studio-2012

I have a exe that creates/alters a file in the same directory as the exe. I can run this manually and it works. But i cannot get it to run as part of a post build event in visual studio.
Below is what is in the Post Build event box:
"$(ProjectDir)\WebSiteVersion\Versioner.exe"
I dont get any errors or exceptions but the file is never created in the directory.
Can anyone help?

Verify that the copy/create you are issuing through the exe has absolute path rather than relative for starters. Also check if the exe actually runs as a post build event by either seeing the logs or procmon.

Verific the path of your exe
in my project i added notepad.exe i it still work
maybe you are forgeting something in post-build event
well here my commands
copy "$(TargetDir)XXXXXX.exe" "$(SolutionDir)Deploy\"
notepad.exe
exit 0

Related

I am not allowed to run a python executable on other pcs

I was doing a game in tkinter, then I make it executable with PyInstaller and sent it to my friends so they can run it and tell me how it feels.
It seems that they could download the file, but can't open it because windows forbade them telling that it's not secure and not letting them choose to assume the risk or something.
They tried to run as administrator and still nothing changed.
What should I do or what I should add to my code so that windows can open it without problem and why windows opens other executable files without saying that(current error that my executable gets)?
compress it as a .zip file and then it will most probably work
or install NSIS and create a windows installer for it.
I finally figured out what I had to done
When the dialog appeared u need to click more info and then it will display a Run Anyway button

execute to exe. successful by pyinstaller, but the exe. is not work. How can I debug it

It's work on Spyder (Anaconda3) and execute script to exe by pyinstaller without any errors, but nothing happens when I double click exe (also try cx_freeze, but still not work either).
How can I debug it? Appreciate for your help.
import os,shutil
cur_path=os.path.dirname(__file__)
sample_tree=os.walk(cur_path)
for dirname,subdir,files in sample_tree:
allfiles=[]
basename=os.path.basename(dirname)
for file in files:
ext=file.split('.')[-1]
if ext=="csv":#讀取.csv to allfiles
allfiles.append(file)
elif ext=='log':#讀取.log to allfiles
allfiles.append(file)
for file in allfiles:#Copy csv and log of sample_tree to destfolder
destfile = cur_path
srcfile=dirname + "/" + file
shutil.move(srcfile,destfile)
p.s. python 3.6/pyinstaller 3.3/Win 10
Debugging is s simple enough process.
In cx_Freeze you can find any errors by doing the following:
Before building ensure your script works correctly.
When building from a setup script see If any errors or warnings appear while it turns into an application. Do not worry if you get warnings you get these even when the application works correctly just ensure you know about them since they may give you a clue why it is not working.
When you application has been built it run it from command line. This final step will show up any errors.
Next you need to configure you setup script accordingly and recompile it and finally run through the process again to see if you have fixed the problem.
For Pyinstaller follow the same process.
In both modules the best debugging method is to run it from command line.
You can check your application by opening a new terminal window where the application is located and running it
For Linux and CMD (Windows):
yourappname
and for PowerShell:
./yourappname

Opening Microsoft Visual Studio Code from command prompt Windows

Is there a way to launch Microsoft Visual Studio Code from the command line in windows? I can't even seem to find the directory for code on my computer. It didn't even ask me where to download it.
Navigate to the directory that you want to open and type code . to launch VS Code.
As many folks already suggested ways to open code from command prompt using code . command. This will only open Visual Studio Code Stable build. But If you have downloaded Visual Studio Code Insider build/version (Which has all latest build/features but unstable version) then you need to follow below instructions in windows :
Go to Control Panel\System and Security\System. Click on Advanced System Settings
Click on Environment Variables
Under System Variables tab, Click on Edit for Path Variable
Add a new path C:\Users\tsabu\AppData\Local\Programs\Microsoft VS Code Insiders\bin
(or)
C:\Program Files\Microsoft VS Code Insiders\bin based on location at which you have installed vscode insider in your machine.
Open a new command prompt and type code-insiders . to open vscode-insider
build/version
Short answer:
code your_path your_filename
Long answer:
Here your_path can simply be . if you want to use the current directory as your working path. Or .. for 1 level up, etc.
code is the name of the executable of Visual Studio Code (code.exe). If it doesn't launch, perhaps your VSC path hasn't been added to the path environment variable. Run this command to add it:
set PATH=";C:\Program Files\Microsoft VS Code\bin"
Of course you'll need to specify a different path if your VSC is installed somewhere else.
How can you find out the installation path? (click for screenshot) Go to "Start" menu, type in "Visual Studio Code", right click on the found program, "Properties", check "Target". Now you'll see!
It may come already added to your path when installed. Try using code <filename> in your command line. If it's not you can add the command line script's directory to your path. The command line script's directory is downloaded by default in the following location
C:\Users\<username>\AppData\Local\Code\bin
Point your command prompt to the specific folder that has the file that you want to open. Let's say you want to open the file titled main.scss. Simply run this command:
start code main.scss
If Visual Studio Code is already open, you can simply do:
code main.scss

Opening the code generated from CMake

I am trying to build Assimp to use in visual studio 2012.
Following the instructions on their website: http://assimp.sourceforge.net/lib_html/cmake_build.htm I have tried to build assimp, however I am stuck on the last step "Open the generated solution/project files and have fun"
This is the build folder which was created by CMake - http://puu.sh/fq8kp/cc16e985c3.png
Following the advice of another tutorial I opened this in the terminal and tried to type "make" and launch it. However there isnt a make file so this didnt work. I also typed "install" as there is an install file, however this also did not work.
The tutorial goes as follows:
Type "make" and launch it; you should see the build progressing without issues
When the build is finished, type "sudo make install"; it will ask for your password and install the library!
Any help would be much appreciated!
the 'generated solution/project' in your case (windows) would be the Assimp.sln file. You generated a visual studio solution, so you have to use Visual Studio to build the application.
According to your screenshot, the Assimp.sln file is the 9 KB sized file underneath the one with size 45,120 KB

Command "docpad run" is getting error: "module" is undefined

I've migrated my configurations from docpad.coffee to docpad.js (personal preference on using plain Javascript)
Since then, I'm not being able to execute the command
docpad run
And I'm keep getting this error:
I've validated my configurations against JSLint and made sure there's no syntax error.
I'm good to go with docpad.coffee, but it'd be great if someone could help me on fixing this
You can use docpad.cmd run instead of docpad run to distinguish between the local docpad.js and the global npm-installed docpad.cmd.
This is because windows recognises the ".js" extension as a javascript file and tries to run your docpad.js file when you issue the "docpad run" command. Windows script host is what is used by windows to run js files natively (so actually nothing to do with node or docpad itself). The reference to "module" in the error message is because that is the first line of the docpad.js file and the windows script host doesn't know what "module" is. You can just rename your docpad.js file to .coffee (I believe all javascript is valid coffee script) and then the windows message will disappear.
Edit: I've just went and tested this on the docpad skeleton which has a docpad.js file instead of docpad.coffee. Simply renaming it to docpad.coffee does indeed solve the problem. Renaming it back to .js then causes the 'Windows Script Host' error message to appear when the "docpad run" command is issued.

Resources