How to create a SnoreToast start menu shortcut with a Working Directory to a .BAT file? - node.js

Using node-notifier#7.0.0's SnoreToast on NodeJS v13.13.0, I am trying to create a Start Menu shortcut to use as appID for SnoreToast's notifications, I have a .BAT file that runs the command node "src\index.js", and I'm assigning this .BAT file as the target application of the SnoreToast shortcut as seen below:
"..\node_modules\node-notifier\vendor\snoreToast\snoreToast-x64.exe" -install "SomeAppName\SomeAppName" "c:\Users\Redacted\Desktop\proj\start.bat" "app.someappname"
The shortcut is successfully installed on the Start Menu in a folder named SomeAppName and the shortcut itself named SomeAppName aswell, and when I open the shortcut, it targets the correct start.bat file, but the start.bat is unable to fullfill it's purpose due to the shortcut opening it on C:/WINDOWS/System32 and ultimately wrongly targets C:/WINDOWS/System32/src/index.js, causing it to fail.
By manually editing the shortcut's "Start in" option on the Properties dialog in File Explorer to the correct path of my project (C:/Users/Redacted/Desktop/proj) and saving, it runs perfectly, but obviously I don't want to make my users have to manually do this work + the application should be portable and runnable anywhere it's stored on the FS, so how would I edit the "Start in" (aka Working Directory) of a SnoreToast shortcut on creation? I've already tried to Google it but all the results are unrelated and SnoreToast's documentation doesn't address this issue either.
A solution that does not require any additional npm packages would be preferred, but one that uses an npm package is acceptable aswell. All help is appreciated.

Related

Missing Browse Tab in the Reference Manager dialog box

I have been trying to add a local .dll file to my project as I need some built in commands it has for my offline simulation connecting to a GPIB. The problem is I am missing the "Browse" tab to search for the .dll file to add.

How to use a folder and file with the same name but different case from github in windows 10?

I want to clone a github repo that uses two different files/folders:
\packages\ - Folder
\Packages - File
However, due to windows not using Case Sensitive File/Directory Names, this isnt working, it gives me the error that the folder cant be renamed because a file already has the same name.
The program that uses this project REQUIRES that there be a no-extension binary text file Packages (Its like a giant file full of control files (If you recognize linux debian youll understand)
But it also requires a folder named \packages\ to hold the json files containing the config data for each control file within Packages
This question is an updated form of this previous question, which is outdated, and doesnt have an answer that solves the problem: Working in git with directories with the same name but different case in Windows
From Windows 10's update in April of 2018, they added a feature to "enable" case-sensitivity on specific directories.
I simply used the command on my github storage directory and now my project works fine.
To use the feature: Open a command prompt window (I dont believe this requires Administrator, it didnt for me)
Copy the full directory path to the folder you want to enable the flag on, type in the console:
fsutil.exe file SetCaseSensitiveInfo #:\Path\To\Directory\Here enable
Paste your C:/D:/E: or whatever Drive path into the location above. Then hit enter.
You DO NOT need to restart your computer, the flag seems to take effect immediately
Info sourced from: https://www.windowscentral.com/how-enable-ntfs-treat-folders-case-sensitive-windows-10#enable_case_sensitivity_ntfs_windows10

Does VS make a 'virtual solution' for projects without a solution?

Having opened a specific Visual Basic project from source control mapped folders, the project appears to have a solution — containing only it. The properties window says the path is the same folder as the project, but I can’t find the solution file at the specified path OR anywhere in my local drive.
Is it possible the solution file was somehow not checked in or doesn’t exist?
Actually, that's just an unsaved solution.
If you hit Save All, VS will show a Save As dialog for that solution file.

For InstallShield, How can I get a path from the user by browsing the computer?

I am packing a plugin for another program, thus I need to get the path of the pre-installed program (proe 4.0) and set an environment with it.
Now I used "Requirement" function in InstallShield to search the file of proe 4.0.
The problem is, this "search" function cannot find the install directory in some of the conditions, such as in a nonstandard installation.
I want to show a dialog with a browse button and a text box to allow the user to define the installation directory themselves. How can I do that?
I found the solution which is very easy for advanced users: use a script project, and in the setup vbs script you can find everything you want.

Can I keep the application settings when updating with installshield?

I finally managed to get my application updating through installshield LE, without the user having to uninstall manually first, what I am now wondering is:
Can I get the installer to use the application settings from the previous install, so the users saved settings don't change, causing the user to enter their settings every time there is an update. But at the same time, add any new settings to the config file.
Is there anyway to get the installer to not update certain files, for example, the database file is held in a folder called 'db' inside the program files directory, I obviously don't want the users database getting overwritten with a blank one.
Thank you.
Im not sure what programming language you are writing in, but I had this concern with a C# application I wrote. I see 2 easy ways of doing it:
1) With C# you can setup application setting variables that get written to an XML file in the users Application Data (on WinXP) directory. The nice thing about this is that writing to and reading from the settings file is really easy through the API:
To save and store a variable:
Properties.Settings.Default.UserName = UserName_txtbox.Text; // save contents of UserName_txtbox to UserName setting variable
Properties.Settings.Default.Save(); // write variable to file
To restore a variable:
UserName_txtbox.Text = Properties.Settings.Default.UserName; //load contents of UserName variable to UserName_txtbox
Because the file that contains these are not included in the installation directory of the application, they are preserved.
If you are using a different programming language, you can try to implement the same concept.
Create a settings file that your program updates externally from the install location. (Perhaps it can be in the install location. Im not sure how your installer "updates". Does it replace files or uninstall the old version and install the new version automatically? Play this this to find out...)
Your settings file can be a simple txt file, a bin file, an XML file, etc. Anything that you can read and parse easily. Then you can load settings from the file when the program loads and save settings to the file when the program exits.

Resources