Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpas6-install
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李金钢
cpas6-install
Commits
906822ad
Commit
906822ad
authored
Mar 12, 2026
by
李金钢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
90e2d913
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
0 deletions
+103
-0
build.js
build.js
+103
-0
No files found.
build.js
0 → 100644
View file @
906822ad
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
{
exec
}
=
require
(
'child_process'
);
// Define source and destination paths
const
dest
=
"E:/CPAS6-101 UFCPAS6.0 致同智审IAS版_测试版"
;
const
src
=
"G:/cpas-framework/release/win-unpacked"
;
// Function to execute shell commands
function
execCommand
(
command
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
exec
(
command
,
(
error
,
stdout
,
stderr
)
=>
{
if
(
error
)
{
reject
(
`Error:
${
stderr
}
`
);
}
else
{
resolve
(
stdout
);
}
});
});
}
// Recursive function to copy files and directories
function
copyFiles
(
src
,
dest
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
fs
.
readdir
(
src
,
(
err
,
files
)
=>
{
if
(
err
)
{
reject
(
`Error reading source directory:
${
err
}
`
);
}
let
promises
=
[];
files
.
forEach
(
file
=>
{
const
srcPath
=
path
.
join
(
src
,
file
);
const
destPath
=
path
.
join
(
dest
,
file
);
promises
.
push
(
new
Promise
((
resolve
,
reject
)
=>
{
fs
.
stat
(
srcPath
,
(
err
,
stats
)
=>
{
if
(
err
)
{
reject
(
`Error getting file stats:
${
err
}
`
);
}
else
{
if
(
stats
.
isDirectory
())
{
// Create directory and copy files inside it
fs
.
mkdir
(
destPath
,
{
recursive
:
true
},
(
err
)
=>
{
if
(
err
)
reject
(
`Error creating directory:
${
err
}
`
);
else
{
// Recursively copy directory contents
copyFiles
(
srcPath
,
destPath
).
then
(
resolve
).
catch
(
reject
);
}
});
}
else
{
// Copy file
fs
.
copyFile
(
srcPath
,
destPath
,
fs
.
constants
.
COPYFILE_FICLONE
,
(
err
)
=>
{
if
(
err
)
reject
(
`Error copying file:
${
err
}
`
);
else
resolve
();
});
}
}
});
}));
});
// Wait for all file operations to complete
Promise
.
all
(
promises
)
.
then
(
resolve
)
.
catch
(
reject
);
});
});
}
// Start process
async
function
main
()
{
try
{
console
.
log
(
`Source path:
${
src
}
`
);
console
.
log
(
`Destination path:
${
dest
}
`
);
// Create destination directory if it doesn't exist
if
(
!
fs
.
existsSync
(
dest
))
{
fs
.
mkdirSync
(
dest
,
{
recursive
:
true
});
}
// Copy files from source to destination (recursive)
console
.
log
(
"Starting file copy..."
);
await
copyFiles
(
src
,
dest
);
console
.
log
(
"File copy completed."
);
// Run the updateVersion.js script using Node
console
.
log
(
"Running updateVersion.js..."
);
await
execCommand
(
`node "
${
dest
}
/buildscript/updateVersion.js"`
);
console
.
log
(
"updateVersion.js completed."
);
// Run ISCC to compile the installer
console
.
log
(
"Running ISCC.exe..."
);
await
execCommand
(
`ISCC.exe "
${
dest
}
/CPAS6Setup_智审IAS作业平台.iss"`
);
console
.
log
(
"ISCC.exe completed."
);
console
.
log
(
"Script execution completed successfully."
);
}
catch
(
error
)
{
console
.
error
(
"An error occurred:"
,
error
);
}
}
// Execute the main function
main
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment