Source language: Translate to:

is this even possible

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

is this even possible

Postby stevec » Fri Jan 30, 2015 11:18 am

I have a app that I have password protected. Is it possible that if the password is not correct that the app can be 'self deleted'
I have a script that allows the password to be stored into three variables and if the third on is not correct, than a popup message
is displayed. After the opup closes, I'd like to have the app deleted. Is this even possible?
Here is what I have below;

****************** begin script

SetVar "[password]" "*****"
Delay "200"
lgaDialogLogin "" "Enter your Password"
Delay "200"
If "[PwdBoxPwd]" "<>" "*****"
SetVar "[PW1]" "no"
.Else
lgaDialogLogin "" "Enter your Password"
Delay "200"
If "[PwdBoxPwd]" "<>" "*****"
SetVar "[PW2]" "no"
.Else
lgaDialogLogin "" "Enter your Password"
Delay "200"
If "[PwdBoxPwd]" "<>" "*****"
SetVar "[PW3]" "no"
If "[PW3]" "=" "no"
.AlertBox "" "you have entered the wrong password three times. |deleting application"
StickyNote "15" "73" "you have entered the wrong password three times. |deleting application" "1000"
,FileErase "[PubDir]pass.exe"
Else
EndIf
EndIf

************************************End script

Thanks;
Steve
Steve Christensen
stevec
 
Posts: 226
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: is this even possible

Postby Neosoft Support » Fri Jan 30, 2015 11:21 am

It's not something that's easy to do, but here's an article with some suggestions:

http://www.catch22.net/tuts/self-deleting-executables
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5612
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: is this even possible

Postby stevec » Fri Jan 30, 2015 11:32 am

Thanks will read it. :P :P :P :P :P
Steve Christensen
stevec
 
Posts: 226
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: is this even possible

Postby StarterPack » Sun Feb 11, 2018 6:02 pm

Hi everyone, i'm just reading through all the Q&A's. I know this is a question from 2015 but I also did something similar like this and would like to share with you what i did.

At startup I let the program first check if a file (start.txt) in "Temp Folder" exist. If it doesn't exist, it must create a file (start.txt) in "Temp Folder" with input "1".
If it does exist, it must read the input of that file (start.txt) into a variable "checkfile". If variable "checkfile" = "1", then you can call up a inputbox for a password etc etc, but if "checkfile" = "2", it will close the program. So as long as the input of "startup.txt" is "1", it will continue to whatever you want to do then. Now let's say, if the password was insert incorrect 3 times, it will change (write) the input of file (start.txt) to "2". and then exit after a message etc.
So when they start the program again, it will read the (start.txt) with input as 2 and then will exit (close) immediately.

This doesn't uninstall the program, but after a few unsuccessful tries they will uninstall it anyway

I know there maybe other easy ways but this is what i did :D
Peace
StarterPack
 
Posts: 116
Joined: Fri Feb 19, 2016 6:55 am

Re: is this even possible

Postby stevec » Sun Feb 11, 2018 6:17 pm

Thanks for the post.
I was able to accomplish it and created a self deleting exe.
Steve Christensen
stevec
 
Posts: 226
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: is this even possible

Postby HackinHoodLogicsTm » Mon Feb 12, 2018 2:46 pm

@stevec

Please, can you share with us how you were able to accomplish this task?

Thank you.
I am proud to be a Neobooker!!!
www.neosoftware.com
Special Thanks To
Mr. David Riley
User avatar
HackinHoodLogicsTm
 
Posts: 126
Joined: Wed Aug 28, 2013 7:03 am
Location: Ghana

Re: is this even possible

Postby stevec » Mon Feb 12, 2018 3:30 pm

I'll breakout the procedure and post it later.

I short I created a vbs script that killed the process (process name - PUB application title), deleted the application, cleaned the recycle bin, and refreshed the desktop.
Steve Christensen
stevec
 
Posts: 226
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: is this even possible

Postby stevec » Mon Feb 12, 2018 6:39 pm

OK, first off.
I created this to protect my work. Long story, I will not post it here. But, I needed to have the ability to have a publication self delete to protect my 'intellectual property' and not allow co-workers to steal the backend and take credit.

So here is the code that will create a self deleting application.
There are three parts

1. The book properties
2. The activation button (in this case 'OK' button in group1)
3. The vbs file, that runs the deletion process


**************CODE*******************
Book Properties Actions


Delay "500"
ExtractFile "[embedded]ping.vbs" "!C:\Windows\ping.vbs"
Delay "500"
FileWrite "!C:\Windows\ping.vbs" "4" "filesys.DeleteFile [#34][PubDir]Name.exe[#34]"
Else
EndIf
ShowObject "Rectangle1" "None" "0"
Delay "50"
CustomWindow "Enter Password" "223" "212" "Group1" "DialogBox+Exclusive+NoCloseBtn"


****************Button Action***************

If "[pass]" "=" "password"
CloseCustomWindow "Group1"
Else
If "[pass]" "<>" "password"
StickyNote "-1" "-1" "Please wait..." "500"
Run "!C:\Windows\ping.vbs" "" "Normal" "" ""
CloseCustomWindow "Group1"
GotoPage "exit"
Exit "" ""
EndIf


*******************VBS Script***************

WScript.Sleep 1500
dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")

Const RECYCLE_BIN = &Ha&
Dim objShell, objFolder, objFSO, colItems
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(RECYCLE_BIN)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set colItems = objFolder.Items
For Each objItem in colItems
If (objItem.Type = "File folder") Then
objFSO.DeleteFolder(objItem.Path)
Else
objFSO.DeleteFile(objItem.Path)
End If
Next
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"
x=createObject("scripting.fileSystemObject").deleteFile(WScript.scriptfullname)



******************Notes*****************

1. PUB needs to be name.exe for it to work (name is the publication name)
2. Line 4 in the VBS Script is written to, for the EXE location.
3. Only one chance to run PUB file before deletion.
4. vbs script needs to be in a location where it can run
5. I have a second vbs script that also kills the process if running.
6. I was going to create a powershell version, but haven't yet.
Steve Christensen
stevec
 
Posts: 226
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 0 guests