Use an app made by Unity 3D as Windows XP screen saver - windows

I made a small application on Windows 7, using Unity 3D, by the way. The application consists of an executable and a data folder. When the data folder is in the same directory as the executable, double clicking the executable will run the app normally.
Since I wanna use it as a screen saver, I simply changed the extension name of the executable from EXE to SCR and then I could install it by right-clicking the executable and choosing 'Install' in the menu. Thus the system could find my app as a screen saver.
However, when I copied what I built and tried the same steps on another computer with Windows XP, there were problems. I could run the app itself, but when I installed it as a screen saver, there'd be an error message indicating that the data folder couldn't be found. So my question is what I should do to make an app more than a EXE file work as a screen saver on Windows XP.

The data folder isn't found because by default when running as a screensaver the "current" directory it runs from is %WINDIR%\system32. The easiest way to get around this is copy your _Data folder to the relevant path (eg C:\Windows\system32\_Data).

Related

How to hide terminal shell on server application like Warp in Windows?

I have a small warp server project on Windows that listen to a particular port and do something whenever I send a command to it by REST (for example: POST http://10.10.10.1:5000/print). It's a small client for printing PDF / receipt directly from another computer.
It works. But my problem is when I had to package the whole project, the Rust compiler give me an executable file (.exe). The application displays a terminal window when I run it. I want this terminal to be hidden somehow.
I try to run the program as a windows service (by using NSSM). It doesn't work for me since I had to access the printer. Windows doesn't allow my app to access any devices or any other executable as a windows service. (The reasons are explained here: How can I run an EXE program from a Windows Service using C#?)
So I plan to run my app as a tray-icon application so user can control or close the app. (https://github.com/olback/tray-item-rs)
Unfortunately, I still cannot hide the app's terminal window.
Another solution that I found is hstart (https://www.ntwind.com/software/hstart.html). But I would like to use this as "the last resort" solution since many antivirus/windows defender mark it as a malware.
Do anyone know how to hide or get rid of it ?
After lot of searching, It turns out to be easier than I thought. Just add
#![windows_subsystem = "windows"]
on top of your main.rs file. (for rust > 1.18) and the terminal is gone.
These control the /SUBSYSTEM flag in the linker. For now, only
"console" and "windows" are supported.
When is this useful? In the simplest terms, if you're developing a
graphical application, and do not specify "windows", a console window
would flash up upon your application's start. With this flag, it
won't.
https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute
https://blog.rust-lang.org/2017/06/08/Rust-1.18.html
https://learn.microsoft.com/en-us/cpp/build/reference/subsystem-specify-subsystem?view=msvc-170

Notifications not working on Windows 10 - Electron JS

I was learning Electron and made a basic electron app and packaged it for windows. The app was not showing notifications so I followed the instructions here
On Windows 10, a shortcut to your app with an Application User Model ID must be installed to the Start Menu. This can be overkill during development, so adding node_modules\electron\dist\electron.exe to your Start Menu also does the trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'. You will then need to add the line app.setAppUserModelId(process.execPath) to your main process to see notifications.
I did as suggested here and the notifications started working. They were still working after packaging the app. So I wanted to check whether after a user uses an installer to install this app, the notifications would still work.
I don't have any experience with packaging software, and I used InstallForge to make an installer. Turns out, after installing the app using the installer, the app still works but notifications don't, even after pinning the exe to start.
I tried copying the build folder (direct build, not the installer one) to another location and trying the same thing and it still works. This also works if I copy the installation folder to another location. But it does not work from inside Program Files(x86)\myapp\appname\build\myapp.exe so I am assuming this must be something about permissions, but I do not understand exactly what is happening. I have't checked the app yet on Linux so I don't know if I would face similar problems there as well.
Any pointers would be great, Thank you.

Generated Thumbnails on some Windows installations overruled by icon of associated program

I have written a Windows thumbnail handler for specific file types. I have two pc's running Windows 7 Enterprise. On one pc everything goes well. On the other pc, the thumbnail generation works only when there is no program associated with the file extension. In that case the thumbnail generation is taken over by the associated program (I see an icon). Changing the associated program (e.g. to Notepad++) changes the icon. I suspect this to be a registry setting, or a folder view option, but I have no idea where to start looking.
Answers appreciated.

Need to Create Screen Saver from Scratch

I've hit a bit of a stump on the road to my goal of creating a screen saver. Before I began this project I did research and everyone urged me to create the screen saver using flash.. in which I did. Now I face the issue of converting it to an SCR (screen saver format for windows) . Now I've done my research and downloaded Instantstorm only to be disappointed by it's lack of 64-bit support and/or Multi-monitor support (Scaled mirroring across screens if resolution of main screen is different from other screens).
Can anyone tell me what is the proper way of creating an animated screen saver from scratch (or from the flash file I created preferably) which is fully compatible with 64-bit and has the ability to display the screen saver on multiple monitors.
Since it's a flash app you may be able to run it through a browser/as a web page. See this post for additional info:
webpage as a screensaver windows 7 and XP?
When I create screensavers, I do it through java, and then use launch4j to convert it to a .exe file. I then rename that .exe file .scr.
If you have issues renaming the file, go to control panel>folder options and uncheck "hide extensions for known file types". You can then rename the file.
P.S. If you are able to create a .exe file with flash, then you can just rename it from .exe to .scr as the extenstion.

How do I automatically run an application on USB attach or CD insert on Mac OS X?

Is there any way to automatically launch an application on USB attach or CD insert on Mac OS X? it's easy on Windows, but I found that AutoRun.Inf does not work on the Mac at all.
You can't. Autostarting applications is impossible under Mac OS X.
The next-best thing, opening the CD folder and showing the installer icon, can be done by using (AutoOpen version 1.0) to make a .dmg which can then be burnt to a CD.
Basically, auto-run is considered a security problem and so is not supported in OSX. Sophie Alpert's answer is also a bit overkill. Most installers for OSX simply open up a folder to show the application and, possibly, a readme. Installing is done by dragging the app to your Applications folder.
For other kinds of apps on CDs (say, a slide show or something like that), the developer generally uses hidden folders to hide support data to ensure that the only thing the user will see when they open the CD is the single icon they're supposed to double click to start the app.
It is possible to install a background service that monitors whenever a USB device is plugged in and then launches an App. Google's "Android File Transfer Agent" is such a service that is running in the background and launches "Android File Transfer" whenever you plug in an Android device.
If you are looking for something for just yourself, you could write a small mac app that runs in the background and watches for a particular USB device (by id) to be attached and then run the program. Ideally a small XML plist could be used to map device IDs to the correct program to run. The XCode SDK has sample code that monitors for device additional and removal to get you started.
I agree with JavaCoderEx. I would crontab a task that looks for /Volumes/*/autorun.sh, then runs it once. Maybe touch a file in /tmp/ so you know its already been run, then remove it if the volume disappears.

Resources