Old 9th October 2015, 12:59   #1
kalverson
Senior Member
 
Join Date: May 2007
Location: Maple Grove, Minnesota
Posts: 134
Years ago I added a native program to do this for me which has proven reliable ever since

// chkfolder.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "windows.h"

#define MAXPATH 1024

int result=0; // 0 = good - folder renames worked, not zero = bad - folder rename failed
wchar_t buf[MAXPATH]; // maxpath

int _tmain(int argc, _TCHAR* argv[])
{

// argv[1] = product folder

if (wcsnlen(argv[1], MAXPATH) > 0) {

HWND hWnd = GetConsoleWindow();
ShowWindow(hWnd, SW_HIDE);

result = _wrename(argv[1], argv[2]);

} else {
wprintf(L"product folder name must be at least one character in length.");
}

return result;
}
kalverson is offline   Reply With Quote
Old 9th October 2015, 13:18   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Quote:
Originally Posted by kalverson View Post
Years ago I added a native program to do this for me which has proven reliable ever since
_rename just calls MoveFile like NSIS.

Also, why would you use a console program if you just try to hide the console window anyway, it is going to flash up on the screen for a second.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump